Lesson 5 - University of Nevada, Las Vegas

Download Report

Transcript Lesson 5 - University of Nevada, Las Vegas

Lesson 5
Method of Weighted Residuals
Classical Solution Technique
The fundamental problem in calculus of variations is to obtain
a function f(x) such that small variations in the function
df(x) will not change the original function
The variational function can be written in general form for a
second-order governing equation (no first derivatives) as
J(f ) 

2


1  df 
2
a    bf  2gf  dV
2   dx 

V
Where a,b, and g are prescribed values
Classical solution (continued)
An equation containing first-order derivatives may
not have a corresponding variational function. In
some cases, a pseudovariational function can be
used
J(C) 

V
where C=C(x)
2


1
dC
 dC 
2
 K r C  2mC  dV
D 
  Cu
2   dx 
dx

Classical solution (continued)
Example:
Consider a rod of length L. The equation defining heat transfer in the rod is
d 2T
Q

2
dx
k
with boundary conditions
T(0)  T(L)  0
Integrating twice, one obtains
Qx 2
T
 C1x  C2
2k
Applying boundary conditions, the final result is
Q(Lx  x 2 )
T
2k
Rayleigh-Ritz Method
FEM variational approach attributed to Lord Rayleigh
(1842-1919) & Walter Ritz (1878-1909)
Let
n
T(x)   Ci x i 1 (where Ci are the unknowns)
i 1
Assume a quadratic function
T  C1  C2 x  C3x 2
with boundary conditions
T(0)  0  C1  0
T(L)  0  C2   C3L
R-R Method (continued)
Hence,
T  C3 (x 2  Lx)
dT
 C3 (2x  L)
dx
Now integrate
J

2

1   df 
2
a    b f  2gf  dV (let f  T, a  k, b  0, g  Q)
2   dx 

V
Thus
J

V
1
 kC32 (2x  L) 2  2QC3 (x 2  Lx)  Adx
2
R-R Method (continued)
which becomes
AkC32 L3 AC3QL3
J

6
6
To find the value of C3 that makes J a minimum,
J 2AkC3L3 AQL3


0
C3
6
6
Therefore,
Q
C3  
2k
Q(Lx  x 2 )
or T 
2k
Variation Methods
Given a function u(x), the following constraints must
be met
– (1) satisfies the constraints u(x1)=u1 and
u(x2)=u2
– (2) is twice differentiable in x1<x<x2
– (3) minimizes the integral
J

x2
x1
du 

F  x, u,  dx
dx 

Variational methods (continued)
Then it can be shown that u(x) is also the solution of
the Euler-Lagrange equation
d  F  F
0
 (1)  
dx  u  u
where
i
u
(i)
du
 i
dx
Variational methods (continued)
For higher derivatives of u,
J

x2
F  x, u, u (1) , u (2) ,..., u (n)  dx
x1
Hence,
F d  F  d 2  F 
  (1)   2  (2)  
u dx  u  dx  u 
n
d
(1) n n
dx
 F 
 (n)   0
 u 
Variational methods (continued)
In 2-D, the constraints are
– (1) satisfies the constraint u = u0 on G
– (2) is twice differentiable in domain A(x,y)
– (3) minimizes the functional
J
and



u u 
F  x, y, u, , d
x y 

  

F  
F
F
 
 
0
u x  (u / x)  y  (u / y) 
Variational methods (continued)
Example:
Find the functional statement for the 2-D heat
diffusion equation
  T    T 
Q  0
 kx
   ky
x  x  y  y 
Applying the Euler-Lagrange relation
F d  F
 
u dx  u x
 d  F 
  0
  
 dy  u y 
Variational methods (continued)
we find that
F
T
 kx
u x
x
kx
F 
2
F
T
,
 ky
u y
y
F
,
Q
u
2
k y  dT 
 dT 
  C2 , F  QT  C3

  C1 , F  
2  dy 
 dx 
k
J(T)    x

2
2
2

k
 dT 
y  dT 
  QT d

  
2  dy 
 dx 

2
which yields the final functional form
A Rayleigh-Ritz Example
Begin with the equation
d2u
 u  x  0 0  x 1
2
dx
with boundary conditions
u(0)  u(1)  0
First find the variational statement (J)
R-R example (continued)
The variational statement is

