You are on page 1of 16

Chapter 1 Quiz 1

• Which specimen has largest stiffness?

S1: E,A,L S2: E,2A,L

S2: E,2A,2L

S2: E,A,2L

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Chapter 1 Quiz 2
• What is the unit of stress?

• What is the unit of strain?

• What is the unit of Young’s modulus?

• What is the unit of truss element’s


compliance?

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

1
Chapter 1 Truss Structures (cont.)
• Type of commonly used support conditions for
truss structures
Free

Pinned (free rotation)


ux=uy=0

Vertical restriction
uy=0

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Flow Chart of a FEM Program


Load relevant data file - preprocessing

Initialize variable

For each element


Calculate element stiffness terms and assemble
them in global stiffness matrix
End of element loop
Set boundary conditions

Solve the equations

Save and plot results – post processing

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

2
Chapter 2.1: Mathematical
Background for FEM

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Contents in Chapter 2
• Mathematical preliminaries

• Numerical methods via a flexible string


problem

• 1D mathematical Physics Problems

• General (abstract) FEM formulations

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

3
Today’s Agenda
• Basic matrix algebra + Green-Gauss theorem

• 1D Flexible string equation

• Various numerical methods to solve the string


problem

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Matrix Algebra
• You have learned the matrix algebra before, but
it is important to re-fresh it for this course:

– How to calculate the determinant?


– Rules for solving linear equations.
– Positive definiteness is an important concept for FEM.
– How can we partition a system equation?

• We will not go through the details, Read


Chapters 2 and 5 of Ottosen’s book

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

4
Matrix Algebra
• A scalar can be written by the inner
product of two column matrices
⎡ b1 ⎤
v = a T b = [a1 a2 a3 ]⎢⎢b2 ⎥⎥ = a1b1 + a 2 b2 + a3 b3
⎣⎢b3 ⎦⎥
⎡ a1 ⎤
v = b T a = [b1 b2 b3 ]⎢⎢a 2 ⎥⎥ = a1b1 + a 2 b2 + a3 b3
⎢⎣ a3 ⎥⎦

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Matrix Algebra
• A unknown function can be approximated
by the inner product of a column matrix of
known functions and a matrix of unknown
constants
v (x) ⎡ c1 ⎤
v( x) = a(x) c = 1 x
T
[ 2
]
x ⎢⎢c2 ⎥⎥ = c1 + xc2 + x 2c3
x
Absolute ⎢⎣c3 ⎥⎦
coordinate Known functions unknown constants
v(x) vj x ⎡ vi ⎤
Normalized vi ξ= v(ξ ) = [(1 − ξ ) ξ ]⎢ ⎥
(nature) 0 L x L ⎣v j ⎦
coordinate i j

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

5
Determinant
– 2x2 – you should master it
– 3x3 – you should be able to
– nxn
–Ax=b
• det A≠0 – condition for a unique solution
• det A=0 – no solution exists
– Ax=0
• det A≠0 – trivial solution exists
• det A=0 – non-trivial solution exists

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Positive Definiteness
• Quadratic matrix and positive definiteness

If x T Ax > 0 for all x≠0 Îpositive definite

If A is positive definite then det A≠0


det A≠0 is very important for stress analysis
If det A=0, usually a bifurcation problem
occurs!

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

6
Integration by Parts – 1D
The General " Integration by Parts" rule :
b b
dv du
∫ u dxdx = [uv] − ∫ v dx dx
b
a (what are the advantages of this rule?)
a a

The 1D Physical Problems can be generally written :


b
d 2v
∫ u dx
a
2
dx = Q

Integration of a 2nd - order differenti al equation can be converted


to the integratio n of 1st order by using the rule - Integration by Parts :
b b b
d 2v ⎡ dv ⎤ du dv
∫ u dx
a
2
dx = ⎢u ⎥ − ∫
⎣ dx ⎦ a a dx dx
dx = Q

b b
du dv ⎡ dv ⎤
∫a dx dxdx = ⎢⎣u dx ⎥⎦ a + Q

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Green-Gauss Theorem – 2D
Basics :

Gradient of a scalar function is a vector

∂u ∂u
∇u = i+ j
∂x ∂y

Divergence of a vector is a scalar function

∂Fx ∂Fy
divF = +
∂x ∂y

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

7
Green-Gauss Theorem – 2D
We begin with a 2D Vector
F = Fx i + Fy j
If you are not familiar with
the Green- Gauss theorem,
The divergence of a Vector is a scalar : please read carefully the
Chapter 5. This is important
∂F ∂Fy
divF = x + for the course!
∂x ∂y

Transforma tion between area integral and path integral


∂Fx ∂Fx
∫ dA = ∫∫ dxdy = ∫ Fx ( x, y )dy = ∫ Fx ( x, y )nx dΓ
A ∂x A ∂x Γ Γ

