0% found this document useful (0 votes)
36 views25 pages

Stiffness Matrix Method of 2D Truss Syst

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views25 pages

Stiffness Matrix Method of 2D Truss Syst

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Stiffness Matrix Method of 2D Truss Systems Using MATLAB

Stiffness Matrix Method Of 2D Truss Systems Using MATLAB

Ayodele AKIN-ADAMU
Dokuz Eylül Üniversitesi, Fen Bilimleri Enstitüsü, Bornova, 35100, İzmir
E-ileti: [email protected]

ABSTRACT
The truss system is the most efficient and widely used structural system used by structural engineers to span long
distances and to provide beautiful shape forms in external building façades. This system can be used as support
system for floors, roofs and bridges. The truss system is general classified as 2D or 3D structural system. While
the 2D truss system has the capacity to span up to 40m (clear span), its 3D counterpart can span up to 90m (clear
span) if supports are properly placed around it. The stiffness method of analysis is one of the 2 methods used for
structural analysis of plane truss system by matrix methodology. Its other counterpart is named the flexibility or
force method. The stiffness method is also referred to as Matrix Displacement Method in many literatures.
MATLAB is a programming and numerical computing software used by scientists and engineering professionals
all over the world to analyze data, develop algorithms and create models. MATLAB lends itself to structural matrix
method of analysis because of its extraordinary numerical computing power using matrix. This paper aims to
analyze a simple 2D truss system with six structural members using MATLAB software for calculation of the
member axial deflections and internal axial member force values. An algorithm is developed to write the MATLAB
code to solve this problem and each section of the MATLAB code is explained in this paper. The paper also aims
to provide 1st principle derivation for general stiffness matrix method of 2D plane truss structural system. A
popular computer software called staad.pro is used to check the validity of the numerical results from MATLAB.

Keywords: Plane truss, 3D Truss Structural Analysis, MATLAB, Staad.pro and matrix stiffness method,
Numerical Analysis and Force method.
.

INTRODUCTION
In public building construction projects such as sport facilities, religious buildings, stadiums
etc. the use of truss structural system to support roof is very important because this building
type usually require clear span of up to 50m without internal supports. The truss structural
system is the most efficient support system for this range of span. Also, enormous weight of
material will general be needed for this system, so there is a need to accurately determine the
internal forces in the members to design economy and safe structure. This structural system
may also be statically indeterminate to a very large order in which the use of simple method of
analysis such as the method of joints or section method is ineffective. The use of matrix method
makes its very simple for analyzing this structural system. Many programs software either use
matrix method or finite element method of analysis to solve structural analysis problems. The
use of Force displacement method (stiffness method) of matrix analysis is explained in this
paper.
The truss system can be built with either steel, aluminum or wood. The young modulus E of
steel and aluminum is approximately equivalent to 205 and 68.948kN/mm2 respectively. The
value of this engineering property E is very important in the computation of the deflection
values at each node of the truss structural system. In many literatures EA, which is the product
of young modulus and the cross-sectional area of the structural material is termed axial stiffness.
Ayodele Akin-Adamu

In this paper, the stiffness matrix method formula will be proved. The basic steps of
programming the stiffness method will be listed and the corresponding MATLAB code will be
written to compute the global stiffness matrix, compute deflection and internal axial forces of
the truss structural system.

STIFFNESS MATRIX METHODOLOGY FOR 2D TRUSS SYSTEM


When the effect of external translational displacement is considered to determine the resultant
displacement and internal forces, this methodology is called the stiffness/force displacement
method.

Figure 1. shows the 2D truss system that will be examined.

In 2D truss system, it is assumed that each node has 2 degrees of freedom (DOF) in the x and
y. I.e., each node can only move translationally in the x and y direction when loaded with
external actions. The nodes in the system cannot also rotate. Figure 1 shows an example of a
2D plane truss in the x and y plane. This figure will be used to explain stiffness matrix
methodology (SMM) for analysis of plane truss system in this paper.
There are 2 classes of coordinate axes used in SMM. It includes:
1. Global coordinate Axis
2. Local coordinate Axis.

Figure 2. Global and Local Coordinate Axis


A truss system has a single global axis that define the external actions, internal forces and the
node displacements in the truss structure as shown in the figure 2 (x and y). The (0,0) coordinate
can be specified at any point in the x and y plane. While each member element of a plane truss
has its unique local coordinate axis as shown in figure 2 (𝑥1 and 𝑦1, 𝑥2 and 𝑦2, 𝑥3 and 𝑦3 …).
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

