FEM Lecture 3 Method of Weighted Residuals

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10
At a glance
Powered by AI
The key takeaways are that the method of weighted residuals can be used to develop finite element equations for problems defined by differential equations when a variational principle is not available. Galerkin's method, a type of weighted residuals method, is described for developing the finite element equations for an axially loaded bar problem.

The method of weighted residuals involves choosing a trial function to approximate the solution, substituting it into the governing differential equation to obtain a residual, then requiring that a weighted integral of the residual is minimized over the domain.

Galerkin's method works by using the same weighting functions as the trial functions. This ensures that the weighted values can recover the domain values. It results in a symmetric stiffness matrix for the problem.

Method of weighted residuals

Engineering problems can be described by ODE (Ordinary differential equation) or


PDE (Partial differential equation). It is usually not possible to solve the derived ODE
or PDE analytically.
In fields other than structural/solid mechanics, it is quite probable that a variational
principle, analogous to the principle of minimum potential energy, for instance, may
not be known or even exists. In some flow problems in fluid mechanics and in mass
transport problems, we often have only the differential equation and boundary
conditions available. However, the finite element method can still be applied.
The methods of weighted residuals applied directly to the differential equation can be
used to develop the finite element equations. In this section, we describe Galerkins
residual method in general and then apply it to the bar element. This development
provides the basis for later applications of Galerkins method to the beam element
and to the nonstructural heat-transfer element (specifically, the one-dimensional
combined conduction, convection, and mass transport element. Because of the mass
transport phenomena, the variational formulation is not known (or certainly is difficult
to obtain), so Galerkins method is necessarily applied to develop the finite element
equations.
In weighted residual methods, a trial or approximate function is chosen to
approximate the independent variable, such as a displacement or a temperature, in a
problem defined by a differential equation. This trial function will not, in general,
satisfy the governing differential equation. Thus substituting the trial function into the
differential equation results in a residual over the whole region of the problem as
follows:

In the residual method, we require that a weighted value of the residual be a minimum
over the whole region. The weighting functions allow the weighted integral of
residuals to go to zero. If we denote the weighting function by W, the general form of
the weighted residual integral is

1
Governing ODE for linear elastic problem of an axially loaded bar
Consider an infinitesimal slice of the axial bar

y
q(x)
x, u
q(x)
P(x) P(x) + P(x)
x
F

Force equilibrium for the slice:
** Note: variable x are omitted in P(x), A(x), (x), E(x), (x), q(x), u(x) for clarity.
) ( ) ( P P x q P A + + A =
( )
0 = +
A
A +
q
x
P P P

Taking the limit as , the LHS function becomes 0 Ax

( )
0 lim
0
= +
|
.
|

\
|
A
A +

A
q
x
P P P
x

0 = + q
dx
dP

Having
c o AE A P = =
( )
dx
du
x
u u u
x
=
|
.
|

\
|
A
A +
=
A 0
lim c
Hence
|
.
|

\
|
=
dx
du
AE
dx
d
dx
dP

The ODE in terms of displacement u(x) is
0 ) ( ) ( ) ( = +
|
.
|

\
|
x q
dx
du
x E x A
dx
d

Next step, we identify the boundary conditions:
1. At left end x = 0, u = 0
2. At right end x = L, f = F
2
The ODE is in terms of u. We need to describe boundary condition (2) in terms of u.
( ) ( )
L x
L x L x
dx
du
AE AE A
=
= =
|
.
|

\
|
= = = F
Therefore, the boundary conditions become
1. At left end x = 0, u = 0
2. At right end x = L,
L x L x
AE
F
dx
du
= =
=
The problem can be stated as
Find u(x) which satisfies
0 ) ( ) ( ) ( = +
|
.
|

\
|
x q
dx
du
x E x A
dx
d

u(0) = 0
L x L x
AE
F
dx
du
= =
=
Note: for engineering problem, we usually want to find both
= ) (x u displacement at point x
= ) (x o stress at point x
To do it, the ODE with boundary conditions is solved to obtain u(x). The stress field
) (x o is then obtained from the stress-strain-displacement relationship
dx
du
x E x x E x) ( o ) ( ) ( ) ( = = c
Now we attempt to find the approximated solution for our mathematical problem
using a method which is called method of weighted residual
Method of weighted residual
Method outline:
1. Nominate a trial solution u(x) which contains n nodal unknown solutions that
we need to find.
2. Substitute the trial solution into the ODE. Compute the point-wise residual
residual(x)
3. Weight the point-wise residual by n nominated weighting function w
i
(x).
4. Integration of each weighted residual over the whole domain is set to zero. A
system of n independent equations for n unknown coefficients must be formed
from this action.
5. Solve the system of n equations for n unknown coefficients. Use them to
recover approximate solutionu(x) .
The method is applied here to solve the ODE for the linear static problem of the axial
bar for illustration.
3
Step 1: Trial solution u(x)
The problem is described on domain | | L x ; 0 e . We introduce a finite number of nodes
n into the domain. For an arbitrary node i
th
, the location is x
i
, the unknown nodal
displacement is u
i
, ..etc.


3 4 5 2 1

An example of the 1D domain with 5 global nodes (n=5).
The trial solution ) (x u is assumed to be in the form
| |
| |{ } u x N x u
u
u
u
u
x N x N x N x N x u
u x N u x N u x N u x N x u
n
n
n n
) ( ) (
...
) ( ... ) ( ) ( ) ( ) (
) ( ... ) ( ) ( ) ( ) (
3
2
1
3 2 1
3 3 2 2 1 1
=

=
+ + + + =

Where
1. n nodal displacements u
1
, u
2
, u
n
are n unknown that we need to find.
2. Function is called shape function. (Shape function is a key ingredient of
the FEM). It is generally defined by continuous polynomial which has following
properties:
) (x N
i
2a. The shape function associated with node i has a value of 1 at node i and
vanishes at all other nodes.
2b. Sum of all shape functions equals 1, 1 ) (
1
=

=
n
i
i
x N

4



) (
1
x N : High order shape function (in red)





) (
2
x N : High order shape function (in red)
3 4 5 1 2
N
1
(x)
1
N
2
(x)
1 3 4 5 2
1

1
st
property enforces the approximate solution to be equal the nodal variable at each
node, i.e.
i
x x
u x u
i
=
=
) ( . Importance of 2
nd
property reveals throughout the formulation
and be addressed in later stage of this lecture.

Extension to 2D and 3D are straightforward
In 2D, ( ) ( ) ( )
( )
( )


y x u
y x u
x u y x N x N y x x
y
x
,
,
) ( , , ) ( , ,
In 3D, ( ) ( ) ( )
( )
( )
( )


z y x u
z y x u
z y x u
x u z y x N x N z y x x
z
y
x
, ,
, ,
, ,
) ( , , , ) ( , , ,
Step 2: Point-wise residual residual(x)
Mathematical background
For numerical analysis, residual means the error in a result. Suppose we have
b x f = ) (
Given an approximated solution x
0
, the residual is the difference
b x f
o
) (
Whereas the error is
x x
0

In our case, we have 0 ) ( ) ( ) ( = +
|
.
|

\
|
x q
dx
du
x E x A
dx
d
,
By definition, we have b=0, the residual at location x equals
) ( ) ( ) ( ) ( x q
dx
u d
x E x A
dx
d
x residual +
|
|
.
|

\
|
=
As ) (x u is the approximated solution only, this residual is generally different from 0.
If we want ) (x u to be a good approximation of the exact , we must define the
unknown coefficients u
1
, u
2
u
n
in such a way that the residual is minimised over the
domain , i.e.
) (x u
| L x ; 0 e |
minimum ) (
0
=
}
dx x residual
L
for | | L x ; 0 e
Step 3: Weighting function w(x)
To minimize the domain residual, a mathematical method which is called the method
of weighted residuals is employed. Note that we have n unknowns to find, therefore a
set of n weighting function are selected to yield a system of n linear
independent equations. The weighted residuals over the problem domain are then set
to zero. We have
) (x w
i
5
0 ) ( ) (
0
= =
}
dx x residual x w R
L
i i

