Finite Element Analysis
Finite Element Analysis
Submitted to the
By
1
PROBLEM STATEMENT
A bar with variable cross-section is subjected to a uniformly distributed axial load of p =2000
kg/m. The cross-sections at the support, mid-length and free end are, 60 x 60 cm2, 30 x 30 cm2 and
20 x 20 cm2 respectively. Assume that the cross-section varies quadratically in between these
points on all 4 sides (Hint: Obtain a quadratic formula that passes through the given areas).
Assume E= 2 x 106 kg/cm2 and L=5m.
(a) Determine the displacement along the member using truss elements with 2 nodes (linear
interpolation functions). What are the minimum number of elements for convergence? Show the
variation of displacement and stress along the member for at least 5 cases.
(b) Determine the displacement along the member using truss elements with 3 nodes (quadratic
interpolation functions). What are the minimum number of elements for convergence? Show the
variation of displacement and stress along the member for at least 5 cases.
(Hint: For convergence, let the stress distribution be your acceptance criteria).
2
MODEL DESCRIPTION
Figure 2.1 depicts a tapered elastic bar subjected to a traction force over the length and attached to
a fixed support at one end. The cross-sectional area varies quadratically from Area 60 x 60 cm2 at
the fixed support at x = 0 to Area 20 x 20 cm2 at x = 5 m. The cross-section varies quadratically
on all four sides of the bar.
3
OBJECTIVES
A tapered bar subjected to a traction force along the length will be analyzed in order to predict the
distributions of stress and displacement in the bar. A comparison will be made between the exact
solution and discretized solution for the bar. The purpose is to understand how to discretize a
structure and divide a traction load into axial loads at different points to somehow reach a point
where we can have a solution which matches with the exact solution.
The outcome of the project is as follows.
• To understand how to discretize a complex structure into simple structures.
• To divide a traction loading along the length into axial loading at different nodes.
• To use two-node truss elements analysis to calculate the displacements and stresses.
• To use three-node truss elements to calculate the displacements and stresses.
• To develop an equation to calculate the cross-sectional area of the structure.
• To calculate the exact solution using the computer program MATLAB.
• To do the analysis of complex structures using finite element analysis.
• To compare the exact solution with the discretized solution and understand the concept of
finite element analysis.
4
METHODOLOGY
Assumptions:
The following assumptions are used in deriving the stiffness matrix of the bar elements:
a) The bar elements cannot sustain shear force or bending moment
b) Hooke’s law applies (axial load is related to axial strain).
c) Any effect of transverse movement is ignored.
d) There are no intermediate applied loads (all loads are applied at the nodes).
𝐿
b) At 𝑥 = 2 , where 𝐿 = 5𝑚
5
𝐴 ( ) = 𝐴2 = 0.09𝑚2
2
5 5
0.09 = 𝑎(2)2 + 𝑏(2) + 0.36
6.25𝑎 + 2.5𝑏 = −0.27 (1)
c) At 𝑥 = 𝐿 , where 𝐿 = 5𝑚
𝐴(5) = 𝐴3 = 0.04𝑚2
0.04 = 𝑎(5)2 + 𝑏(5) + 0.36
25𝑎 + 5𝑏 = −0.32 (2)
5
Discretization of Elements
As shown in the figure 4.1. the tapered bar with varying cross-section is divided into one element
with the same cross-section area throughout the length of the bar. This will give us an
approximation of the data of the load applied and the displacement of the bar as compared to the
exact solution.
Similarly, the bar will be further divided into several elements with different cross-section area
based upon the length and we will obtain a solution which will coincide with the graph of the exact
solution. An example will be shown in two node truss elements on how the structure will be divided
into various elements.
The purpose of discretization is to understand the use of finite element analysis on how a complex
structure can be divided into different parts and its analysis can be carried out using two-node truss
elements and three-node truss elements which will be further discussed in detail.
6
3)The cross-section area remains constant during deformations.
Now considering the same bar in fig 4.1 where we have discretized the area into a single bar
element upon which a traction force of 2000 kg/m is acting throughout.
Consider the length as L with constant cross-section area A in fig 5.1.
First, we need to define a displacement function for our element since it is a 2-node truss element
we will assume a linear displacement function.
𝑢 = 𝑎1 + 𝑎2 𝑥
𝑢(0) = 𝑢1 = 𝑎1
𝑢(𝐿) = 𝑢2 = 𝑎1 + 𝑎2 𝐿
𝑢2 − 𝑢1
𝑎2 =
𝐿
1−𝑥 𝑥
𝑢(𝑥) = ( ) 𝑢1 + ( )𝑢2
𝐿 𝑙
1−𝑥 𝑥
𝑁1 = , 𝑁2 =
𝐿 𝐿
Now with this shape function, we can calculate the force acting at each node because this function
is independent of each other. When N1=1, N2=0 and similarly vice versa.
𝐴𝐸 1 −1
For the bar element we know that the stiffness matrix [𝑘] = [ ]
𝐿 −1 1
As we know from spring element the force in the bar is represented as,
𝑓 = [𝑘]𝑢̂
Which for two nodes can be written as,
𝑓1𝑥 𝐴𝐸 1 −1 𝑢1
{ }= 𝐿 [ ]{ } (3)
𝑓2𝑥 −1 1 𝑢2
After getting the equation and the shape functions our objective is to convert the traction force into
axial force which can be done by using the equation below,
Where,
[𝑁𝑠 ]𝑇 = 𝑡𝑟𝑎𝑛𝑠𝑝𝑜𝑠𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑠ℎ𝑎𝑝𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛
Using equation (3) & (4) we can calculate the forces acting at each node,
7
𝑥
𝐿 1−
𝑓1𝑥
𝑓 = { } = {𝑓𝑠 } = ∬ [𝑁𝑠 ]𝑇 {𝑇̂𝑠 }𝑑𝑆 = ∫ { 𝑥 𝐿} {𝑇̂𝑠 } 𝑑𝑥
𝑓2𝑥 𝑠1 0
𝐿
Using the above equation, we can easily convert the traction force into axial loads at the two points
for single element.
Now once you know the displacement the stress will be
𝑢 𝐸 𝐸
𝜎 = 𝜖 ∗ 𝐸 = 𝐸[𝐵1 𝐵2 ] [𝑢1 ] = − 𝑢1 + 𝑢2
2 𝐿 𝐿
8
In figure 5.2. and figure 5.3. it can be clearly seen how to discretize the element and with the help
of the shape function the traction force can be converted into axial load using equation (6). A
MATLAB code has been created for this whole process which gives us the values of the stress and
displacement.
9
10
Fig 5.4. Graphical representation of stress on one side and displacement on other.
The following graphs are plotted using the software MATLAB. These values are for single
element, five elements, twenty-five elements, fifty elements and hundred elements respectively
based on the ascending order starting from the top. You can easily make out from this graphical
representation that, more the number of elements you divide your structure into, your solution will
be more likely towards the exact solution.
11
Truss Elements with 3-nodes:
Similar process as 2-node truss element should be followed in 3-nodes as well. First, we will
discretize the bar with elements of different cross section area along different length. Now we will
distribute the forces in these elements but as there will be three nodes instead of two nodes the
load from the traction force will be distributed at three nodes. We can call it as local three nodes
of global two nodes of the element.
In the problem statement it is mentioned that the 3-node will be a quadratic interpolation function.
Due to the quadratic function and introduction of one extra node at the center of two existing nodes
from 2-nodes elements. The convergence with the exact solution will be faster and better results
can be obtained with a smaller number of elements.
To obtain the shape function of the element the following process should be followed.
𝑢(𝑥) = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2
𝑁1 = 1 𝑤ℎ𝑒𝑛 𝑥 = 0
𝑁1 = 0 𝑤ℎ𝑒𝑛 𝑥 = 𝐿/2 , 𝐿
𝑁2 = 1 𝑤ℎ𝑒𝑛 𝑥 = 𝐿/2
𝑁2 = 0 𝑤ℎ𝑒𝑛 𝑥 = 0, 𝐿
𝑁3 = 1 𝑤ℎ𝑒𝑛 𝑥 = 𝐿
𝑁3 = 0 𝑤ℎ𝑒𝑛 𝑥 = 0, 𝐿/2
𝑓 = [𝑘]𝑢̂
Procedure to obtain the [k] matrix for 3-nodes elements,
12
𝑢1
𝑑𝑢(𝑥)
But, 𝜀 = 𝑑𝑥
= [𝑁1 𝑁2 𝑁3] [𝑢2 ]
𝑢3
Hence by differentiating,
3 4
𝑁1 = − + 2 𝑥
𝐿 𝐿
4 8
𝑁2 = − 𝑥
𝐿 𝐿2
1 4
𝑁3 = − + 2 𝑥
𝐿 𝐿
3 4 4 8 1 4
[𝐵] = [− + 𝑥 − 𝑥 − + 2 𝑥]
𝐿 𝐿2 𝐿 𝐿2 𝐿 𝐿
Now by Hooke’s law we know that,
𝜎 = 𝐸𝜀 = 𝐸[𝐵][𝑢]
[𝐾]𝐿 = ∫ [𝐵]𝑇 [𝐷][𝐵]𝑑𝑣, 𝑤ℎ𝑒𝑟𝑒 [𝐷] 𝑖𝑛 𝑜𝑢𝑟 𝑐𝑎𝑠𝑒 𝑖𝑠 𝑡ℎ𝑒 𝑚𝑜𝑑𝑢𝑙𝑢𝑠 𝑜𝑓 𝑒𝑙𝑎𝑠𝑡𝑖𝑐𝑖𝑡𝑦 (𝐸).
𝑓1 𝐿
[𝑓2 ] = ∫[𝑁]𝑇 ∗ 𝑝 ∗ 𝑑𝑥
𝑓3 0
𝑓1 𝐿 1 − 3𝑥/𝐿 + 2𝑥 2 /𝐿2
13
𝑓1 0.166𝑝𝑙
[𝑓2 ] = [0.666𝑝𝑙 ]
𝑓3 0.166𝑝𝑙
As per the calculation we can conclude that these forces will be distributed at the nodes which is
shown in the fig 5.5. 16.6% of the force will be distributed on node 1 and node 3 and the remaining
66.66% will act on the node 3.
14
15
16
Fig 5.6. Graphical representation of stresses and displacements for 3- node truss elements
The following graphs are plotted using the software MATLAB. These values are for single
element, five elements, twenty-five elements, fifty elements and hundred elements respectively
based on the ascending order starting from the top. You can easily make out from this graphical
representation that, more the number of elements you divide your structure into, your solution will
be more likely towards the exact solution
17
EXACT SOLUTION
Stress Function:
𝑘𝑔
Distributed Force (P) = 2000 𝑚2
18
CONCLUSION
Comparing both the graphical solution that we have obtained from MATLAB we can conclude
that more the number of elements you divide your structure into you are more likely to get an exact
solution. Now it depends on yours engineering judgement how you will discretize your structure.
Looking at the figures above in fig 5.5. and fig 5.6. it can be observed as we divide the structure
into 25 elements, we can get a solution matching to that of exact solution. But if you further divide
your elements you will get more convergence with the exact solution.
If you compare about the divergence of the graphs with the exact solution. The 2-node will
converge with higher number of elements. Since in 3-nodes we are already dividing the elements
to one extra node. Looking at the graph this can be easily stated that 3-node converges at a much
faster rate with the exact solution as compared to 2-node elements
19
REFERENCES
1) Daryl L. Logan (2016). A First Course in the Finite Element Method. Sixth Edition. Cengage
Learning
2) https://www.mathworks.com/
3) Lectures’ notes
20
APPENDIX
MATLAB code for 2-node truss elements
el = input('How many elements do you have? : ');
L = 5;%Length of non-prismatic bar in mtrs
E = 2*10^6; %Modolus of Elasticity of the bar
tr = 2000; %traction force
syms x;
A(x) = 3600 - 1520*x + 176*x*x; %Area function of the bar
split = linspace(0, L, el+1);
%fprintf('Split: [%d]\n', split);
Area = zeros(1, el);
%fprintf('Area: [%d]\n', area);
for i = 1:length(split)-1
Area1 = A(split(i));
Area2 = A(split(i+1));
Area(1, i) = (Area1 + Area2)/2;
end
%fprintf('[%d]\n', area);
identity = [1 -1;-1 1];
k_global = zeros(el+1);
for i = 1:length(split)-1
local_k_matrix = (Area(1,i)*E)/(L/el);
local_k_matrix = local_k_matrix * identity;
k_global(i,i) = k_global(i,i) + local_k_matrix(1,1);
k_global(i,i+1) = local_k_matrix(1,2);
k_global(i+1,i) = local_k_matrix(2,1);
k_global(i+1,i+1) = local_k_matrix(2,2);
%fprintf('[%d]\n', local);
end
%fprintf('[%d]\n', global_stiff);
force = zeros(el+1,1);
nodal_force = (tr*L)/(el);
force(:,1) = nodal_force;
force(1,1) = nodal_force/2;
force(el+1,1) = nodal_force/2;
%fprintf('[%d]\n', force);
k_global = k_global(2:el+1, 2:el+1);
force = force(2:el+1, :);
U = inv(k_global)*force;
%fprintf('[%d]\n', U);
figure('Name', 'Displacement of the tapered bar due to
traction force ');
plot(split, [0,U'], 'b--o');
21
ylabel('Displacement of the bar at different nodes in
m','FontWeight','bold');
xlabel('Length of the tapered elastic bar in
m','FontWeight','bold');
title('Variation of displacement and length of the bar');
U = [0, U']';
stress = zeros(1,el);
for i = 1:length(stress)
stress(1,i) = E*[-el/L el/L]*U(i:i+1,:);
end
%fprintf('[%d]\n', sigma);
figure, stairs(split, [stress, stress(1,el)]);
title('Stress along the bar','FontWeight','bold');
xlabel('stress kg/cm^2','FontWeight','bold');
ylabel('Length of the bar m','FontWeight','bold');
hold on
22
MATLAB code for 3-nodes truss elements:
el = input('How many elements do you have? : ');
L = 5;%Length of non-prismatic bar in mtrs
E = 2*10^10; %Modolus of Elasticity of the bar
tr = 2000; %traction force
N=3;
I = [7 -8 1; -8 16 -8; 1 -8 7] ;
KG = zeros( 2*el+1 );
for i = 1:el % for every element
KL = ((E*A(i)) / (3*(L/el))*I ); % where L/NE is each
element’s length
KG(2*i-1:2*i+1, 2*i-1:2*i+1) = KG(2*i-1:2*i+1, 2*i-1:2*i+1)
+ KL;
end
% At this point we have calculated the global stiffness
matrix
R = L*tr; % we compute the total reaction at node 1
F = zeros([ 2*el+1, 1 ]); % we create a column matrix for
the nodal forces
F(1) = 0.16*tr*( L/(el) ) - R; % we compute the first value
of the F matrix F(2*NE+1) = 0.16*p*( L/(NE) ); % we compute
the last value of the F matrix
for i=2:2*el % for the rest values of the F matrix
if mod(i,2) == 0
F(i) = 0.6666*tr*( L/el );
else
F(i) = 0.3333*tr*( L/el );
end
end
23
% At this point we have calculated the global nodal forces
using the equivalent nodal forces method
U = zeros([ 2*el+1, 1 ]);
U(2:2*el+1) = KG(2:2*el+1, 2:2*el+1) \ F(2:2*el+1); % we
solve U = KG-1*F after “partitioning”
% At this point we have obtained our U matrix, which means
that we know each node’s displacement
% Notice that U(1)=0 because the first node is at the
support
% Now we will calculate the stress in each element
S = zeros([ 3*el, 1 ]); % three values for every element
for i=1:el % for every element
S(3*i-2) = E*( (-3/(L/el))*U(2*i-1) + (4/(L/el))*U(2*i)-
(1/(L/el))*U(2*i+1));
S(3*i-1) = E*( (-3/(L/el))*U(2*i-1) + (4/(L/el))*U(2*i)-
(1/(L/el))*U(2*i+1) + (2/(L/el))*U(2*i-1) -
(4/(L/el))*U(2*i) + (2/(L/el))*U(2*i+1) );
S(3*i) = E*( (-3/(L/el))*U(2*i-1) + (4/(L/el))*U(2*i)-
(1/(L/el))*U(2*i+1) + (4/(L/el))*U(2*i-1) -
(8/(L/el))*U(2*i) + (4/(L/el))*U(2*i+1) );
end
25