You are on page 1of 5

İzmir Institute of Technology

CE 322 Introduction to Structural Analysis


Spring 2018-2019
Term Project - Computer Implementation of Direct Stiffness Method
for 2-D Truss Structures - Part I

Introduction

AT THE END OF THIS DOCUMENT, THERE IS AN ASSIGNMENT WHICH IS


SUPPOSED TO BE DONE BY YOU.
DUE DATE : 29 / 04 / 2019.
PLEASE SENT YOUR MATLAB SCRIPTS TO YOUR TEACHING ASSISTANT BY
E-MAIL : suleymanyasayanlar@iyte.edu.tr
PLEASE DO THE ASSIGNMENT YOURSELF.
This document is going to serve as a guideline for the computer implementation of the
direct stiffness method of structural analysis for 2D trusses. The implementation is
going to be done in Matlab. In this implementation computational performance does
not have a primary importance.
The units used here are : meter, N and Pascal.

Problem Data
Problem data consists of,

• Nodal coordinates

• Element nodal connectivity


• Element material data (Modulus of Elasticity) and geometrical data (cross-sectional
area)
• Boundary conditions
• External forces

This set of data is going to be introduced with the aid of the problem shown in the
figure 1. This structure has 4 joints and 6 members.
For a structure with N joints, nodal coordinates can be stored in an array called XY
with the following convention,
 
x coordinate of joint 1 y coordinate of joint 1
 x coordinate of joint 2 y coordinate of joint 2 
 
XY =  x coordinate of joint 3 y coordinate of joint 3 
 
 .. .. 
 . . 
x coordinate of joint N y coordinate of joint N
For the given problem XY reads as,
 
0.0 0.0
3.0 0.0
XY = 
3.0

4.0
6.0 4.0

1 of 5
30 ◦
PSfrag replacements

12 kN
3 2 4

3
1
Y 4m 6
4
1
2
7 X 5
8
Node and element numbering
3m 3m

Figure 1: Example Problem

Element nodal connectivity NC describes the starting joint and end joint of each element.
Therefore for a structure for M elements,

 
starting joint number of element 1 end joint number of element 1
 starting joint number of element 2 end joint number of element 2 
 
NC =  starting joint number of element 3 end joint number of element 3 
 
 .. .. 
 . . 
starting joint number of element M end joint number of element M

The selection of the beginning and end joint of an element is arbitrary and once these
two joint numbers are defined, the local axis of the element is defined as well.
For the given problem, NC array is,
 
1 3
3 4
 
2 3
NC =  1 4

 
1 2
2 4

Material and geometric data are also stored ina matrix with the following convention,
 
E of element 1 A of element 1
 E of element 2 A of element 2 
 
MG =  E of element 3 A of element 3 

.. ..

 
 . . 
E of element M A of element M
For the given problem, MG has the following explicit form,

2 of 5
 
2.1E + 11 1.439E − 3
2.1E + 11 1.439E − 3
 
2.1E + 11 1.439E − 3
MG = 
2.1E + 11

 1.439E − 3

2.1E + 11 1.439E − 3
2.1E + 11 1.439E − 3
Boundary conditions are going to be stated by means of the matrix BC. For the de-
scription of the boundary conditions, we are going to use some simple flag for each joint
where a boundary condition is prescribed. Flag can take the values 0 or 1. Referring
to the given problem, there are two nodes on which boundary conditions exist; namely
node 1 and node 2. Flag will describe whether the displacement in X or Y direction is
prescribed (prescribed to be 0.0). Therefore the generic form of the BC matrix reads
as,
 
Joint number BC flag in X direction BC flag in Y direction
Joint number BC flag in X direction BC flag in Y direction
BC =  .. ..
 

 . . 
Joint number BC flag in X direction BC flag in Y direction
THE NUMBER OF ROWS OF THIS MATRIX IS EQUAL TO THE NUMBER OF
NODES ON WHICH THERE EXIST BOUNDARY CONDITIONS. For the given prob-
lem, BC matrix has the following form,
 