∂Fy ∂Fy
∫A ∂y dA = ∫∫A ∂y dxdy = −∫Γ Fy (x, y )dx = ∫Γ Fy (x, y )n y dΓ
∫ (divF )dA = ∫ F • ndΓ
A Γ
(Gauss divergence theorem)

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Green-Gauss Theorem – 2D
Multiplying the previous equation by u

∫ div (uF)dA =∫ (uF) • ndΓ


A Γ

Using the definition of gradient u (∇u )


div (uF ) = udiv (F) + ∇u • F

We obtain the Green - Gauss Theorem :

∫ udiv (F)dA = ∫ (uF) • ndΓ − ∫ ∇u • FdA


A Γ A

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

8
Green-Gauss Theorem – 2D

Green - Gauss Theorem ="2D integration by Parts"

∂Fx ∂u
∫u dA = ∫ (uFx )nx dΓ − ∫ Fx dA ← ( Fy = 0)
A ∂x Γ A ∂x

∂Fy ∂u
∫A u ∂y dA = ∫Γ (uFy )n y dΓ − ∫A ∂x Fy dA ← ( Fx = 0)

3D formulations are quite similar

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Laterally Flexible String Problem


Horizontal equlibrium :
y
-H + H + dH = 0 ⇒ dH = 0 ( H is constant! ! )

y(x) x Vertical equlibrium :


dV
-V + qdx + V + dV = 0 ⇒ = −q
T q(x) – N/m T dx

L T is tangential to the string we have


V dy dy
tan θ = = ⇒ V =H
H dx dx

T+dT We therefore obtain the string equation :


dx
V+dV d2y
H H +q =0
Ө H+dH dx 2
V H
T qdx We restrict to small deflection case (θ is small and T is large)
H = T cos θ ≈ T = constant
x d2y
T +q =0
Infinitely small part of string dx 2

Sign convention!
TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

9
Flexible String – Exact Solution
Discontinuous loading For the given string problem we can first obtain
y 3Q the exact solution
Q
x The governing equations are :

d2y
L/2 L/2 T − 3Q = 0 (0 ≤ x ≤ 0.5 L)
dx 2
d2y
T 2 − Q = 0 ( 0.5 L ≤ x ≤ L)
dx
The first derivative at the
middle of string (x=0.5L) should Boundary conditions
also be continuous, otherwise y(0) = y(L) = 0
the 2nd derivative will not be
available!

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Flexible String – Exact Solution


The general solutions forthe two segements are :
Q
y ( x) = (1.5 x 2 + C1 x + C2 ) for 0 ≤ x ≤ 0.5 L
T
Q 2
y ( x ) = ( x + C3 x + C 4 ) for 0.5 L ≤ x ≤ L
T

The 4 constants can be evaluated by the 4 conditions : y 3Q


y ( x = 0) = 0 Q
y ( x = L) = 0 x
y ( x = 0.5L −) = y ( x = 0.5 L +)
dy dy
( x = 0.5 L −) = ( x = 0.5 L +)
dx dx
L/2 L/2
The exact solution becomes
QL2 ⎛⎜ 3 ⎛ x ⎞ 5 ⎛ x ⎞ ⎞⎟
2

y ( x) = ⎜ ⎟ − ⎜ ⎟ for for 0 ≤ x ≤ 0.5 L


T ⎜⎝ 2 ⎝ L ⎠ 4 ⎝ L ⎠ ⎟⎠

QL2 ⎛⎜ 1 ⎛ x ⎞ 1 ⎛ x ⎞ 1 ⎞⎟
2

y ( x) = ⎜ ⎟ − ⎜ ⎟− for for 0.5 L ≤ x ≤ L


T ⎜⎝ 2 ⎝ L ⎠ 4 ⎝ L ⎠ 4 ⎟⎠

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

10
Flexible String – Appropriate Solutions
If we assume that the exact solution is not known we would arrive at an appropriate solution
to the governing equations.

⇒ Almost all the methods use an approximat ing function


with a finite number of degrees of freedom.
⇒ Unknown functions = known functions * unknown constants y
3Q
Q
In this string case : x
[
y ( x) = ( x)( x − L) A0 + A1 x + A2 x 2 + A3 x 3 ]
⎛ πx ⎞ ⎛ 2πx ⎞ ⎛ 3πx ⎞
y ( x) = A0 sin ⎜ ⎟ + A1 sin ⎜ ⎟ + A2 sin ⎜ ⎟
⎝L⎠ ⎝ L ⎠ ⎝ L ⎠
L/2 L/2
⇒ Both approximat ions satisfy the boundary conditions independen t
of the unknown parameter values
⇒ Important requiremen t for selecting approximat ing functions

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Flexible String – Appropriate Solutions