1
2


du 

 du 
2
J  x, u,      u  2xu dx
dx 

 dx 

0
Assume a quadratic approximation
u(x)  a 0  a1x  a 2 x 2
with boundary conditions
u(0)  a 0  0
u(1)  a1  a 2  0
R-R example (continued)
Thus,
u(x)  a1[x(1  x)]  a11 (x)
du
 a1 (1  2x)
dx
Now,
1
J(a1 )   a12 (1  2x)  a12 x 2 (1  x)2  2a1x 2 (1  x) 2 dx
0
To be a minimum,
Finally
J 3a1 1
5

  0  a1 
a1 10 6
18
5
u(x)  x(1  x)
18
The Weak Statement
• Method of Weighted Residuals - one does not need
a strong mathematical background to use FEM.
However, one must be able to integrate.
• To illustrate the MWR, let us begin with a simple
example - Conduction of heat in a rod of length L
with source term Q.
d 2T
K 2  Q
dx
dT
K
q
dx
T  TL
0 x L
for x  0
for x  L
weak statement (continued)
Integrating,
q
1 L y
T  x   TL   L  x      Q  z  dz dy
K
K x0

or
T  x   TL 

q
Q 2 2
L

x

L x


K
2K

This analytical solution serves as a useful benchmark
for verifying the numerical approach.
weak statement (continued)
There are basically two ways to numerically solve
this equation using the FEM: Rayleigh – Ritz
Method and the Galerkin Method ( which
produces a “weak” statement)
Consider
A  f  0
in 


A
 2
x x
2
Bu=g on G


B= 
,
,
 x 0 x
0



T
weak statement (continued)
Since u = cii(x,y) is an approximate function,
substitution into the above equation may not
satisfy the equation. We set the equation equal to
an error (e)
Au  f  e
We now introduce a set of weighting functions (test
functions) Wi, and construct an inner product
(Wi,e) that is set to zero – this forces the error of
the approximate differential equation to zero
(average).
weak statement (continued)
Hence,
  ed     A  c    f  d  0
i

Example:
i
j
j

2u 2u
e   2  2  f  x, y 
x y
The inner product becomes
 2u 2u

 i , e     iedxdy    i  2  2  f  x, y   dxdy  0
 x y

weak statement (continued)
Integrating by parts (Green-Gauss Theorem)
 u
 i u i u

u 
 i  dy  dx     

 i f  x, y   dxdy  0
y 
 x
 x x y y

Problem: Use Galerkin’s Method to solve
d2u
f 0
2
dx
u=0 x=0
du
=0 x=L
dx
0<x<L
weak statement (continued)
The inner product is
 i , e   0 iedx  0
1
or

L
0
 d2u

i  2  f  dx  0
 dx

where u=c11  c1  x 2  2xL 
The weak statement becomes
L
du L L d1 dc11
1
dx   1fdx  0
0 
0 dx
0
dx
dx
weak statement (continued)
Since
du
 0 at x=L
dx
we obtain
f
c1  
2
f 2
u    x  2xL 
2
This is the same as the Rayleigh-Ritz Method
but no variational principle is required.
Weighting Function Choices
• Galerkin
Wi  i
 i , e   0
• Least Squares

 e, e  which is the square of the error
ci
• Method of Moments
i
x
 , e  0
i=0,1,2,
Wi  any set of linearly independent functions
Weighting Function Choices (continued)
• Collocation
Wi  d  x  x i 
d  x  x  , e  0
i
xi
• Sub domain
1 for x in subinterval i
Wi  
0 for x outside i
Least Squares Example
Let

 
e
2

 e, e      e dxdy    2e dxdy  0
ci
ci
ci
For the previous example problem

e
 e, e    2e dx  0
ci
ci
e  2c1  f

2
 u  c11  c1  x  2xL 

 u
  c1  2x  2L 
 x
 2u
 2  2c1
 x
Least Squares Example (continued)
Thus,
 2  2c
L
0
1
 f  2dx  0
f
c1  
2
f 2
u    x  2xL 
2
Some observations:
(1) no integration by parts required – not a weak form
(2) the Neumann boundary conditions do not appear naturally
(3) in this case i must satisfy global boundary conditions,
which is difficult in most problems