Figure 3. Node and Member Label of Truss System


Actually, before the definition of the global and local coordinate axes, each node and member
are designated with a number such as 1, 2, 3, … as shown in figure 3. The numbering can be
different from this, the order does not matter. It is good practice to specify the local x coordinate
of each member 𝑥1, 𝑥2, 𝑥3 , … to always point away from the lower node number of each of
the member. For example, in members 1, 4, 5, 8 and 11, 𝑥1 , 𝑥4 , 𝑥5 , 𝑥8 and 𝑥11 local
coordinate axes point away from the lower node. The local 𝑦1 coordinate axes direction is
perpendicular to the local x coordinate axes direction.
The matrix methodology is based on the relationship between external actions/displacements
applied and the resulting translational displacement values and internal forces at each node in
the plane under consideration such as x and y plane, z and y plane or x and z plane. This resulting
translation displacement and internal axial forces can be assumed to be equal to F and A k
respectively as shown for a component member of truss frame in figure 4. This resulting
translational displacement and internal axis forces can also be represented in the members local
and global axes directions as shown in figure 5 and 6 respectively.

Figure 4: Member axial force, F (on left) and axial displacement, Ak (on right).
Ayodele Akin-Adamu

Figure 5: Local Member forces (on left) and Local member displacements (on right).

Figure 6: Global Member forces (on left) and Global member displacements (on right).
From Figure 5, the local member force and the local member displacement variables can be
written as column vectors 𝐟𝐤 and 𝐚𝐤 respectively as shown below:
⎡f ⎤
⎢f ⎥
𝐟𝐤 = ⎢ ⎥ (1)
⎢f ⎥
⎢ ⎥
⎣f ⎦
a
⎡ ⎤
a
[ 𝐚𝐤 ] = ⎢⎢ ⎥
⎥ (2)
a
⎢ ⎥
⎣a ⎦
Also from Figure 6, the global member force and the global member displacement variables
can be written as column vectors 𝐟𝐤 and 𝐚𝐤 respectively as shown below:
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

f
⎡f ⎤
[ 𝐟𝐤 ] = ⎢⎢ ⎥
⎥ (3)
f
⎢ ⎥
⎣f ⎦
a
a
[ 𝐚𝐤 ] = a (4)
a
By comparing Figure 4 and 5, F for any member k can be denoted by the column vectors shown
below respectively because f , f , a and a are assumed to be equal to 0 and f and f
equal to -F and F respectively.
−𝐅 −𝟏
0 0
𝐟𝐤 = = *𝐅 (5)
𝐅 𝟏
0 0
𝑨𝑲 = 𝑎 − 𝑎 (6)
Equation 6 can also be written in matrix form to give Ak as shown below:
a
⎡ ⎤
⎢ a ⎥
𝑨𝑲 = [−1 0 1 0] * ⎢ ⎥ (7)
a
⎢ ⎥
⎣a ⎦

Figure 7: Local Member forces (on left) and Local member displacements (on right) with
angle 𝜃 defined.
Ayodele Akin-Adamu

Figure 6: Global Member forces (on left) and Global member displacements (on right) with
angle 𝜃 defined.
The angle 𝜃 is a very important parameter in the stiffness matrix methodology of plane truss
system because it is one of the parameters for calculation of the global stiffness matrix of each
member. Each member has its unique 𝜃 . These angles ae the angles between the global x axis
and each component member measured in the counterclockwise direction.

Again, comparing Figure 1 and 7, 4 equations can be written for the relationship between the
axial force F and the local member forces (f f f and f ) and another four equations for the
axial displacement Ak and the local member displacements (a a a and a ).

f cos 𝜃 - f sin 𝜃 + f ∗ 0 + f ∗ 0 = −𝐹

f sin 𝜃 + f cos 𝜃 + f ∗ 0 + f ∗ 0 = 0

f ∗ 0+ f ∗0 +f cos 𝜃 - f sin 𝜃 = 𝐹

f ∗ 0+ f ∗0 +f sin 𝜃 + f cos 𝜃 = 0
The 4 equations above can be written in matrix form shown below for the local member
forces:

cos θ − sin θ 0 0 ⎡f ⎤ −F
⎢f ⎥
sin θ cos θ 0 0
⎢ ⎥= 0 (8)
0 0 cos θ − sin θ ⎢f ⎥ F
0 0 sin θ cos θ ⎢ ⎥ 0
⎣f ⎦
a cos θ - a sin θ + a ∗ 0 + a ∗ 0 = −A
a sin θ + a cos θ + a ∗ 0 + a ∗ 0 = 0
a ∗ 0+ a ∗0 +a cos θ - a sin θ = A
a ∗ 0+ a ∗0 +a sin θ + a cos θ = 0
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

The 4 equations above can be written in matrix form shown below for the local member
displacements:

cos θ − sin θ 0 0 a
⎡ ix ⎤ −A
sin θ cos θ 0 0 ⎢ aiy ⎥ 0
0 0 cos θ − sin θ ⎢ ajx ⎥ = A
(9)
0 0 sin θ cos θ ⎢ ⎥
⎣ ajy ⎦ 0

Another comparison of Figure 1 and 8, 4 equations can be written for the relationship between
the axial force F and the global member forces ( f f f and f ) and another four equations
for the axial displacement Ak and the local member displacements (a a a and a ).
f cos 𝜃 + f sin 𝜃 + f ∗ 0 + f ∗ 0 = −𝐹
−f sin 𝜃 + f cos 𝜃 + f ∗ 0 + f ∗ 0 = 0
f ∗ 0+ f ∗0 +f cos 𝜃 + f sin 𝜃 = 𝐹
f ∗ 0+ f ∗0 -f sin 𝜃 + f cos 𝜃 = 0
The 4 equations above can be written in matrix form shown below for the global member
forces:
f −F
cos θ sin θ 0 0 ⎡ ix ⎤
−sin θ cos θ 0 0 ⎢ fiy ⎥ 0
0 0 cos θ sin θ ⎢ fjx ⎥= F
(10)
0 0 − sin θ cos θ ⎢ ⎥
⎣ fjy ⎦ 0

a cos 𝜃 + a sin 𝜃 + a ∗ 0 + a ∗ 0 = −A
−a sin 𝜃 + a cos 𝜃 + a ∗ 0 + a ∗ 0 = 0
a ∗ 0+ a ∗0 +a cos 𝜃 + a sin 𝜃 = A
a ∗ 0+ a ∗0 -a sin 𝜃 + a cos 𝜃 = 0
The 4 equations above can be written in matrix form shown below for the global member
displacements:
cos θ sin θ 0 0 aix −A
−sin θ cos θ 0 0 aiy 0
0 0 cos θ sin θ ajx = A (11)
0 0 − sin θ cos θ ajy 0
By substituting equation (5) in (8):
cos θ − sin θ 0 0 −1 −F
sin θ cos θ 0 0 0 *𝐅= 0
0 0 cos θ − sin θ 1 F
0 0 sin θ cos θ 0 0
Ayodele Akin-Adamu

− cos θ −F
− sin θ
*𝐅= 0 (12)
cos θ F
sin θ 0
By substituting equation (5) in (9):
By applying hookies law of elasticity, the axial force (F) in a truss member is directly
proportional to its displacement (A)
𝐅=K *A (13)
×
Where K = (14)

Here 𝐴𝑟 = Cross sectional area of the kth member


𝐸 = Elasticity of modulus of the kth member
𝐿 = Length of the kth member.
By substituting equation (13) in (12):
− cos θ −F
− sin θ
*K *A = 0 (15)
cos θ F
sin θ 0
By substituting equation (7) in (15):
− cos θ −F
− sin θ _
*K * [−1 0 1 0] * [ak] = 0
cos θ F
sin θ 0
cos θ 0 − cos θ 0 −F
_
* [ak] = 0
sin θ 0 − sin θ 0
K * (16)
−cos θ 0 cos θ 0 F
0 0 sin θ 0 0
By substituting equation (11) in (16):
cos θ 0 − cos θ 0 cos θ sin θ 0 0 a −F
sin θ 0 − sin θ 0 − sin θ cos θ 0 0 a
K * * a = 0
−cos θ 0 cos θ 0 0 0 cos θ sin θ F
0 0 sin θ 0 0 0 −sin θ cos θ a 0

cos θk cos θk sin θk − cos θk − cos θk sin θk a