=
=
=
}
}
}
0 ) ( ) (
.....
0 ) ( ) (
0 ) ( ) (
equations t independen linear n
0
0
2
0
1
dx x residual x w
dx x residual x w
dx x residual x w
L
n
L
L

Most popular methods for defining are ) (x w
i
1. Collocation method:
The weighting function is the Dirac delta function evaluated at nodal points
( )
i i
x x x w = o ) (
Having ( ) 0 ) ( ) (
0
= = =
}
L
i i i
x residual dx x residual x x R o
This method enforces the residual to be zero at each nodal point but could be anything
in between.
2. Least square method:
The weighting function is defined as the partial derivative of the residual

( )
i
i
u
residual
x w
c
c
= ) (
3. Galerkins method:
The weighting functions are the derivatives of the trial solution ) (x u with respect to
the unknowns

function shape the i.e. ), ( ) (
) (
x N x w
du
u d
x w
i i
i
i
=
=

The weighting function defined by Galerkins method is used in the formulation of
the FEM.
Strong form and weak form of the weighted residual R
}
(
(

+
|
|
.
|

\
|
=
L
dx x q
dx
u d
x E x A
dx
d
x w R
0
) ( ) ( ) ( ) (
When R includes the highest order of derivative term in the differential equation, it is
regarded as the strong formulation of the weighted residual method. In this example
highest order of differentiation of the variable ) (x u is 2
nd
order. To yield a
meaningful approximation, the trial solution function ) (x u must be differentiable
6
twice and its 2
nd
derivative must not vanish on the domain | | L x ; 0 e , i.e. the shape
functions in | have to be at least quadratic functions. To reduce the requirement
for
| ) (x N
) (x u in terms of order of differentiability, integration by parts is applied to the
strong form
x q x w dx
dx
dw
dx
u d
x E x A
u
x A x w
dx x q
dx
u d
x E x w R
L L
L
o
L
( ) ( ) ( ) ( ( ) (
) ( ) ( ) ) (
0 0
0
} }
}
+
|
|
.
|

