Ch5 Method of Weighted Residuals
Ch5 Method of Weighted Residuals
Atique Ahmad
عتیق احمد
Contact:
[email protected]
Chapter – 5
Method of Weighted Residuals
Introduction
●
So far we learned about bar & truss (tension-compression) and beam
& frame (bending) elements.
●
All these are collectively called line elements.
●
Elementary theory from mechanics of materials was used to derive
their stiffness matrices.
●
To extend the method of finite element analysis to more general
situations, particularly nonstructural applications, additional
mathematical techniques are required.
●
In this chapter, the method of weighted residuals is described in
general and Galerkin’s method of weighted residuals is emphasized as
a tool for finite element formulation for essentially any field problem
governed by a differential equation.
●
Most engineering problems are modeled using partial differential
equations (PDE) and due to the complex geometries, exact solutions
are not possible for real-world problems.
●
FEM has emerged as a powerful mathematical technique to obtain
approximate solutions of partial differential equations.
●
FEM is based on several fundamental, approximation techniques, one
of which will be discussed now and subsequently applied to finite
element formulation.
●
In the method of weighted residuals, we use trial functions that
satisfy the prescribed boundary conditions.
●
Integral formulations are used to minimize error, in an average sense,
over the entire domain.
●
The method is explained first for 1D case and then extended to 2D/3D
●
This simplifies mathematics to ordinary partial differential equations.
●
Consider the general form of an ODE with its BCs:
D[ y ( x), x ]=0 , y (a)= y (b)=0 , a< x <b
●
In MWR, we seek an approximate solution of the form:
n
*
y ( x )=∑ c i N i ( x)
y* is the approximate solution, i=1
ci are unknown constant parameters to be determined,
Ni(x) are the trial functions.
●
Trial functions must:
●
Satisfy the “physics” of the problem in a general sense,
●
Be continuous over the domain,
●
Satisfy the boundary conditions exactly.
●
Since we assume that some trial function may serve as an approximate
solution, therefore, it is likely that when this solution is substituted in
the differential equation, a residual error results. D [ y ( x), x ]=0
n
*
such that: R( x)=D [ y ( x) , x]≠0 y * ( x)=∑ c i N i ( x)
i =1
● R(x) will now be called residual, which is also a function of ci.
● Method of weighted residuals requires that these parameters ci are
b
such that:
∫ wi ( x) R ( x) dx=0 i=1 ... n
a
● Where wi(x) represent n arbitrary weighting functions.
●
This set of integral equations means that we have enforced the error
over the entire domain to be zero.
●
Our approximate solution is already exact at boundaries, but some
residual error is present in the interior of the domain.
●
It is still possible, however rare, that solution is exact everywhere.
●
There are actually many variations of MWR, depending mainly on
how the weighting factors are chosen or determined. Some are:
●
Point collocation,
●
Sub-domain collocation,
●
Least squares,
●
Galerkin’s method: most easily adaptable for use in FEM. We will study
only this in this course.
●
Weighting functions are chosen to be identical to trial functions, i.e.,
wi ( x)=N i (x) i=1... n
b b
●
Therefore: *
∫ wi ( x) R ( x) dx=0=∫ N i ( x) D [ y ( x) , x]dx=0 i=1 ... n
a a
●
These integral equations are solved for unknown parameters as
explained using a simple example.
2
●
Solve: d y 2
2
−10 x =5 , y (0)= y (1)=0 , 0≤x≤1
dx
●
Due to presence of 2nd order term, we use polynomial trial functions:
p q
N ( x)=(x−x a ) ( x−x b )
●
N(x) is continuous in this interval. For simplicity, let p = q = 1
● In our case xa = 0, xb = 1 N 1 ( x)=x (x−1)
●
Approximate solution becomes:
n
y * ( x )=∑ c i N i ( x)=c 1 x ( x−1)
●
Differentiating: i=1
* 2 *
dy d y
=c1 (2 x−1) , =2 c1
dx dx
2
●
In the ODE, 2nd derivative is also a function of x, but our trial
function’s 2nd derivative is constant, i.e., the physics of the problem is
not satisfied here. Still, proceed to explain the overall methodology.
03/01/21 | 08:48 ME-424 Finite Element Analysis 7/38
Galerkin’s Method – Example
●
Next step is to find the residual by substituting y*(x) into the ODE.
2
R( x ; c 1 )=2 c 1−10 x −5 1
●
Now to write the integral equations: ∫ x (x−1)(2 c1−10 x 2−5) dx=0
● Do the math to find out that c1 = 4, 0
*
●
Thus our approximate solution is: y (x)=4 x (x−1)
●
The exact solution of this ODE is:
5 4 5 2 10
y ( x)= x + x − x
6 2 3
●
Comparing graphically:
●
Reasonably approximate,
●
Approx solution is symmetric,
●
Exact solution is not.
●
Next we try to approach exact one.
●
Try a two-term solution: N 1 ( x)=x ( x−1), N 2 ( x)=x 2 (x−1)
2
●
Approximate solution is: y ( x )=∑ ci N i ( x)=c 1 x( x−1)+c 2 x2 ( x−1)
*
2 * i=1
d y
●
Differentiate to find: 2
=2 c1 +2c 2 (3 x−1)
dx
●
Substitute in the ODE to find the residual:
R(x ; c1 )=2 c1 +2c 2 (3 x−1)−10 x2 −5
●
Next, write the integral equations:
1
2
∫ x (x−1)[2 c1 +2 c2 (3 x−1)−10 x −5] dx=0
0
1
2 2
∫ x ( x−1)[2 c1 +2 c2 (3 x−1)−10 x −5]dx=0
0
● Solve to get c1 = 19/6 , c2 = 5/3, thus our two term solution becomes:
* 19 5 2 5 3 3 2 19
y ( x )= x ( x−1)+ x ( x−1)= x + x − x
6 3 3 2 6
03/01/21 | 08:48 ME-424 Finite Element Analysis 9/38
Galerkin’s Method – Improved Result Comparison
●
Comparing exact solution and our one-term and two-term
approximate solutions:
●
Two-term solution seems quite accurate; almost overlaps exact one.
2
d y
2
+ y=4 x , y(0)=0 , y (1)=1 , 0≤x≤1
dx
●
Solving this requires a modification since it is not possible to
construct a trial solution of the form c1N1(x) that satisfies both BC.
*
●
Instead, we try: y =c 1 N 1 ( x)+f (x)
● Where first part c1N1(x) satisfies the homogeneous BC and second part
f(x) satisfies the non-homogeneous BC.
*
●
One such solution is: y =c 1 x(x−1)+ x
●
Substitute into the ODE to find the residual:
2 *
d y *
R( x ; c 1)= 2 + y −4 x
dx
2
=2 c 1 +(c 1 x −c 1 x + x)−4 x
2
=c 1 x −c 1 x+2 c 1 −3 x
=c 1 ( x 2 −x +2)−3 x
●
How does one know when the MWR solution is accurate enough, without
knowing the exact solution? This is the question of convergence and must be
addressed in all approximate solution techniques.
●
In general, for the method of weighted residuals, the procedure is to continue
obtaining solutions while increasing the number of trial functions and note the
behavior of the solution.
●
If the solution changes very little as we increase the number of trial functions,
we can say that the solution converges.
●
Whether the solution converges to the correct solution is yet another question.
●
While beyond the scope of this course, a large body of theoretical mathematics
addresses convergence and whether the convergence is to the correct solution.
●
We assume that a converging solution converges to the correct one.
●
Certain checks, external to the solution procedure, can be made to determine
the “reasonableness” of a numerical solution in the case of physical problems.
●
These checks include equilibrium, energy balance, heat and fluid flow balance.
2
d y 2
2
−10 x =5 , y (0)= y (1)=0 , 0≤x≤1
dx
●
Assume a trial function in the form of general polynomial:
* 2
y (x)=c 0 +c 1 x +c 2 x +...
●
Start with quadratic form, without higher order terms. And apply BC.
* *
y (0)=0=c 0 , y (1)=0=c 1 +c 2
● 2nd BC implies that c1 and c2 are not independent, rather c2 = – c1 , thus
* 2 2
y (x)=0+c 1 x+c 2 x =c 1 x−c 1 x =c 1 x(1−x)
●
This is same as we obtained in our first try.
●
To increase accuracy, add a cubic term an write a trial solution:
* 2 3
y ( x)=c 0 +c 1 x +c 2 x +c 3 x
2
d y 2
2
−10 x =5 , y (0)= y (1)=0 , 0≤x≤1
dx
●
After adding a cubic term an write a trial solution:
y * (x)=c 0 +c 1 x +c 2 x 2 +c3 x 3
●
Apply boundary conditions:
* *
y (0)=0=c 0 , y (1)=0=c 1 +c 2 +c3
● Express the 2nd BC as a constraint as: c3 = – (c1 + c2), thus trial
solution: y * (x)=c 1 x+c 2 x2 +c3 x 3 =c 1 x+c2 x 2−(c1 +c 2 ) x3
y * (x)=c 1 x (1−x 2 )+c2 x 2 (1− x)
● As an exercise, find out c1 & c2, and the complete two-term solution.
●
If you continue to increase the order of trial polynomial, you will see
that a polynomial of order 4 will be the same as the exact solution.
●
The procedure detailed in these examples represents a systematic
procedure for developing polynomial trial functions and is also
applicable to the case of non-homogeneous boundary conditions.
●
It starts with a selection of trial function (polynomial of suitable
order) then the residual is determined and finally the integral
equations involving the residual and weighting functions are solved.
●
Algebraically, the process is straightforward but becomes quite
tedious as the number of trial functions is increased (i.e., the order of
the polynomial).
●
Having outlined the general technique of Galerkin’s method of
weighted residuals, we will now develop Galerkin’s finite element
method based on MWR.
●
In the method described previously, we used trial functions applied
globally, i.e., a single function over the entire domain while satisfying
boundary conditions.
●
For 1D problems (as we did so far) this task was feasible enough,
however, for 2D and 3D cases, discovering appropriate functions is
quite formidable to say the least.
●
However, Galerkin’s method can be applied to finite elements through
the procedure described now.
●
Consider an ODE d 2 y
2
+ f ( x)=0 a≤x≤b
dx
●
and its BCs: y (a)= y a ,
y (b)= y b
● First, divide the domain into M ‘elements’ bounded by M+1 values xi
of the independent variable, so that x1 = xa , xM = xb .
●
This ensures inclusion of global boundaries.
M +1
*
y (x)= ∑ y i n i ( x)
●
Assume a trial solution of the form: i=1
● yi , replace ci of MWR, are values of solution at xi
● ni (x) are the corresponding trial functions, with a major difference:
ni (x) is nonzero only in the interval xi−1 < x < xi+1, which is within the
element only; importantly outside the element i, xi = 0
03/01/21 | 08:48 ME-424 Finite Element Analysis 20/38
Galerkin’s FEM – The Interpolation Functions
●
Substitute this trial function in the original ODE to get the residual:
M +1 2 * 2 M +1
d y ( x)
●
R(x ; y i )= ∑
i=1
[ dx
2
+f ( x) = ∑
Apply Galerkin’s method to write the integral equations:
d
i=1 dx
] [
y n ( x) }+ f (x)
2{ i i ]
xb xb M +1 2
d
∫ n j (x) R( x ; yi )dx=∫ n j ( x) ∑
xa xa i=1
[ dx
2{ i i ]
y n ( x) } + f ( x) dx=0 , j=1 to M +1
● Since, in any interval only two ni(x) are non-zero we can simplify as:
xi 2
d
[ ]
∫ n j (x) dx 2 { y j n j ( x)+ y j+1 n j+1 ( x) }+ f (x) dx=0 , j=1 to M +1
xJ
●
These are M+1 equations, which can be collectively written in matrix
form as: [K]{y} = {F}
●
This is the formal statement of Galerkin’s Finite Element Method.
Next we proceed to apply this to derive [K] for specific elements.
●
If we know the exact solution of the ODE y’’(x) + f(x) = 0 in the
domain a to b, then that solution is valid in any sub-domain, i.e.,
2 *
d y (x)
2
+ f (x)=0 , x j ≤x≤ x j+1
dx
● Where, xj and xj+1 define the nodes of the element.
●
Appropriate boundary conditions for this sub-domain are:
y ( x j )= y j y (x j+1 )= y j+1
– Of course, these are unknown values of the solution at then end-points of
the sub-domain.
●
We propose an approximate solution of the form:
(e)
y ( x)= y j N 1 (x)+ y j+1 N 2 ( x)
●
Superscript (e) indicates that this solution is for the finite element only.
●
For this solution, the interpolation functions are:
x j+1−x
N 1 (x)= x j≤ x≤x j+ 1
x j+1 −x j
x−x j
N 2 (x)= x j ≤x≤x j+ 1
x j+1 −x j
●
Be very clear that these correspond to the overlapping portions of the
trial functions ni(x), defined earlier, within a single interval.
●
Also, these interpolation functions satisfy the end conditions:
N 1 (x j )=1 N 1 ( x j+1 )=0
N 2 (x j )=0 N 1 ( x j+1 )=1
●
Now, residual within the element (e) is:
2 (e) 2
d y d
R(x ;[ y j , y j+ 1 ])= 2
+ f (x)= y N 1 (x)+ y j+1 N 2 ( x) ] +f ( x)≠0
2[ j
dx dx
●
Writing the integral equations:
x j+1 x 2 (e)
j+1 x j+1
(e) d y
∫ N i (x) R dx= ∫ N i ( x) dx 2 dx + ∫ N i (x)f ( x)dx=0 i=1 , 2
x j x j x j
●
Next comes your test of Calculus-I, i.e., perform integration by parts
on the first integral in the above expression.
(e) x x x
dy dN i dy
j +1(e) j+1 j+1
N i ( x)
dx x
−∫|
x dx dx
j
dx + ∫ N i (x )f ( x)dx=0
j x j
● Evaluate the first term knowing the values of Ni(x) at the nodes and
rearrange the terms:
x j+1 x j +1
dN 1 dy (e)
dy (e)
∫
xj dx dx
dx= ∫ N 1 ( x) f ( x)dx +
x j
dx |
xj
x j+1 x j+1
dN 2 dy(e)
dy
(e)
∫
xj dx dx
dx= ∫ N 2 ( x) f (x)dx−
x j
dx |
x j+1
∫
xj dx dx
dx= ∫ N 1 ( x) f ( x )dx +
x j
dx |
xj
,∫
xj dx dx
dx= ∫ N 2 ( x ) f ( x) dx−
x j
dx |
x j +1
●
Integration by parts helped in:
●
Reduction of highest order of integration by one,
●
The expressions are symmetric in i and j; this will make our stiffness
matrix symmetric as well.
●
Introduction of gradient boundary conditions; something we will see
when applying these to real physical cases.
●
To simplify our notations, set j = 1, and using our definition of trial
solution into the above equations yields:
x x
dN 12
dN 1 dN 2 2
dy(e)
x 1
[ ]
∫ dx y 1 dx + y 2 dx dx=∫ N 1 (x)f ( x)dx + dx x
x 1
| 1
x2 x2
dN 2 dN 1 dN 2 dy
(e)
x 1
[ x
]
∫ dx y1 dx + y 2 dx dx=∫ N 2 ( x) f ( x)dx− dx
1
|x2
x1
[ ]
∫ dx y 1 dx + y 2 dx dx=∫ N 1 ( x) f (x)dx+ dx ,...
x 1
x
| 1
●
These two equations can now be written in matrix form as:
x
k 11 k 12 y 1 F1 dN i dN j 2
[
k 21 k 22 y 2
=
]{ } { }
F2
, where k ij =∫
x dx dx
dx i=1 , 2
1
●
If the described Galerkin procedure for element formulation is
followed and the system equations are assembled in the usual manner
of the direct stiffness method, the resulting system equations are
identical in every respect to those obtained earlier.
●
It is important to observe that, during the assembly process, when two
elements are joined at a common node the assembled system equation
for the node contains a term on the right-hand side of the form
(3) (4)
dy dy
−
dx | x4
+
dx |
x4
●
If and only if the FE solution is exact, the first derivative of the
solution at the common node from both elements should be equal and
this term must vanish. However, due to approximate nature, this term
is never exactly zero.
●
However, during assembly it is assumed that the derivatives are equal
and cancel out at the common node.
●
This actually provides a powerful technique to check the accuracy of
the FE solution just by looking at the magnitude of the discontinuity at
the element boundaries.
●
We will discuss this thoroughly later on.
03/01/21 | 08:48 ME-424 Finite Element Analysis 28/38
Galerkin’s FEM
Applied to formulate
The Bar Element
●
First we write the governing differential equation:
2
d σx d d u(x)
= ( E ε )=E =0
dx dx 2
dx
●
Recalling the linear interpolation functions from previous chapter:
u( x)=u 1 N 1 ( x)+u 2 N 2 (x)
x x
( ) ()
u( x)=u 1 1− +u2
L L
●
The domain of interest is the volume of the bar element LA and
dV = A dx , thus our residual equation becomes:
2 L
d u d2 u
( ) (
∭ N i ( x) E dx 2 dV =∫ N i E dx 2 A dx=0
V 0
) i=1 ,2
●
As before, integrate by parts and rearrange:
L L
dN i du du
AE ∫
0 dx dx
dx= AE N i
dx 0 |
03/01/21 | 08:48 ME-424 Finite Element Analysis 30/38
Bar Element – Reformulated by Galerkin’s FEM
dN 2 d du
AE ∫
0 dx dx
(u1 N 1 +u 2 N 2 )dx=− AE
dx x=L |
=− AE ε|x= L=− A σ|x=L
●
RHS of these imply that for bar elements, the gradient boundary
conditions are simply the applied nodal forces, since F = σA.
●
●
Writing these two equations in matrix form:
dN 1 dN 1 dN 2 dN 1
●
AE ∫
L
0
[ dx dx
dN 1 dN 2
dx dx
dx
dN 2
dx
dN 2
dx
]
dx dx u1 = F 1
u2 {}{ }
F2
Carry out the calculus and get to the same result as in direct method:
AE 1 −1 u 1 F1
[
L −1 1 u 2
=
F2 ]{ } { }
●
This proves the equivalence of Galerkin’s method with the direct
method, minimum potential energy method, etc.
●
Then why this long abstract method …
●
This method is abstract and provides solid mathematical basis for all
finite element formulations in not only solid mechanics but heat transfer
and fluid flow as well.
●
As before, first we write the governing differential equation;
force equilibrium: dV
=−q( x)
moment equilibrium: dx
2
dM d M
=−V ⇒ =q (x)
dV dx 2
2
●
Flexure formula from mechanics of materials: M ( x)=EI z d v2
dx
●
Combining these we get the ODE:
2 2
d d v
dx
2
EI
(z
dx
2
=q(x)
)
●
Trial solution need four terms, thus:
4
v ( x)=N 1 ( x)v 1 + N 2 ( x) θ1 + N 3 (x )v 2 + N 4 ( x) θ2=∑ N i (x) δ i
i=1
●
Knowing the ODE and the trial solution, we now proceed to apply
Galerkin’s method as follows:
03/01/21 | 08:48 ME-424 Finite Element Analysis 33/38
Beam Element – Reformulated by Galerkin’s FEM
●
Element residual equations:
x2 2 2
●
[d d v
(
∫ N i ( x) dx2 EI z dx 2 −q( x) dx=0
x1
) ]
Integrate by parts the derivative term and assuming constant EIz :
i=1 , 2, 3 , 4
3 x2 x2 x2
d v dN i d 3 v
dx x |
N i ( x) EI z 3 −EI z∫
x dx dx
1
3
dx−∫ N i (x)q( x)=0
x
1 1
●
The 3rd order derivative of deflection relates to shear force, since
dM d d2 y d3 v
V =−
dx
=−
dx
EI z 2 =−EI z 3
dx (
dx )
●
Now integrate by parts the 3rd order derivative term and rearrange:
x2 2 x2 x2 x2
d N i d2 v d3 v dN i d2 v
EI z∫
x
2
dx dx
1
2
dx=∫ N i (x )q (x)− N i (x) EI z 3 +
x 1
dx x dx
EI z 2
dx x | 1
| 1
●
Clearly, the last term is about moment conditions at the nodes.
●
This last equation can be translated in the matrix form [k]{δ}={f}
03/01/21 | 08:48 ME-424 Finite Element Analysis 34/38
Beam Element – Reformulated by Galerkin’s FEM
x2 2 x2 x2 x2
d N i d2 v d3 v dN i d2 v
EI z∫
x
2
dx dx
1
2
dx=∫ N i (x )q (x)− N i (x) EI z 3 +
x 1
dx x dx
EI z 2
dx | 1
|
x1
●
Stiffness matrix terms are defined as:
x2
d2 N i d2 N j
k ij =EI z∫ 2 2
dx
x1 dx dx
●
Element force vector is defined as:
x2 3 x2 x2
d v dN i d2 v
F i =∫ N i (x)q (x)dx− N i (x) EI z 3 +
x dx x dx
EI z 2
dx | qL
−V 1
|
x1
{ }
1 1
x 2
dN i
x 2 2
x 1
x
F i =∫ N i (x)q (x)dx− N i V ( x)|x +
dx
M ( x)
2
1
x
qL
12
|
2
−M1 1
●
The integral term represents equivalent nodal forces and { F }=
qL
moments produced by distributed loading q(x). +V 2
2
●
For UDL q(x) = q, force vector becomes: qL
2
− +M2
12
03/01/21 | 08:48 ME-424 Finite Element Analysis 35/38
Beam Element – Reformulated by Galerkin’s FEM
●
Where two beam elements share a common node, one of two
possibilities occurs regarding the shear and moment conditions:
●
If no external force or moment is applied at the node, the shear and
moment values for the adjacent elements are equal and opposite,
canceling in the assembly step.
●
If a concentrated force is applied at the node, the sum of the boundary
shear forces for the adjacent elements must equal the applied force.
●
Similarly, if a concentrated moment is applied, the sum of the
boundary bending moments must equal the applied moment.
●
Finite element software, like ANSYS, allow the user to specify a
“pressure” on the transverse face of the beam. The specified pressure
actually represents a distributed load and is converted to the nodal
equivalent loads in the software.
●
The method of weighted residuals, especially the Galerkin’s finite
element method, is a powerful mathematical tool that provides a
technique for formulating a finite element solution approach to
practically any problem for which the governing differential equation
and boundary conditions can be written.
●
For situations in which a principle such as the first theorem of
Castigliano or the principle of minimum potential energy is
applicable, Galerkin method produces exactly the same formulation.
●
In subsequent chapters, the Galerkin method is extended to two- and
three-dimensional cases of solid mechanics.
●
We will skip applications in heat transfer, and fluid flow.
●
Prior to examining specific applications, we examine, in the next
chapter, the general requirements of interpolation functions for the
formulation of a finite element approach to any type of problem.
ME-516
ME-516 ME-424
ME-424 Finite
Finite Element
ElementAnalysis
Analysis 1/3/21
1/3/21