⎡ ⎤ −F
cos θk sin θk sin θk − cos θk sin θk − sin θk ⎥ a
* ⎢⎢
×
* = 0 (17)
cos θk sin θk ⎥ a F
⎢ − cos θk − cos θk sin θk cos θk ⎥ a 0
⎣− cos θk sin θk − sin θk cos θk sin θk sin θk ⎦
K * [𝐚𝐤 ] = [𝐅𝐤 ] (18)
By comparing equation (18) and (17), the formula for the global stiffness matrix ( K ) of each
member is deduced.
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

cos θk cos θk sin θk − cos θk − cos θk sin θk


⎡ ⎤
cos θk sin θk sin θk − cos θk sin θk − sin θk ⎥
* ⎢⎢
×
[𝐊 𝐤 ] = (19)
cos θk sin θk ⎥
⎢ − cos θk − cos θk sin θk cos θk ⎥
⎣− cos θk sin θk − sin θk cos θk sin θk sin θk ⎦
An important property of the stiffness member matrices (K ) is that they are all symmetry
matrices and the determinate of these matrices are always zero.
After all the stiffness matrices have been calculated by substituting θ and 𝐿 in equation 19
above, the Global Stiffness matrix of the truss system K is determined by adding all member
stiffness matrices systematically in the global stiffness matrix of the truss system. This
systematic approach is called the code method. The Global stiffness matrix, K is a square
matrix of size equal to the number of degrees of freedom of a given truss system. The example
truss used in this paper has 12 degrees of freedom, since it has 6 node points. Each node point
has 2 degrees of freedom. Therefore, the size of K is a 12 x 12 matrix.
The general procedure for structural analysis of plane includes the following:
1. The node points and members of the truss system are labeled in any order as shown in
the figure below. The node point labels here are denoted by the circled number from 1
to 6 in red, while the member labels are denoted by the numbers surrounded by triangles
from 1 to 12.
2. Determine the local (𝑥̅ ) axis directions of each member of the truss system as shown
below. There is no need to specify the direction of the local (𝑦) axis directions of each
member. For each member, the node number that each arrow head points to indicate the
member end node and the other node represent the start node. For example, Member 1
end and start node in the figure below are 2 and 1 respectively.

Figure 7. Local axis direction representation of each member.


3. The angle θ for all the members are determined. These angles are measured from the
global x axis of the truss system to local member x axis of each member in a
counterclockwise direction. For example, in the figure 7, member 1 and 7 has an angle
of 0 and 90 degree respectively. While member 8 and 11 are obtuse and acute angle
respectively.
4. The degree of freedom of each node are labelled with numbers starting from the lowest
node number in ascending order.
Ayodele Akin-Adamu

Figure 8. shows degree of freedom numbers at each node

5. The global stiffness matrix of each member is calculated by using equation (19). Each
global member stiffness matrix is also labelled with the degree of freedom number at
the start and end node. The label for member 1 in the truss example is shown below.
1 2 3 4
1
× 2
𝐾 =
3
4
Note that if the arrowhead points to node 1, 𝐾 matrix will change to this order shown
below:
3 4 1 2
3
× 4
𝐾 =
1
2
6. Then the support system, i.e., roller or pinned support is assumed to develop stiffness
of infinity value in the direction of degree of freedom. For example, in the truss example
above the supports provide restrain at node 1, 2, 7 and 8. A stiffness of infinity is
assumed at K (1,1), K (2,2), K (7,7) and K (8,8) of the global stiffness matrix of truss
system.
7. The global stiffness matrix, K is finally aggregated from the global member stiffnesses
and the support stiffnesses using the code method. The procedure of aggregation of these
matrices will be illustrated using MATLAB.
8. The global axial displacement matrix, DS at each node is computed using the formula
below.
[𝐷𝑆] = [𝐾 ] [𝑃 ] (20)
Where 𝑃 is column vector of the external point loads at each node points, starting from
degree of freedom 1 to the last degree of freedom.
9. The global axial member displacement matrix, 𝐷𝑆 at each node is deduced from DS
in step 8.
10. The global member axial force is finally determined from the product of the matrix of
the global member stiffness matrix and the global axial displacement matrix of each
member using the formula below:
[𝑃 ] = [𝐾 ][𝐷𝑆 ] (21)
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

ANALYSIS OF TRUSS SYSTEM EXAMPLE USING MATLAB