\
|
=
(

+
|
|
.
|
=
dx
d
x E
x A
dx
d
) ( )
(

\
|

dx )
Mathematics background:
Integration by part states , where u, v are functions u(x), v(x)
}
= vdu uv udv
}
The new expression needs 1
st
order differentiation instead of 2
nd
order differentiation.
As a result, the requirement for ) (x u and hence | | ) (x N is reduced for R. This
formulation is called the weak formulation of the weighted residual method. We will
use the Galerkins method and the weak formulation to continue with our FEM
formulation.
Describe weak form of the weighted residual R in matrix form with FEM notations
to prepare for systematic FEM formulation
Galerkins method:
) (
function shape the i.e. ), ( ) (
) (
'
x N
dx
dN
dx
dw
x N x w
du
u d
x w
i
i i
i i
i
i
= =
=
=

(the dash sign means differentiation)
| |{ } ( ) | | { } u x N
dx
d
u x N
dx
d
dx
u d
|
.
|

\
|
= = ) ( ) (
| |
(

=
dx
dN
dx
dN
dx
dN
dx
dN
x N
dx
d
n
.... ) (
3 2 1

The derivative operator is denoted as matrix [L], the above equation becomes
| || | | | ) ( ) ( x B x N L =
Where
| | ( ) B x =Element strain displacement matrix
The approximated strains and stresses are
| |{ } u x B x ) ( ) ( = c
| || |{ } u x B D x E x ) ( ) ( ) ( = = c o
In above, matrix | | D refers to the stress/strain matrix or constitutive matrix. In this
1D problem, =E. Assume E = constant for formulation clarity. |D|
Back to our computation of the weighted residuals, we have
7
0 ) ( ) ( ) ( ) ( ) (
0 0
= +
|
|
.
|

\
|
=
} }
dx x q x w dx
dx
dw
dx
u d
E x A
dx
u d
E x A x w R
L L
L
o

= +
|
|
.
|

\
|
=
= +
|
|
.
|

\
|
=
= +
|
|
.
|

\
|
=
= +
|
|
.
|