Approximat ion can be made to converge to any continuous function by extending the series indicated.
Such series are referred to as being complete

Special methods can be used to determine the unknown parameters once a series has been selected.

Truncated polynomial series are often preferred :

y ( x) = ( x)( x − L)( A0 + A1 x)

Note : The exact solution satisfies the differential equation everyhwere


However, there are no A0 and A1 can make the approximat e equation
satisfies everywhere.

We must determine which A0 and A1 give " best" estimate.


R is a function R(x, A0, A1).
Most of the methods use a maasure called " residual" We would select A0 and A1
such that R is as “zero” as
R = 2T A0 + T (6 x − 2 L) A1 - 3Q for 0 ≤ x ≤ 0.5 L
possible!
R = 2T A0 + T (6 x − 2 L) A1 - Q for 0.5 L ≤ x ≤ L

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

11
Flexible String – Collocation Method
If we can not make R = 0 everywhere , we have to make R = 0 at as many points as possible.

⇒ Because we have only 2 unknowns we expect at most the governing equation can
be satisfied at 2 points

⇒ We choose x = 0.25 L and x = 0.75 L as logical choices and obtain :

3Q ⎧ 4Q
2 A0 − 0.5 LA1 = ⎪ A0 = 3T QL2 ⎡ 2 ⎛ x ⎞ ⎛ x ⎞ 4 ⎛ x ⎞⎤
3 2
T ⇒ ⎨ ⇒ y= ⎢− ⎜ ⎟ + 2⎜ ⎟ − ⎜ ⎟⎥
Q 2Q T ⎣⎢ 3 ⎝ L ⎠ ⎝ L ⎠ 3 ⎝ L ⎠⎦⎥
2 A0 + 2.5 LA1 = ⎪ A1 = −
T ⎩ 3LT

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Flexible String – Least Square Method


Rather than making R = 0 at 2 points
We minimize

L
J = ∫ R(x,A0 A1 )2 dx (J ≥ 0 )
0

⎧ ∂J ∂ L 2 L ∂R
⎪ ∂A = 0 ⇒ ∂A ∫0 R dx = ∫0 2 R ∂A dx = 0
⎪ 0 0 0
⇒⎨
⎪ ∂J ∂ L 2 L ∂R

⎩ ∂A1
=0⇒
∂A1 ∫0
R dx = ∫ 2 R
0 ∂A1
dx = 0

⎧ 5Q
⎪ A0 = 4T QL2 ⎡ 1 ⎛ x ⎞ 3 7 ⎛ x ⎞ 2 5 ⎛ x ⎞⎤
⇒ ⎨ ⇒ y= ⎢− ⎜ ⎟ + ⎜ ⎟ − ⎜ ⎟⎥
Q T ⎢⎣ 2 ⎝ L ⎠ 4 ⎝ L ⎠ 4 ⎝ L ⎠⎥⎦
⎪ A1 = −
⎩ 2 LT

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

12
Flexible String –Galerkin Method
The chief method used in this couse!
Weight functions and weighted average zero
⎧ Remember what does R means here!
⎪ L W ( x) Rdx = 0
⎪ ∫0 0
⎪ L
⎨ ∫0 W1 ( x) Rdx = 0
⎪ ....
⎪ L
⎩⎪∫0 n
W ( x) Rdx = 0
The Weigh functions must be independen t in order for the resulting algebraic equations
to be independen t.

Galerkin method : use


the independent terms (known functions) in the approximating functions
as the weight functions
W0 ( x) = x 2 − Lx; W1 ( x) = x 3 − Lx 2 ;

⎧ 21Q
⎪ A0 = 16T QL2 ⎡ 5 ⎛ x ⎞3 31 ⎛ x ⎞ 2 21 ⎛ x ⎞⎤
⇒ ⎨ ⇒ y= ⎢− ⎜ ⎟ + ⎜ ⎟ − ⎜ ⎟⎥
5Q T
⎪ A1 = − ⎣⎢ 8 ⎝ L ⎠ 16 ⎝ L ⎠ 16 ⎝ L ⎠⎦⎥
⎩ 8 LT

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Flexible String – Ritz Method


For the elastic string we can write an expression for the total potential energy of the system
as a function of deflection y(x).

Mechanics : if y is exact, the total energy will be at minimum

Similar to the least square method we can select the two unknown parameters such that
the potential energy value as small as possible

The potential energy is :

L ⎡ 1 ⎛ dy ⎞ ⎤ ∂E ∂ ⎡ 1 ⎛ dy ⎞ 2 ⎤
2
L
E = ∫ ⎢ T ⎜ ⎟ − q ( x) y ⎥dx ⇒ = ∫ ⎢ T ⎜ ⎟ − q ( x) y ⎥dx = 0
0 2
⎢⎣ ⎝ dx ⎠ ⎥⎦ ∂Ai ∂Ai 0
⎢⎣ 2 ⎝ dx ⎠ ⎥⎦