Figure 9. Example truss system to be analyzed.


The cross-sectional area of all elements = 20.7 × 10 𝑚
E = 205 × 10 kN/m2
MATLAB CODING FOR THE TRUSS SYSTEM EXAMPLE USING LIVE SCRIPT

ANALYSIS OF STATICALLY INDETERMINATE 2D TRUSS BY STIFFNESS METHOD

% THETA1 to THETA11 represent the θk values

% L1 to L11 represent the length of each elements

% function K = GSME(Theta, L) c = cosd(Theta); s = sind(Theta);

% K = [c*c, c*s, -c*c, -c*s; c*s, s*s, -c*s, -s*s; -c*c, -c*s, c*c, c*s; -c*s, -s*s, c*s, s*s]/L; end

% function K = GSME(Theta, L) is a function that takes the value of Theta

% and L and returns the matrix of the global member stiffness, K1 to K11.

TASK 1 DETERMINE THE GLOBAL STIFFNESS MATRICES OF ALL ELEMENTS

1st Element

THETA1 = 0, L1 = 2, K1 = GSME(THETA1, L1)

THETA1 = 0

L1 = 2
Ayodele Akin-Adamu

K1 = 4×4

0.5000 0 -0.5000 0

0 0 0 0

-0.5000 0 0.5000 0

0 0 0 0

2nd Element

THETA2 = 0, L2 = 2, K2 = GSME (THETA2, L2)

THETA2 = 0

L2 = 2

K2 = 4×4

0.5000 0 -0.5000 0

0 0 0 0

-0.5000 0 0.5000 0

0 0 0 0

3rd Element

THETA3 = 0, L3 = 2, K3 = GSME(THETA3, L3)

THETA3 = 0

L3 = 2

K3 = 4×4

0.5000 0 -0.5000 0

0 0 0 0

-0.5000 0 0.5000 0

0 0 0 0

4th Element

THETA4 = 0, L4 = 2, K4 = GSME(THETA4, L4)

THETA4 = 0

L4 = 2

K4 = 4×4

0.5000 0 -0.5000 0

0 0 0 0

-0.5000 0 0.5000 0

0 0 0 0

5th Element

THETA5 = 90, L5 = 1, K5 = GSME (THETA5, L5)


Stiffness Matrix Method of 2D Truss Systems Using MATLAB

THETA5 = 90

L5 = 1

K5 = 4×4

0 0 0 0

0 1 0 -1

0 0 0 0

0 -1 0 1

6th Element

THETA6 = 90, L6 = 1, K6 = GSME (THETA6, L6)

THETA6 = 90

L6 = 1

K6 = 4×4

0 0 0 0

0 1 0 -1

0 0 0 0

0 -1 0 1

7th Element

THETA7 = 90, L7 = 1, K7 = GSME (THETA7, L7)

THETA7 = 90

L7 = 1

K7 = 4×4

0 0 0 0

0 1 0 -1

0 0 0 0

0 -1 0 1

8th Element

THETA8 = 90 + atand(2/1), L8 = sqrt(2^2 + 1^2), K8 = GSME(THETA8, L8)

THETA8 = 153.4349

L8 = 2.2361
Ayodele Akin-Adamu

K8 = 4×4

0.3578 -0.1789 -0.3578 0.1789

-0.1789 0.0894 0.1789 -0.0894

-0.3578 0.1789 0.3578 -0.1789

0.1789 -0.0894 -0.1789 0.0894

9th Element

THETA9 = atand(1/2), L9 = sqrt(2^2 + 1^2), K9 = GSME(THETA9, L9)

THETA9 = 26.5651

L9 = 2.2361

K9 = 4×4

0.3578 0.1789 -0.3578 -0.1789

0.1789 0.0894 -0.1789 -0.0894

-0.3578 -0.1789 0.3578 0.1789

-0.1789 -0.0894 0.1789 0.0894

10th Element

THETA10 = 90 + atand(2/1), L10 = sqrt(2^2 + 1^2), K10 = GSME(THETA10, L10)

THETA10 = 153.4349

L10 = 2.2361

K10 = 4×4

0.3578 -0.1789 -0.3578 0.1789

-0.1789 0.0894 0.1789 -0.0894

-0.3578 0.1789 0.3578 -0.1789

0.1789 -0.0894 -0.1789 0.0894

11th Element