1 1 1
BC =
2 0 1
The flag 1 means that displacement in that direction is constrained and 0 means that the
displacement in that direction is free. In our example, at node 1 both displacement in X
and in Y directions are constrained (prevented, forced to be zero) therefore the second
and third columns on the 1st row is 1 and 1, respectively. At node 2, displacement in
X direction is free and the displacement in y direction is prevented. Therefore there is
0 and 1 on the second and third columns of the 2nd row, respectively.
The last ingredient of problem data is the specification of the external forces acting on
the structure. To this end we will introduce the FEXT matrix which has the following
structure,
 
Joint number Force in X direction Force in Y direction
Joint number Force in X direction Force in Y direction
FEXT =  .. ..
 

 . . 
Joint number Force in X direction Force in Y direction
THE NUMBER OF ROWS OF THIS MATRIX IS EQUAL TO THE NUMBER OF
NODES ON WHICH THERE EXIST AN EXTERNAL FORCE. For the given problem,
FEXT matrix has the following form,
 
FEXT = 3 10392.3 −6000.0
10392.3 is obtained through 12000*cos(30).
At this stage specification of the problem data is completed. The next stage is going to
be the specification of the dof numbering in Matlab. In fact, dof numbering is almost
arbitrary but NOT completely arbitrary (Remember, joint and element numbering is
arbitrary). We number them in a smart way so that in the column of global nodal
displacements, the prescribed dofs (dofs associated with the boundary conditions) and
the other dofs are separated as sub-columns of U (We will talk about this in the class).

3 of 5
This implies that we should give the dofs which are associated with the boundary
conditions the largest dof numbers. Since at each joint there exists two dofs, a DOF
matrix of N (number of joints) by 2 is going to be created with 0 entries. For the given
problem,
 
0 0
0 0
DOF =  0 0

0 0
This is the starting point. By using a suitable algorithm we should assign dof numbers
to every joint. In table 1, essential steps of the algorithm are outlined.

Table 1: Dof number assignment algorithm part - I


k=1
⊲ Loop over nodes (loop counter i)
⊲ Loop over rows of BC array (loop counter j )
⊲ Check whether there exists BC on the node
⊲ End loop over rows of BC array
⊲ If there is NO BC on the node
⊲ DOF(i,1) = k
⊲ DOF(i,2) = k+1
⊲ k = k+2
⊲ Else if there is BC on the node AND X dir. is NOT constrained
⊲ DOF(i,1) = k
⊲ k = k+1
⊲ Else if there is BC on the node AND Y dir. is NOT constrained
⊲ DOF(i,2) = k
⊲ k = k+1
⊲ End if
⊲ End Loop over nodes

At the end of this algorithm (this is the first stage of the algorithm), DOF matrix is
going to take the following form,
 
0 0
1 0
DOF =  2 3

4 5

After this stage, we can fill in the remaining 0 entries of the DOF matrix simply by
the next algorithm given in table 2. (Please keep in mind that, after this stage, for this
particular example, k has the value 6.) At the end of this second stage, DOF matrix

Table 2: Dof number assignment algorithm part - II


⊲ Loop over nodes (loop counter i)
⊲ Loop over X and Y directions (loop counter j )
⊲ If DOF(i,j) is zero
⊲ DOF(i,j) = k
⊲ k = k+1
⊲ End loop over X and Y directions
⊲ End Loop over nodes

4 of 5
will read as,  
6 7
1 8
DOF = 
2

3
4 5
This DOF matrix implies that the dof numbers of joint 1 (look at the first row of DOF
matrix) are 6, 7 respectively. Dof numbers of joint 2 (second row of DOF matrix) are
1 and 8, respectively. The others are similarly defined. It is clearly seen that dofs
associated with boundary conditions (X and Y dof of joint 1 and Y dof of joint 2) have
the largest dof numbers.
ASSIGNMENT
You are going to write a Matlab script which will produce the DOF matrix of the
structure. By following the steps given above, you can easily do this. You can test your
script by the example problem given here. BUT KEEP IN MIND THAT IT SHOULD
WORK FOR ANY 2D TRUSS STRUCTURE LAY-OUT (NOT RESTRICTED TO 4
JOINTS/NODES AND 6 MEMBERS).
Obviously, at the top of your script, you should put the problem data explicitly.

5 of 5

You might also like