⎧ 21Q
⎪ A0 = 16T QL2 ⎡ 5 ⎛ x ⎞3 31 ⎛ x ⎞ 2 21 ⎛ x ⎞⎤
⇒ ⎨ ⇒ y= ⎢− ⎜ ⎟ + ⎜ ⎟ − ⎜ ⎟⎥ (exactly the same as the Galerkin method)
5Q T ⎢⎣ 8 ⎝ L ⎠ 16 ⎝ L ⎠ 16 ⎝ L ⎠⎥⎦
⎪ A1 = −
⎩ 8 LT

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

13
Flexible String – Numerical Solutions
(two parameters A0 and A1)
Exact Solution :
QL2 ⎛⎜ 3 ⎛ x ⎞ 5 ⎛ x ⎞ ⎞⎟
2

y ( x) = ⎜ ⎟ − ⎜ ⎟ ⎟ for for 0 ≤ x ≤ 0.5L



T ⎝ 2 ⎝ L ⎠ 4 ⎝ L ⎠⎠

QL2 ⎛⎜ 3 ⎛ x ⎞ 1 ⎛ x ⎞ 1 ⎞⎟
2

y ( x) = ⎜ ⎟ − ⎜ ⎟− for for 0.5L ≤ x ≤ L


T ⎜⎝ 2 ⎝ L ⎠ 4 ⎝ L ⎠ 4 ⎟⎠

Collocation Method : Galerkin and Ritz method :


⎧ 4Q ⎧ 21Q
⎪ A0 = 3T ⎡ 2⎛ x ⎞ ⎛ x ⎞ 4 ⎛ x ⎞⎤ ⎪ A0 = 16T
3 2

⇒ y=
QL2
⎢− ⎜ ⎟ + 2⎜ ⎟ − ⎜ ⎟⎥ QL2 ⎡ 5 ⎛ x ⎞3 31 ⎛ x ⎞ 2 21 ⎛ x ⎞⎤
⎨ ⇒ y= ⎢− ⎜ ⎟ + ⎜ ⎟ − ⎜ ⎟⎥
⎪ A1 = −
2Q T ⎣⎢ 3 ⎝ L ⎠ ⎝ L ⎠ 3 ⎝ L ⎠⎦⎥ ⎨ 5Q
⎪ A1 = − T ⎢⎣ 8 ⎝ L ⎠ 16 ⎝ L ⎠ 16 ⎝ L ⎠⎥⎦
⎩ 3LT
⎩ 8LT

Least Square method :


⎧ 5Q
⎪ A0 = 4T QL2 ⎡ 1 ⎛ x ⎞3 7 ⎛ x ⎞ 2 5 ⎛ x ⎞⎤
⎨ ⇒ y= ⎢− ⎜ ⎟ + ⎜ ⎟ − ⎜ ⎟⎥
Q T ⎢⎣ 2 ⎝ L ⎠ 4 ⎝ L ⎠ 4 ⎝ L ⎠⎥⎦
⎪ A1 = −
⎩ 2 LT

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Flexible String – Numerical Solutions


0
0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1

-0,05
Exact
Collocation
-0,1
Least square
Galerkin=Ritz
-0,15

-0,2

-0,25

-0,3

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

14
Flexible String – Numerical Solutions
Residuals :
R = 2T A0 + T (6 x − 2 L) A1 - 3Q for 0 ≤ x ≤ 0.5 L
R = 2T A0 + T (6 x − 2 L) A1 - Q for 0.5 L ≤ x ≤ L
1,5

Collocation
1 Least square
Galerkin = Ritz

R
0,5

0
0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1

-0,5

-1

-1,5
String length x/L

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Flexible String – Numerical Solutions


• Error=numerical solution – Exact solution
0,01
Collocation method
0,008
Least square
Error 0,006
Galerkin = Ritz
0,004

0,002

0
0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1
-0,002

-0,004

-0,006

-0,008

-0,01

String length x/L

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

15
Comments
• Integration by parts (1D, 2D and 3D)
– The main purpose is to reduce the order of the differential terms
to be integrated. – The lower the better

• Both Ritz and Galerkin methods can be used for element


method formulations – Galerkin is more general method.
In many cases it is not easy to derive an energy
equation.

• Both Ritz and Galerkin use a weak formulation.

• Collocation method is perhaps the most believable. But


it uses a so-called strong formulation and not suitable for
finite element formulation.

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

Questions to Think
• We have solved the displacements. But
can you solve the T for the string problem?

• How can we solve the T if the q is known?

TKT4145 – The Finite Element Method, NTNU Spring Course – Zhiliang Zhang

16

You might also like