THETA11 = atand(1/2), L11 = sqrt(2^2 + 1^2), K11 = GSME(THETA11, L11)

THETA11 = 26.5651

L11 = 2.2361

K11 = 4×4

0.3578 0.1789 -0.3578 -0.1789

0.1789 0.0894 -0.1789 -0.0894

-0.3578 -0.1789 0.3578 0.1789

-0.1789 -0.0894 0.1789 0.0894


Stiffness Matrix Method of 2D Truss Systems Using MATLAB

TASK 2 DEFINE THE SUPPORT STIFFNESS

Support Stiffness at degree of freedom 1, 2, 7 and 8

K1R = inf, K2R = inf, K7R = inf, K8R = inf

K1R = Inf

K2R = Inf

K7R = Inf

K8R = Inf

TASK 3 ASSEMBLY OF THE GLOBAL STIFFNESS MATRIX

Global Stiffness Matrix of the Truss System Assembly

% Initially a zero square matrix of size 12 is created,

% then the component stiffness matrices of elements and supports are added as shown below

% 1:4 in line 20 denote 1 2 3 4 degree of freedom

% 1:2, 7:8 in line 20 denote 1 2 7 8 degree of freedom

K = zeros(12)
K = 12×12

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

K(1:4, 1:4) = K(1:4, 1:4) + K1;

K(3:6, 3:6) = K(3:6, 3:6) + K2;

K(7:10, 7:10) = K(7:10, 7:10) + K3;

K(9:12, 9:12) = K(9:12, 9:12) + K4;

K([1:2, 7:8], [1:2, 7:8]) = K([1:2, 7:8], [1:2, 7:8]) + K5;

K([3:4, 9:10], [3:4, 9:10]) = K([3:4, 9:10], [3:4, 9:10]) + K6;

K([5:6, 11:12], [5:6, 11:12]) = K([5:6, 11:12], [5:6, 11:12]) + K7;


Ayodele Akin-Adamu

K([3:4, 7:8], [3:4, 7:8]) = K([3:4, 7:8], [3:4, 7:8]) + K8;

K([1:2, 9:10], [1:2, 9:10]) = K([1:2, 9:10], [1:2, 9:10]) + K9;

K([5:6, 9:10], [5:6, 9:10]) = K([5:6, 9:10], [5:6, 9:10]) + K10;

K([3:4, 11:12], [3:4, 11:12]) = K([3:4, 11:12], [3:4, 11:12]) + K11;

K(1,1) = K1R;

K(2,2) = K2R;

K(7,7) = K7R;

K(8,8) = K8R;

K = 12×12

inf 0.1789 -0.5 0 0 0 0 0 -0.3578 -0.1789 0 0

0.1789 inf 0 0 0 0 0 -1 -0.1789 -0.0894 0 0

-0.5 0 1.7155 0 -0.5 0 -0.3578 0.1789 0 0 -0.3579 -0.1789

0 0 0 1.1789 0 0 0.1789 -0.0894 0 -1 -0.1789 -0.0894

0 0 -0.5 0 0.8578 -0.1789 0 0 -0.3578 0.1789 0 0

0 0 0 0 -0.1789 1.0894 0 0 0.1789 -0.0894 0 -1

0 0 -0.3578 0.1789 0 0 inf -0.1789 -0.5 0 0 0

0 -1 0.1789 -0.0894 0 0 -0.1789 inf 0 0 0 0

-0.3578 -0.1789 0 0 -0.3578 0.1789 -0.5 0 1.7155 0 -0.5 0

-0.1789 -0.0894 0 -1 0.1789 -0.0894 0 0 0 1.1789 0 0

0 0 -0.3578 -0.1789 0 0 0 0 -0.5 0 0.8578 0.1789

0 0 -0.1789 -0.0894 0 -1 0 0 0 0 0.1789 1.0894

TASK 4 Global Axial Displacement Calculation for all elements

External Force Column Vector

% -0.5, -2 and -1kN is located at the 4th, 10th and 12th position according to the degree of freedom numbering.

PS = [0 0 0 -0.5 0 0 0 0 0 -2 0 -1]'

PS = 12×1

-0.5000

0
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

-2.0000

Global Axial Displacement Matrix

% DS can also be calculated on MATLAB using the inverse function such as DS = inv(K) * PS;

DS = K \ PS;

Warning: Matrix is singular to working precision.

