Chapter 2
Chapter 2
FOR 1D PROBLEMS
1
INTRODUCTION
• Direct stiffness method is limited for simple 1D problems
• FEM can be applied to many engineering problems that are
governed by a differential equation
• Need systematic approaches to generate FE equations
– Weighted residual method
– Energy method
• Ordinary differential equation (second-order or fourth-order)
can be solved using the weighted residual method, in
particular using Galerkin method
• Principle of minimum potential energy can be used to derive
finite element equations
2
2.1 EXACT VS. APPROXIMATE
SOLUTION
3
EXACT VS. APPROXIMATE SOLUTION
• Exact solution
– Boundary value problem: differential equation + boundary conditions
– Displacements in a uniaxial bar subject to a distributed force p(x)
d2u
2
+ p( x ) = 0, 0 £ x £ 1
dx
u(0) = 0 üï
ïï
du ý Boundary conditions
(1) = 1ïï
dx ïþ
– Essential BC: The solution value at a point is prescribed (displacement
or kinematic BC)
– Natural BC: The derivative is given at a point (stress BC)
– Exact solution u(x): twice differential function
– In general, it is difficult to find the exact solution when the domain
and/or boundary conditions are complicated
– Sometimes the solution may not exists even if the problem is well
defined
4
EXACT VS. APPROXIMATE SOLUTION cont.
• Approximate solution u(x)
– It satisfies the essential BC, but not natural BC
– The approximate solution may not satisfy the DE exactly
– Residual: d2u
2
+ p( x ) = R ( x )
dx
– Want to minimize the residual by multiplying with a weight W and
integrate over the domain
1
ò0 R( x )W ( x )dx = 0 Weight function
– If it satisfies for any W(x), then R(x) will approaches zero, and the
approximate solution will approach the exact solution
– Depending on the choice of W(x): least square error method,
collocation method, Petrov-Galerkin method, and Galerkin method
5
1.4
1.2
1
u(x)
0.8
0.6
0.4
Exact solution
0.2 Approx. solution with W = 1
Approx. solution with W = x
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x
6
0.4 0.3
0.2 0.2
R(x)W(x)
R(x)W(x)
0 0.1
-0.2 0
-0.4 -0.1
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
(a) W = 1 (b) W = x
7
2.2 GALERKIN METHOD
8
GALERKIN METHOD
• Approximate solution is a linear combination of trial functions
N
u( x ) = å ci fi ( x ) Trial function
i =1
– Accuracy depends on the choice of trial functions
– The approximate solution must satisfy the essential BC
• Galerkin method
– Use N trial functions for weight functions
1
ò0 R( x )fi ( x )dx = 0, i = 1,, N
1æ d2u
ö÷
ò0 ççèç dx 2 + p( x ) ÷÷øfi ( x )dx = 0, i = 1,,N
1 d 2u
1
ò0 dx 2 fi ( x )dx = -ò0 p( x )fi ( x )dx, i = 1,, N
9
GALERKIN METHOD cont.
• Galerkin method cont.
– Integration-by-parts: reduce the order of differentiation in u(x)
1
du dfi
1 du 1
fi -ò dx = -ò p( x )fi ( x )dx, i = 1,,N
dx 0 0 dx dx 0
1 df du 1 du du
ò0 dx = ò0 p( x )fi ( x )dx + (1)fi (1) - (0)fi (0), i = 1,, N
i
dx dx dx dx
– Same order of differentiation for both trial function and approx. solution
– Substitute the approximate solution
1 df
N
df j 1 du du
ò0
i
å cj
dx j =1 dx
dx = ò0 p( x )fi ( x )dx +
dx
(1)fi (1) -
dx
(0)fi (0), i = 1,, N
10
GALERKIN METHOD cont.
• Galerkin method cont.
– Write in matrix form
N
1 d fi d f j
K ij = ò0 dx dx
dx
1 du du
Fi = ò0 p( x )fi ( x )dx +
dx
(1)fi (1) -
dx
(0)fi (0)
11
EXAMPLE1
• Differential equation Trial functions
d 2u f1( x ) = x f1¢( x ) = 1
2
+ 1 = 0,0 £ x £ 1
dx f2 ( x ) = x 2 f2¢ ( x ) = 2 x
u(0) = 0 üï
ï
ï
du ý Boundary conditions
(1) = 1ï
ï
dx ï
þ
• Approximate solution (satisfies the essential BC)
2
u( x ) = å ci fi ( x ) = c1x + c2 x 2
i =1
• Approximate solution
x2
u( x ) = 2 x -
2
– Approximate solution is also the exact solution because the linear
combination of the trial functions can represent the exact solution
13
EXAMPLE2
• Differential equation Trial functions
d 2u f1( x ) = x f1¢( x ) = 1
2
+ x = 0, 0 £ x £1
dx f2 ( x ) = x 2 f2¢ ( x ) = 2 x
u(0) = 0 üï
ïï
du ý Boundary conditions
(1) = 1ïï
dx ïþ
1 ìï16 üï
• Coefficient matrix is same, force vector: {F} = í ý
12 ïîï15 ïþï
ì
ï 19 ü
12 ï 19 x2
{c } = [K ] {F } = í 1 ïý
-1 ï u( x ) = x-
ï
ï - 4 ïþï
î 12 4
• Exact solution
3 x3
u( x ) = x -
2 6
14
EXAMPLE2 cont.
• Approximation is good for u(x), but not good for du/dx
1.6
1.4
1.2
1.0
u(x), du/dx
0.8
0.6
0.4
0.2
0.0
0 0.2 0.4 x 0.6 0.8 1
15
2.3 HIGHER-ORDER
EQUATIONS
16
HIGHER-ORDER DIFFERENTIAL EQUATIONS
w (0) = 0 üï
• Fourth-order differential equation ïï
ý Essential BC
dw
(0) = 0 ïï
d 4w dx ïþ
- p( x ) = 0, 0£x£L
dx 4 d 2w üï
( L ) = M ïï
– Beam bending under pressure load dx 2 ïï
ý Natural BC
3
d w ïï
• Approximate solution 3
(L ) = -V ïï
dx ïþ
N
w ( x ) = å ci fi ( x )
i =1
17
HIGHER-ORDER DE cont.
• After integration-by-parts twice
3 L 2 L
d w d w d fi L d 2w
d 2fi L
f
3 i
- 2 +ò 2 2
dx = ò0 p( x )fi ( x )dx, i = 1,, N
dx 0 dx dx 0
0 dx dx
L L
L d 2w
d fi 2 L d w 3 2
d w d fi
ò0 2
dx dx 2
dx = ò0 p( x )fi ( x )dx - 3 fi
dx
+
dx 2 dx
, i = 1,, N
0 0
f1 = x 2, f2 = x 3 f1¢¢ = 2, f2¢¢ = 6x
• Coefficient matrix
1 2
K11 = ò0 ( f1¢¢) dx = 4
1 é4 6 ù
K12 = K 21 = ò0 ( f1¢¢f2¢¢ ) dx = 6 [K ] = ê ú
êë 6 12 úû
1 2
K 22 = ò0 ( f2¢¢ ) dx = 12
19
EXAMPLE cont.
• RHS
1 d3w (0) d2w (0) 16
F1 = ò0 2
x dx + V f1(1) +
dx 3
f1(0) + M f1¢(1) -
dx 2
f1¢(0) =
3
1 d3w (0) d2w (0) 29
F2 = ò0 3
x dx + V f2 (1) +
dx 3
f2 (0) + M f2¢ (1) -
dx 2
f2¢ (0) =
4
• Approximate solution
ì
ï 41 ü
ï 41 2 1 3
{c} = [K]-1 {F} = ïí 241 ï ý w ( x ) = x - x
ïîï - 4 ï
ï
þ 24 4
• Exact solution
1 4 1 3 7 2
w(x) = x - x + x
24 3 4
20
EXAMPLE cont.
1
w'', w''
-1
-2
-3
0 0.2 0.4 x 0.6 0.8 1
w'' (exact) w'' (approx.) w''' (exact) w''' (approx.)
21
2.4 FINITE ELEMENT
APPROXIMATION
22
FINITE ELEMENT APPROXIMATION
• Domain Discretization
– Weighted residual method is still difficult to obtain the trial functions
that satisfy the essential BC
– FEM is to divide the entire domain into a set of simple sub-domains
(finite element) and share nodes with adjacent elements
F
F
Structure
ìï ¶s
Element
ïï xx + ¶txy + b = 0
ïï ¶x
x
¶y
í
ïï ¶txy ¶syy
ïï + + by = 0
ïî ¶x ¶y
23
FINITE ELEMENT APPROXIMATION
• Domain Discretization
– Within a finite element, the solution is approximated in a simple
polynomial form
u(x) Nodes
Approximate
solution
x
Finite Exact
elements solution
– When more number of finite elements are used, the approximated
piecewise linear solution may converge to the analytical solution
u
Exact solution
Two elements
Four elements
Eight elements
x
24
FINITE ELEMENT METHOD cont.
• Types of finite elements
1D 2D 3D
One element
25
Galerkin vs. Finite Element Method
26
TRIAL SOLUTION
– Solution within an element is approximated using simple polynomials.
u( x ) = a0 + a1x, xi £ x £ xi +1
ì
ï
ï u( xi ) = ui = a0 + a1xi
í
ï
î u( xi +1) = ui +1 = a0 + a1xi +1
ï
– Express a0 and a1 in terms of ui and ui+1. Then, the solution is
approximated by
xi +1 - x x - xi
u( x ) = (i )
ui + ( i ) ui +1
L
L
Ni ( x ) Ni +1( x )
28
TRIAL SOLUTION cont.
• Observations
– Solution u(x) is interpolated using its nodal values ui and ui+1.
– Ni(x) = 1 at node xi, and =0 at node xi+1.
Ni(x) Ni+1(x)
xi xi+1
– The solution is approximated by piecewise linear polynomial and its
gradient is constant within an element.
u ui+2 du
ui dx
ui+1
29
GALERKIN METHOD
• Relation between interpolation functions and trial functions
– 1D problem with linear interpolation
ì
ï 0, 0 £ x £ xi -1
ï
ï
ï
ï ( i -1) x - xi -1
ï N ( x ) = , xi -1 < x £ xi
ND ï i ( i -1)
fi ( x ) = ï
L
u( x ) = å ui fi ( x ) í
ï xi +1 - x
ï
ï
(i )
Ni ( x ) = , xi < x £ xi +1
i =1 ï (i )
ï L
ï
ï
î 0,
ï xi +1 < x £ xND
– Difference: the interpolation function does not exist in the entire
domain, but it exists only in elements connected to the node
• Derivative
ì
ï 0, 0 £ x £ xi -1 1
ï
ï
ï 1 fi (x )
ï 1/ L( i -1 )
ï , xi -1 < x £ xi
d fi ( x ) ï ( i - 1)
=ï
L
í x i -2 x i -1 xi x i +1
dx ï
ï 1
ï - , xi < x £ xi +1 -1/ L( i )
ï
ï L ( i ) d fi (x )
ï
ï dx
î 0,
ï xi +1 < x £ xND
30
EXAMPLE
• Solve using two equal-length elements
2 u(0) = 0 üï
du ïï
+ 1 = 0, 0 £ x £ 1 du ý Boundary conditions
dx 2
(1) = 1ïï
dx ïþ
0
0 0.5 1
x
31
EXAMPLE cont.
• Derivatives of interpolation functions
df1( x ) ìï -2, 0 £ x £ 0.5 df2 ( x ) ìï 2, 0 £ x £ 0.5
=í =í
dx ï
î 0, 0.5 < x £ 1
ï dx ïïî -2, 0.5 < x £ 1
df3 ( x ) ìï 0, 0 £ x £ 0.5
=í
dx ïïî 2, 0.5 < x £ 1
• Coefficient matrix
df1 df2
1 0.5 1
K12 = ò dx = ò (-2)(2)dx + ò (0)(-2)dx = -2
0 dx dx 0 0.5
1 d f df 0.5 1
K 22 = ò 2 2
dx = ò 4dx + ò 4dx = 4
0 dx dx 0 0.5
• RHS
0.5 1 du du du
F1 = ò 1´ (1 - 2 x )dx + ò 1´ (0)dx + (1)f1(1) - (0)f1(0) = 0.25 - (0)
0 0.5 dx dx dx
0.5 1 du du
F2 = ò0 2 xd x + ò
0.5
(2 - 2 x )dx +
dx
(1)f2 (1) -
dx
(0)f2 (0) = 0.5
32
EXAMPLE cont.
• Matrix equation
é 2 -2 0 ù ïì u1 ïü ïì F1 ïü Consider it as unknown
ê úï ï ï ï
ê -2 4 -2 ú í u2 ý = í 0.5 ï
ï ï ï
ý
ê úï ï ï ï
êë 0 -2 2 úû ïî u3 ïþ ïî1.25 ï
ï ï ï ïþ
• Striking the 1st row and striking the 1st column (BC)
é 4 -2 ù ìï u2 üï ìï 0.5 üï
ê úí ý = í ý
êë -2 2 ûú îïï u3 ïþï îïï1.25 þïï
• Solve for u2 = 0.875, u3 = 1.5
• Approximate solution
ìï1.75 x, 0 £ x £ 0.5
u( x ) = í
ïïî 0.25 + 1.25 x, 0.5 £ x £ 1
33
EXAMPLE cont.
• Solution comparison 1.6
u(x)
0.8
• Derivative shows a large
discrepancy 0.4
u-exact
u-approx.
• Approx. derivative is 0
constant as the solution is 0 0.2 0.4 x 0.6 0.8 1
piecewise linear 2
du/dx 1.5
du/dx (exact)
0.5
du/dx (approx.)
0
0 0.2 0.4 x 0.6 0.8 1
34
2.5 FORMAL PROCEDURE
35
FORMAL PROCEDURE
• Galerkin method is still not general enough for computer code
• Apply Galerkin method to one element (e) at a time
• Introduce a local coordinate
x - xi x - xi
x = xi (1 - x ) + x j x x= = (e )
x j - xi L
37
FORMAL PROCEDURE cont.
• Change variable from x to
1 1 d Ni ê dN1 dN 2 ú ì
ï u1 ü
ï 1
L( e ) ò0 dx
ê ú dx í ý = L ò p( x )Ni (x )dx
(e )
êë dx dx úû ï
ï u2 ï
î ï
þ 0
du du
+ ( x j )Ni (1) - ( xi )Ni (0), i = 1,2
dx dx
– Do not use approximate solution for boundary terms
• Element-level matrix equation
ìï du üï
ïï - ( xi ) ïï 1 ìï N1(x ) üï
[k( e ) ]{q( e ) } = { f ( e ) } + ïí
ïï du
dx ïý
ïï
{f (e ) (e )
}=L ò0 p( x )í ý dx
ïîï N2 (x ) ïþï
ïï + ( x j ) ïï
î dx þ
é æ dN ö2 dN1 dN2 ùú
ê ç 1 ÷÷
1 ç dx ÷ø
1ê è dx dx ú é 1 -1ù
é k(e ) ù = ê ú dx = 1 ê
ë û L( e ) ò0 ê 2 ú L ë -1 1 úû
(e ) ê
ú
2´2 ê dN2 dN1 æ dN2 ö÷ ú
çç
ê
ë dx dx è dx ø÷÷ ûú
38
FORMAL PROCEDURE cont.
• Need to derive the element-level equation for all elements
• Consider Elements 1 and 2 (connected at Node 2)
ì
ï du ü
ï
é k11 ù(1)
ì ü ì ü (1)ï
ï - ( x 1 ) ï
ï
k12 ï 1 ï ï 1 ï
u f ï d x ï
ê ú í ý = í ý +í ý
êë k21 ú
k22 û î ï
ï 2þ
u ï
ï îï
ï 2þ
f ï
ï ï d u ïï
ï
ï + ( x2 ) ï
ï
î dx ï
þ
ì
ï du ü
ï
é k11 (2) (2) ï - ( x ) ï
k12 ù ì ü ì ü ï 2 ï
ú íï 2 ýï = íï 2 ýï + íï dx
u f ï
ê ý
êë k21 k22 úû ï ï u3 ï
î ï ï
þ ï f3 ï
î ï
þ ïï du ïï
ï + (x )
ï dx 3 ï
î ï
þ
• Assembly
Vanished
ì
ï du üï
é k (1) (1)
k12 0 úìù ü ïì f (1) ü
ï ï
ï - ( x1 ï
) ï unknown term
ê 11 ï u1ï ï
ï ïï ïï (1)
1 ï
ï ïïï d x ï
ê k (1) (1) (2) (2) ú ï (2) ï ïï
ê 21 k22 + k11 k12 ú í u2 ý = í f2 + f2 ý + í 0 ý
ê ï ï ï ï ï ïï
(2) ú ï ï ï ï ï
ïï ïï du
ê 0
ë
(2)
k21 k22 úû ï
î u3 ï
þ ïïî f3
(2)
þ ï ( x3 ) ïï
ï
ï dx
î þï
39
FORMAL PROCEDURE cont.
• Assembly of NE elements (ND = NE + 1)
é (1) ù ì
ï du ü
ï
ê k11 (1)
k12 0 ú
0 ìï u üï ï ì f (1) ü
ï ï
ï - ( x1 ) ï
ï
ê úï 1 ï ï ï
1 ï
ï ï d x ï
ê (1) (1) (2) (2) ú ï ï ï (1) (2) ï ïï ï
ï
ê k21 k22 + k11 k12 0 ú ïï u2 ïï ï ï f2 + f2 ï ïï 0 ï
ê ï ï ï
ú ï ï = ï (2) ï ï ïï
(2) (2) (2) (3) ï+ ï 0
ê 0 k221 k22 + k11 0 ú í u3 ý í f3 + f3 ý í ý
ê ï
úï ï ï ï ï ï
ï ï
ï ï
ï
ê ú ïï ïï ï ï ï
ï ï
ï ï
ï
ê ú ïï ïï ï ï ï
ï ï
ï ï
ï
ê 0 ( NE ) ( NE ) ú ï u ï
k22 ú î N þ ï ( NE )
ï d u
êë 0 0 k21
( ND´1) ï N
î f ï ï + ( xN ) ïï
þ ï
û ( ND´1) ï dx
î ï
þ
( ND´ND ) ( ND´1)
[K s ]{Q s } = {Fs }
40
EXAMPLE
• Use three equal-length elements
d2u
2
+ x = 0, 0 £ x £1 u(0) = 0, u(1) = 0
dx
42
EXAMPLE cont.
• Approximate solution
ìï 4 1
ïïï 27 x, 0£x£
3 0.08
ïï u-approx.
u-exact
ïï 4 1æ 1 ö÷ 1 2
u( x ) = í + ç x - ÷÷, ç £x£
0.06
ïï 81 27 è 3ø 3 3
u(x)
ïï 0.04
ïï 5 - 5 æç x - 2 ÷ö, 2
£ x £1
ïïî 81 27 çè 3 ÷÷ø
0.02
3
0
1
u( x ) = x (1 - x 2 )
6
– Three element solutions are poor
– Need more elements
43
2.6 ENERGY METHODS
44
Virtual Displacement
• Virtual displacement is not experienced but only assumed to
exist so that various possible equilibrium positions may be
compared to determine the correct one
• Mass m and springs are in equilibrium at the current position
• Then, a small arbitrary perturbation, r, can be assumed
– Since r is so small, the member forces are assumed unchanged
• The work done by virtual displacement is
dW = F1 ⋅ dr + F2 ⋅ dr + F3 ⋅ dr + F4 ⋅ dr = (F1 + F2 + F3 + F4 ) ⋅ dr
• If the current position is in force equilibrium, W = 0
F2 F3
r
F1 F4
45
Principle of Virtual Work
• Powerful alternative method to obtain FE equations
• Principle of virtual work for a particle
– for a particle in equilibrium the virtual work is identically equal to zero
– Virtual work: work done by the (real) external forces through the virtual
displacements
– Virtual displacement: small arbitrary (imaginary, not real) displacement
that is consistent with the kinematic constraints of the particle
• Force equilibrium
å Fx = 0, å Fy = 0, å Fz = 0
• Virtual displacements: u, v, and w
• Virtual work
dW = du å Fx + dv å Fy + dw å Fz = 0
• If the virtual work is zero for arbitrary virtual displacements,
then the particle is in equilibrium under the applied forces
46
PVW of 1DOF System
• Static equilibrium of a mass-sprint system
– At equilibrium, the spring force, F, is equal to applied load, mg
F (D) - mg = 0
– If the position is perturbed by *
F (D) ⋅ D* = mg ⋅ D*
– External work done by the external forces mg during the application of
a small virtual displacement is equal to the internal work done by the
spring force during the application of that small virtual displacement
47
PRINCIPLE OF VIRTUAL WORK
• Deformable body (uniaxial bar under body force and tip force)
x
E, A(x)
F
Bx
L
ds
• Equilibrium equation: x
+ Bx = 0 This is force equilibrium
dx
• PVW L
æ ds x ö÷
ò ò çè dx + Bx ÷÷ø du( x )dAdx = 0
ç
0 A
dWe -dWi
dWe + dWi = 0
49
PVW cont.
• in equilibrium, the sum of external and internal virtual work is
zero for every virtual displacement field
• 3D PVW has the same form with different expressions
• With distributed forces and concentrated forces
dWe = ò ( t x du + t y dv + tzdw ) dS + åi ( Fxi dui + Fyi dv i + Fzi dw i )
S
50
Variation of a Function
• Virtual displacements in the previous section can be
considered as a variation of real displacements
• Perturbation of displ u(x) by arbitrary virtual displ u(x)
ut ( x ) = u ( x ) + tdu ( x )
• Variation of displacement
dut ( x )
= du( x ) Displacement variation
dt t =0
ut ( x ) = u ( x ) + tdu ( x )
52
PRINCIPLE OF MINIMUM POTENTIAL ENERGY
• Strain energy density of 1D body
1 1
U0 = s x ex = E ex2
2 2
dU = -dWi
53
PMPE cont.
• Potential energy of external forces
– Force F is applied at x = L with corresponding virtual displ u(L)
– Work done by the force = Fu(L)
– The potential is reduced by the amount of work
dV = -F du (L ) F is constant
dV = -d ( Fu (L ) )
virtual displacement
– With distributed forces and concentrated force
L
V = -Fu(L ) - ò bx u( x )dx dV = -dWe
0
• PVW dU + dV = 0 or d ( U + V ) = 0
dP = 0
54
PMPE cont.
• Principle of minimum potential energy
Of all displacement configurations of a solid consistent with its
displacement (kinematic) constraints, the actual one that satisfies
the equilibrium equations is given by the minimum value of total
potential energy
1 é k (3) -k (3) ù ìï u2 üï
U (3) = êë u2 u3 úû ê (3) úí ý
2 êë -k k (3) úû ïîï u3 ïþï
56
EXAMPLE cont.
3
• Strain energy of the system U = åU (e)
e=1
1
U = {Q } T [K ]{Q }
2 {Q} = {u1, u2, u3 }T
59
RAYLEIGH-RITZ METHOD cont.
• Assumed displacement (must satisfy the essential BC)
u ( x ) = c1f1( x ) + + cn fn ( x )
• Determine the strain energy: U
• Find the potential of external forces: V
• Total potential energy in terms of unknown coefficients
P(c1, c2 ,...cn ) = U + V
• PMPE to determine coefficients
¶P
= 0, i = 1, n
¶c i
du
P ( x ) = AE (for 1D bar)
dx
60
EXAMPLE
bx
F
1 L 2 1 æ 4 ö
U ( c1, c2 ) = AE ò ( c1 + 2c2 x ) dx = AE çç Lc12 + 2L2c1c2 + L3c22 ÷÷÷
2 0 2 è 3 ø
• Potential energy of forces
L L
V ( c1, c2 ) = -ò bx ( x )u( x )dx - (-F )u(L ) = -ò bx ( c1x + c2 x 2 ) dx + F ( c1L + c2L2 )
0 0
æ L2ö æ 2 L3ö
= c1 çç FL - bx ÷÷ + c2 çç FL - bx ÷÷÷
÷
çè 2ø èç 3ø
61
EXAMPLE cont.
• PMPE P ( c1, c2 ) = U + V
¶P 2 L2
= AELc1 + AEL c2 + FL - bx =0
¶c1 2
¶P 2 4 3 2 L3
= AEL c1 + AEL c2 + FL - bx =0
¶c 2 3 3
62