Finite Element Method Derive 2
Finite Element Method Derive 2
𝑦 𝑇 𝑥′
2
𝑢2′ , 𝑓′2𝑥
𝐿
𝑦′
1
𝑇 𝑢1′ , 𝑓′1𝑥
𝜃 𝑥
Hook’s law
𝜎𝑥 = 𝐸𝜀𝑥 (1)
′
𝑢2′ − 𝑢1′ (4)
𝑓2𝑥 = 𝑇 = 𝐴𝐸
𝐿
In matrix form
𝑓′ 𝐴𝐸 1 −1 𝑢1′ (5)
{ 1𝑥
′ } = [ ]{ }
𝑓1𝑥 𝐿 −1 1 𝑢2′
𝐴𝐸 1 −1 (7)
[𝑘′] = [ ]
𝐿 −1 1
1
By Vat Sun and Chandara Ven
𝑦′ 𝑦
𝑣
𝑥′
𝑣′
𝐴⃗ 𝑢′
𝜃 𝑥
𝑢
The coordinates of vector 𝐴⃗ can be expressed in both local (𝑥 ′ , 𝑦 ′ ) and global (𝑥, 𝑦) coordinates. The
relationship between these two coordinate systems can be established by a transformation matrix.
𝑢′ = 𝑢 cos 𝜃 + 𝑣 sin 𝜃 (8)
′
𝑣 = −𝑢 sin 𝜃 + 𝑣 cos 𝜃 (9)
In matrix form
cos 𝜃 sin 𝜃 𝑢
{𝑢′} = [ ]{ }
𝑣′ − sin 𝜃 cos 𝜃 𝑣
𝑐 𝑠 𝑢
{𝑢′} = [ ]{ }
𝑣′ −𝑠 𝑐 𝑣
Where 𝑐 = cos 𝜃 , 𝑠 = sin 𝜃
𝑐 𝑠 0 0
𝑀=[ ]
0 0 𝑐 𝑠
2
By Vat Sun and Chandara Ven
𝑢1 𝑓1𝑥
𝑣 𝑓1𝑦
{𝑑} = {𝑢1 } , {𝑓} =
2 𝑓2𝑥
𝑣2 {𝑓2𝑦 }
From eq. (7)
{𝑓′} = [𝑘′]{𝑑′}
𝑐2 𝑐𝑠 −𝑐 2 −𝑐𝑠 (14)
𝐴𝐸 𝑐𝑠 𝑠2 −𝑐𝑠 −𝑠 2 ]
𝑘= [
𝐿 −𝑐 2 −𝑐𝑠 𝑐2 𝑐𝑠
−𝑐𝑠 −𝑠 2 𝑐𝑠 𝑠2
3
By Vat Sun and Chandara Ven
The eq. (14) denotes the explicit stiffness matrix for a bar positioned at any angle within the x-y
coordinate (global coordinate).
The total stiffness matrix obtained from summation of the stiffness matrix from each element in
truss.
𝑁 (15)
∑[𝑘 𝑒 ] = [𝐾]
𝑒=1
4
By Vat Sun and Chandara Ven
We only need to use those rows of the structural stiffness matrix that correspond to the fixed
supports. At these supports, we are not supplying an external force so {𝐹} = 0. Our equation
becomes:
7. Truss example
𝑅4𝑦
𝐹3𝑦 = −25 𝑘𝑁
𝑅4𝑥 4 4
3
3
3m 2
1 1 2
𝑅1𝑥
𝐹2𝑥 = 20 𝑘𝑁
4m
𝑅1𝑦 𝑅2𝑦
8 6
4 4 5
7 3
3
2
1 4
1 1 2
3
2
5
By Vat Sun and Chandara Ven
MATLAB code
% input: node x(m) y(m)
Nodes=[1 0 0
2 4 0
3 4 3
4 0 3];
% node1 node2 E(GPa) A(mm^2)
Elements=[ 1 2 210 200
2 3 210 200
1 3 210 200
3 4 210 200];
7.3. Support
The degrees of freedom (dof) for constrained displacements are numbered as 1, 2, 4, 7, and 8.
6
By Vat Sun and Chandara Ven
MATLAB code
Support=[1 2 4 7 8];
or in structural matrix
1 2 3 4 5 6 7 8
10500 0 −10500 0 0 0 0 0 1
0 0 0 0 0 0 0 0 2
−10500 0 10500 0 0 0 0 0 3
𝑘1 = 0 0 0 0 0 0 0 0 4
0 0 0 0 0 0 0 0 5
0 0 0 0 0 0 0 0 6
0 0 0 0 0 0 0 0 7
[ 0 0 0 0 0 0 0 0] 8
Element 2
3 4 5 6
0 0 0 −14000 3
𝑘2 = [0 14000 0 0 ]4
0 0 0 0 5
0 −14000 0 14000 6
Element 3
1 2 5 6
5376 4032 −5376 −4032 1
𝑘3 = [ 4032 3024 −4032 −5376] 2
−5376 −4032 5376 4032 5
−4032 −5376 4032 5376 6
Element 4
5 6 7 8
10500 0 −10500 0 5
𝑘4 = [ 0 0 0 0] 6
−10500 0 10500 0 7
0 0 0 0 8
∑[𝑘 𝑒 ] = [𝐾]
𝑒=1
7
By Vat Sun and Chandara Ven
1 2 3 4 5 6 7 8
15876 4032 −10500 0 −5376 −4032 0 0 1
4032 3024 0 0 −4032 −3024 0 0 2
−10500 0 10500 0 0 0 0 0 3
[𝐾] = 0 0 0 14000 0 −14000 0 0 4
−5376 −4032 0 0 15876 4032 −10500 0 5
−4032 −3024 0 −14000 4032 17024 0 0 6
0 0 0 0 −10500 0 10500 0 7
[ 0 0 0 0 0 0 0 0] 8
MATLAB code
% Calculate two dimensional stiffness matrix [K]
K=zeros(NUMDEG);
for n=1:NUMBAR
E=Elements(n,3);A=Elements(n,4);
NA=Elements(n,1);NB=Elements(n,2);
x1=Nodes(NA,2);
y1=Nodes(NA,3);
x2=Nodes(NB,2);
y2=Nodes(NB,3);
Le=sqrt((x2-x1)^2+(y2-y1)^2);
c=(x2-x1)/Le;
s=(y2-y1)/Le;
Ke=E*A/Le*[c^2 c*s -c^2 -c*s
c*s s^2 -c*s -s^2
-c^2 -c*s c^2 c*s
-c*s -s^2 c*s s^2];
ae=[2*NA-1 2*NA 2*NB-1 2*NB];
K(ae,ae)=K(ae,ae)+Ke;
end
{𝐹} = [𝐾]{𝑑}
In the given equation, the structural or global stiffness matrix is represented by [𝐾], displacement of
each node is denoted by {𝑑}, and the external force matrix is represented by {𝐹}.
𝑑1
15876 4032 −10500 0 −5376 −4032 0 0 0
4032 3024 0 0 −4032 −3024 0 0 𝑑2 0
−10500 0 10500 0 0 0 0 0 𝑑3 20
0 0 0 14000 0 −14000 0 0 𝑑4 = 0
−5376 −4032 0 0 15876 4032 −10500 0 𝑑5 0
−4032 −3024 0 −14000 4032 17024 0 0 𝑑6 −25
0 0 0 0 −10500 0 10500 0 𝑑7 0
[ 0 0 0 0 0 0 0 0] {𝑑 } { 0 }
8
Boundary conditions exist at the fixed supports, where we assume that these joints are immovable
in the restricted direction. Accordingly, we exclude them from our matrix. The degrees of freedom
(dof) for constrained displacements are numbered as 1, 2, 4, 7, and 8. The rows and columns to be
removed in equation above are indicated by the lines.
8
By Vat Sun and Chandara Ven
𝑑1
15876 4032 −10500 0 −5376 −4032 0 0 0
4032 3024 0 0 −4032 −3024 0 0 𝑑2 0
−10500 0 10500 0 0 0 0 0 𝑑3 20
0 0 0 14000 0 −14000 0 0 𝑑4 = 0
−5376 −4032 0 0 15876 4032 −10500 0 𝑑5 0
−4032 −3024 0 −14000 4032 17024 0 0 𝑑6 −25
0 0 0 0 −10500 0 10500 0 𝑑7 0
[ 0 0 0 0 0 0 0 0] {𝑑 } { 0 }
8
Resulting
10500 0 0 𝑑3 20
[ 0 15876 4032 ] {𝑑5 } = { 0 }
0 4032 17024 𝑑6 −25
Then
𝑑3 0.001905
{𝑑5 } = { 0.000397 }
𝑑6 −0.00156
MATLAB code
% Calcule nodal displacement
ad=setdiff(1:NUMDEG,Support);
d=K(ad,ad)\Force(ad);
D=zeros(NUMDEG,1);
D(ad)=d;
9
By Vat Sun and Chandara Ven
Sigma(n)=E/Le*[-c -s c s]*D(ae);
end
MATLAB code
% Calculates normal forces in bars N
N=zeros(NUMND,1);
for n=1:NUMBAR
A=Elements(n,4);
N(n)=Sigma(n)*A;
end
10