DS = DS / (205 * 1000000 * 20 * 10^(-4))

DS = 12×1

10-3 ×

-0.0267

-0.1005

-0.0312

-0.2315

0.0270

-0.1022

Global Axial Member Displacement Matrix

DS1 = DS(1:4)

DS1 = 4×1

10-3 ×

-0.0267

-0.1005

DS2 = DS(3:6)

DS2 = 4×1

10-3 ×

-0.0267

-0.1005
Ayodele Akin-Adamu

-0.0312

-0.2315

DS3 = DS(7:10)

DS3 = 4×1

10-3 ×

0.0270

-0.1022

DS4 = DS(9:12)

DS4 = 4×1

10-3 ×

0.0270

-0.1022

0.0322

-0.2327

DS5 = DS([1:2, 7:8],1)

DS5 = 4×1

DS6 = DS([3:4, 9:10],1)

DS6 = 4×1

10-3 ×

-0.0267

-0.1005

0.0270

-0.1022

DS7 = DS([5:6, 11:12],1)

DS7 = 4×1

10-3 ×

-0.0312

-0.2315
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

0.0322

-0.2327

DS8 = DS([3:4, 7:8],1)

DS8 = 4×1

10-3 ×

-0.0267

-0.1005

DS9 = DS([1:2, 9:10],1)

DS9 = 4×1

10-3 ×

0.0270

-0.1022

DS10 = DS([5:6, 9:10],1)

DS10 = 4×1

10-3 ×

-0.0312

-0.2315

0.0270

-0.1022

DS11 = DS([3:4, 11:12],1)

DS11 = 4×1

10-3 ×

-0.0267

-0.1005

0.0322

-0.2327

TASK 5 Global Axial Force Calculation for all elements

Global Member Axial Force

% The Axial force is calculated using P = K * DS for all the elements

P1 = 205 * 1000000 * 20 * 10^(-4) * K1 * DS1


Ayodele Akin-Adamu

P1 = 4×1

5.4634

-5.4634

P2 = 205 * 1000000 * 20 * 10^(-4) * K2 * DS2

P2 = 4×1

0.9390

-0.9390

P3 = 205 * 1000000 * 20 * 10^(-4) * K3 * DS3

P3 = 4×1

-5.5366

5.5366

P4 = 205 * 1000000 * 20 * 10^(-4) * K4 * DS4

P4 = 4×1

-1.0610

1.0610

P5 = 205 * 1000000 * 20 * 10^(-4) * K5 * DS5

P5 = 4×1

P6 = 205 * 1000000 * 20 * 10^(-4) * K6 * DS6

P6 = 4×1

0.7012

-0.7012
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

P7 = 205 * 1000000 * 20 * 10^(-4) * K7 * DS7

P7 = 4×1

0.4695

-0.4695

P8 = 205 * 1000000 * 20 * 10^(-4) * K8 * DS8

P8 = 4×1

3.4634

-1.7317

-3.4634

1.7317

P9 = 205 * 1000000 * 20 * 10^(-4) * K9 * DS9

P9 = 4×1

3.5366

1.7683

-3.5366

-1.7683

P10 = 205 * 1000000 * 20 * 10^(-4) * K10 * DS10

P10 = 4×1

0.9390

-0.4695

-0.9390

0.4695

P11 = 205 * 1000000 * 20 * 10^(-4) * K11 * DS11

P11 = 4×1

1.0610

0.5305

-1.0610

-0.5305

Figure 10: Member 1


Ayodele Akin-Adamu

Figure 11: Member 2

Figure 12: Member 3

Figure 13: Member 4

Figure 14: Member 5, 6 and 7


Stiffness Matrix Method of 2D Truss Systems Using MATLAB

Figure 15: Member 8

Figure 16: Member 9

Figure 17: Member 10


Ayodele Akin-Adamu

Figure 18: Member 11

VERIFICATION OF RESULTS USING STAAD.PRO SOFTWARE

Figure 19: Staad.pro Truss model.


In order to verify the accuracy and precision of the use MATLAB in these analyses, The results
of axial displacement and member forces of staad.pro is compared with MATLAB results. It
was found that the MATLAB results is exactly the same with staad.pro software results.
Stiffness Matrix Method of 2D Truss Systems Using MATLAB

Figure 20: Member end displacement table.

Figure 21: Member end force table.

You might also like