You are on page 1of 28

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 f(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 )

1
2

df

dx

f 2 f dV

Where and 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)

where C=C(x)

1
2

dC
D

dx

dC
2
Cu
K r C 2mC dV
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 C 2
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

T(x) Ci x i 1 (where Ci are the unknowns)


i 1

Assume a quadratic function


T C1 C 2 x C3 x 2
with boundary conditions
T(0) 0 C1 0
T(L) 0 C 2 C3L

R-R Method (continued)


Hence,

T C3 (x 2 Lx)
dT
C3 (2x L)
dx

Now integrate
J

1 df

2 dx

Thus
J

f 2 f dV (let f T, k, 0, Q)

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,


2AkC3 L3 AQL3
J

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

(1)
dx u
u

where

(i)

du
i
dx

Variational methods (continued)


For higher derivatives of u,
J

Hence,

x2

x1

F x, u, u (1) , u (2) ,..., u (n ) dx

F d F
d 2
F

L
(

1)

u dx u (1)
dx 2 u (2)

n
d

F
n (n ) 0
dx
u

Variational methods (continued)


In 2-D, the constraints are
(1) satisfies the constraint u = u0 on
(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
kx ky Q 0
x
x
y
y

Applying the Euler-Lagrange relation


F d F
d F

0

u dx u x
dy u y

Variational methods (continued)


we find that
F
T
kx
u x
x
kx
F
2

dT

dx

F
T
,
ky
u y
y
2

F
,
Q
u

k y dT
C1 , F

2 dy

k dT
J(T) x

2
dx

k y dT

2 dy

C 2 , F QT C3

QT d

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

du
J x, u,
dx

du


dx

u 2xu dx

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)] a 11 (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,

J 3a1 1
5

0 a1
a1 10 6
18
Finally

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

0x L
for x 0
for x L

weak statement (continued)


Integrating,

or

q
1 L
T x TL L x
K
K x

T x TL

Q z dz dy

q
Q 2 2
L

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 L
x x
2

Bu=g on


B=
,
,L
x 0 x
0

weak statement (continued)


Since u = cii(x,y) is an approximate function,
substitution into the above equation may not
satisfy the equation. We set the equation equal to
an error ()

Au f
We now introduce a set of weighting functions (test
functions) Wi, and construct an inner product
(Wi,) that is set to zero this forces the error of
the approximate differential equation to zero
(average).

weak statement (continued)


Hence,

d A c f
i

Example:

d 0

2u 2u
2 2 f x, y
x y

The inner product becomes

2u 2u

i , i dxdy i 2 2 f x, y dxdy 0
y
x

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 Galerkins 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
1

i , 0 i dx 0

or

d2u
i
f dx 0
2
dx

where u=c11 c1 x 2 2xL

The weak statement becomes


L
du L L d1 dc11
1
dx 1fdx 0
0
0 dx
0
dx
dx

weak statement (continued)


Since
we obtain

du
0 at x=L
dx
f
c1
2
f
u x 2 2xL
2

This is the same as the Rayleigh-Ritz Method


but no variational principle is required.

Weighting Function Choices


Galerkin

Wi i

i , 0
Least Squares

,
ci

which is the square of the error

Method of Moments
i
x
, 0

i=0,1,2,L

Wi any set of linearly independent functions

Weighting Function Choices (continued)


Collocation

Wi x x i

x x , 0
i

xi

Sub domain
1 for x in subinterval i
Wi
0 for x outside i

Least Squares Example


Let


,
ci
ci

dxdy 2 c dxdy 0
2

For the previous example problem

, 2 dx 0
ci
ci
2c1 f

u c11 c1 x 2 2xL
u
c1 2x 2L

x
2u
2c1

2
x

Least Squares Example (continued)


Thus,
L

2 2c
0

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

You might also like