\
|
=
} }
} }
} }
} }
0 ) ( ) ( ) ( ) ( ) (
....
0 ) ( ) ( ) ( ) ( ) (
0 ) ( ) ( ) ( ) ( ) (
0 ) ( ) ( ) ( ) ( ) (

are equations t independen linear n
0 0
0
3
0
3
3 3
0
2
0
2
2 2
0
1
0
1
1 1
dx x q x w dx
dx
dw
dx
u d
E x A
dx
u d
E x A x w R
dx x q x w dx
dx
dw
dx
u d
E x A
dx
u d
E x A x w R
dx x q x w dx
dx
dw
dx
u d
E x A
dx
u d
E x A x w R
dx x q x w dx
dx
dw
dx
u d
E x A
dx
u d
E x A x w R
L
n
L
n
L
o
n n
L L
L
o
L L
L
o
L L
L
o

By substituting the terms accordingly, the system becomes
{ }
{ }
{ }
{ }

= +
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|
=
= +
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|
=
= +
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|
=
= +
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|
=
} }
} }
} }
} }
= =
= =
= =
= =
0 ) ( ) ( ) ( )] ( [ ] [ ) ( ) ( ) ( ) ( ) (
....
0 ) ( ) ( ) ( )] ( [ ] [ ) ( ) ( ) ( ) ( ) (
0 ) ( ) ( ) ( )] ( [ ] [ ) ( ) ( ) ( ) ( ) (
0 ) ( ) ( ) ( )] ( [ ] [ ) ( ) ( ) ( ) ( ) (

0 0
'
0
0
3
0
'
3
0
3 3 3
0
2
0
'
2
0
2 2 2
0
1
0
'
1
0
1 1 1
dx x q x N u dx x A x B D x N
dx
u d
E x A x N
dx
u d
E x A x N R
dx x q x N u dx x A x B D x N
dx
u d
E x A x N
dx
u d
E x A x N R
dx x q x N u dx x A x B D x N
dx
u d
E x A x N
dx
u d
E x A x N R
dx x q x N u dx x A x B D x N
dx
u d
E x A x N
dx
u d
E x A x N R
L
n
L
n
x
n
L x
n n
L L
x L x
L L
x L x
L L
x L x
With , the first two terms in above equations equals zero
except for 1
st
equation ( and last equation (
i , j x x x N
x x x N
j i
i i
= = =
= =
if 0 ) (
if 1 ) (
1
= x x ) 0 = ) L x x
n
= = . Hence,
8
{ }
{ }
{ }
{ }

= +
|
|
.
|

\
|

|
|
.
|

\
|
=
= +
|
|
.
|

\
|
=
= +
|
|
.
|

\
|
=
= +
|
|
.
|

\
|

|
|
.
|

\
|
=
} }
} }
} }
} }
=
=
0 ) ( ) ( ) ( )] ( [ ] [ ) ( ) (
....
0 ) ( ) ( ) ( )] ( [ ] [ ) ( 0
0 ) ( ) ( ) ( )] ( [ ] [ ) ( 0
0 ) ( ) ( ) ( )] ( [ ] [ ) ( ) (

0 0
'
0
3
0
'
3 3
0
2
0
'
2 2
0
1
0
'
1
0
1
dx x q x N u dx x A x B D x N
dx
u d
E x A R
dx x q x N u dx x A x B D x N R
dx x q x N u dx x A x B D x N R
dx x q x N u dx x A x B D x N
dx
u d
E x A R
L
n
L
n
L x
n
L L
L L
L L
x

0
) (
=
|
|
.
|

\
|

x
dx
u d
E x A and
L x
dx
u d
E x A
=
|
|
.
|

\
|
) ( are the external nodal forces F
0
and F
L
at the
start and the end of the axial bar. All first terms form a vector {F} of size n x 1
{ } | |
T
L
F F F 0 ... 0
0
=

Write all 2
nd
terms in matrix form. They form negative of the multiplication of size n
x n stiffness matrix [K] and size n x 1 nodal displacement vector {u}.
| | | || | dx x A x B D x B K
L
T
) ( ) ( ) ( ] [
0
}
=
| |
0
1
1 1
1
L
L
K AE d
L L
L
(

(
(
=
(
(

(
(

}
x
| |
1 1
1 1
AE
K
L
(
=
(




When the Galerkins method and the weak formulation are used, combination of these
two results in symmetric element stiffness matrix and banded symmetric global
stiffness matrix for unknown nodal displacements in the trial solution. This advantage
reduces significantly the computational cost for solving the ODE.

Consider the term , the weighting function weights and lumps
the traction to node i. The integral hence computes the
equivalent nodal force at node i. Write all 3
rd
terms in matrix form. They form a nodal
force vector {f} of size n x 1.
dx x q x N
L
i
) ( ) (
0
}
) (x N
i
dx ) ) (x q x q x N
L
i
( ) (
0
}
9
| |
}
=
L
T
n
dx x q x N x N x N f
0
2 1
) ( ) ( .... ) ( ) (
We combine into { and modify [K] to include the boundary conditions { } F } f
The system of n linear independent equations becomes
{ } { } f u K = ] [

We solve for the nodal displacement vector { } u . Then we compute our approximated
solution
| |{ } u x N x u ) ( ) ( =
| || |{ } u x B D x ) ( ) ( = o

2
nd
property of shape functions states that the sum of all shape functions equals 1,
i.e. . In Galerkins method, the shape functions are also the weighting
function. This property ensures that shape functions can act as weighting factors to the
integrals, i.e. summation of the weighted values recover the domain value.
1 ) (
1
=

=
n
i
i
x N

For example,
If we sum the weighted residuals, we have domain residual
n
L
n
i
i
L
R R R
dx x q
dx
u d
x E x A
dx
d
x N dx x q
dx
u d
x E x A
dx
d
+ + + =
(
(

+
|
|
.
|

\
|
|
.
|

\
|
=
(
(

+
|
|
.
|

\
|
}

}
=
....
) ( ) ( ) ( ) ( ) ( ) ( ) (
2 1
0
1
0

When weighting the traction over the domain, we have
| |
}
=
L
T
n
dx x q x N x N x N f
0
2 1
) ( ) ( .... ) ( ) (
Summation of all equivalent nodal force terms in the nodal force vector recovers full
traction over the domain
}

} } }
|
.
|

\
|
= + + +
=
L
n
i
i
L
n
L L
dx x q x N dx x q x N dx x q x N dx x q x N
0
1
0 0 0
2 1
) ( ) ( ) ( ) ( .... ) ( ) ( ) ( ) (



10

You might also like