8/13/2019 Ch 4 Truss Analysis 2013
1/22
1
L
CHAPTER 4. MATRIX METHODS FOR PLANE TRUSSESWritten by: Sophia Hassiotis
Revised on February 2012
STIFFNESS OF AN AXIAL MEMBER
In order to determine the stiffness of an axial
member (the bar of the figure), we need to use:
1) equations of equilibrium: = P / A2) strain-displacements: = / L3) Hooke's Law: =E
Where: is the axial stress, is the axial
strain, is the deformation, L is the length,A is the cross-sectional area, E is the
modulus of elasticity for the material.
Substituting, we obtain :
P/A = E (/ L)or
P = (AE / L)
This equation is in the familiar form of : F = K x. In this case, is the displacement ofthe bar given an applied force P. Therefore, stiffness of the axial member is defined asAE/L.
8/13/2019 Ch 4 Truss Analysis 2013
2/22
2
k 1 A1E1
L1
3in2120ksi
5 t12in/t 6
kip
in
EXAMPLE 4. 1 Solution for a truss: Direct Stiffness Method
Create a stiffness matrix for this axial-member system given that E=120 ksi, A1=3 in2,
and A2=4 in2. The lengths are shown in the figure.
Note: sin = 3/5 = 0.6
cos = 4/5 = 0.8
Using the definition of the stiffness of an axial member derived above, the stiffness value
of each member is given by:
The process for building the stiffness matrix did not change. We impose a unit
displacement on one d.o.f. at a time, and we calculate the reactions developed to ensure
that the rest of the d.o.f are constrained to a zero displacement. Here, a unitdisplacement is imposed along d.o.f. 1. The figure shows the deformed shape of the
structure. Note that after the displacement, angle between the vertical and element 1 didnot change because we assume small deformations.
k 2 A2E2
L2
4in2120ksi
4t12in/t 10
kip
in
8/13/2019 Ch 4 Truss Analysis 2013
3/22
3
To accommodate a displacement of d.o.f 1, element 1 elongates by an amount 1 sin .The force required to produce such displacement along member 1 is found by:
F=stiffness x displacement:
To determine the forces along all other degrees of freedom, we can make use of
equilibrium. Thus we determine that:
K11=3.6 sin =3.60.6=2.16
21=3.6cos =3.60.8=2.88
31=2.16
41=2.88
Element 2 has undergone only a rigid-body rotation (no deformation). As such no stresseshave been induced. Therefore, K51=0and K61=0.
Now substituting into the stiffness matrix, [K]:
F
6
k
in
sin
3. 6
k
2.16
2.88
2.16
2.88
0
0
8/13/2019 Ch 4 Truss Analysis 2013
4/22
4
This procedure is now repeated for d.o.f. 2. We induce a unit displacement along d.o.f. 2
and calculate the reactions needed to keep all other d.o.f.s at a displacement of zero.
Under this displacement condition, member 1 shortens by a quantity 1*cos , whichtranslates to a compressive force of 6*4/5=4.8 k, while it takes a force of 10k to displacemember 2 by 1 in. These forces are shown in the figures below. Equilibrium is used to
solve for the participation of each member in the stiffness coefficients, Kij.
Member 1 Member 2
Equilibrium of member 1 shows that it adds the following to the stiffness matrix: K12= -2.88, K22=3.84, K32=2.88 and K42= -3.84. Equilibrium of member 2 shows that it adds
the following to the stiffness matrix: K12=0, K22=10, K52=0 and K62=-10. The totalcoefficients of the stiffness matrix are the addition of the participation of each member.
As such,
8/13/2019 Ch 4 Truss Analysis 2013
5/22
5
K12= 0 + (-2.88) = -2.88 k
K22= 10 + 3.84 = 13.84 k
K32= 0 + 2.88 = 2.88 k
K42= 0 + -3.84 = -3.84 k
K52= 0 + 0 = 0 k
K62= -10 + 0 = -10 k
Substituting into the stiffness matrix:
This procedure must be repeated for displacements at DOF 3, 4, 5, and 6.
Now, given that a force is applied to the free node of the truss of Fx=100 and Fy=50, we
can solve for the unknown displacements and reactions as:
=
6
5
4
3
50
100
0
0
0
0
2
1
10000100
000000
0084.38.284.388.2
008.216.288.216.2
10084.388.284.1388.2
0088.216.284.216.2
F
F
F
F
x
x
Separate and solve two sets of equations:
2.16 2.88
2. 88 13. 84
2. 16 2. 88
2.88 3.84
0 0
0
10
8/13/2019 Ch 4 Truss Analysis 2013
6/22
6
=
50
100
2
1
84.1388.2
88.216.2
x
x
from where, x1=70.7 and x2=18.3. Substitute these into the second set of equations andsolve for the unknown forces:
=
6
5
4
3
2
1
100
00
84.388.2
88.216.2
F
F
F
F
x
xfrom where,
=
183
0
133
100
6
5
4
3
F
F
F
F
As you can see, this is a very cumbersome method and is not necessary. A quicker,
easier method is available for creating the global stiffness matrix. In order to do this, we
work with individual elements and their local coordinates. The local coordinates are thentransformed into global coordinates. In the next section, we will be introducing
computer-based structural analysis to automate this process.
Homework 7.
(a)Derive all the columns of the stiffness matrix above.(b)Check with truss equilibrium that the solution above is correct.
8/13/2019 Ch 4 Truss Analysis 2013
7/22
7
COMPUTER-BASED STRUCTURAL ANALYSIS FOR TRUSS STRUCTURES
Here we will demonstrate a general procedure that can be used to develop algorithms.1. We will develop the stiffness matrix for a truss in the element coordinate
system
2. We will transform the stiffness matrix from the element coordinate system to theglobal coordinate system3. We will assemble all the element stiffness matrices to construct the structural
stiffness matrix
4. We will introduce a flowchart showing the steps towards a computer program5. PROJECT 1: Write a MATLAB subroutine to solve for a truss.
Relationship between Local and Global Coordinate Systems
As defined previously, the global structural coordinates are used to define displacements
and forces at the nodes of a structure that act along the principal axes of the structure. For
example, if X-Y is defined as the principal horizontal and vertical axes of the structure,each node of the truss has two degrees of freedom defined in the global X-Y system. The
truss below has global coordinates 1 to 8 associated with X-Y.
Each member of the truss can also be assigned a local coordinate axis. For example,
Element 1 is associated with axes x, y which are parallel and perpendicular to thelongitudinal axis of the member. For a consistent notation, we will associate the axes x
to be directed from node i to node jof the element where i
8/13/2019 Ch 4 Truss Analysis 2013
8/22
8
Kd=f
The same relationship holds true for a member within a structure. For example, for
Element 1, the relationship between the forces and the displacements would be
K'd' = f 'Where the prime signifies local coordinates and the matrix K' is the element stiffness
matrix in local coordinates.
Lets develop the stiffness relationship for the truss element where the stiffness of each
element is AE/L. First, we apply a unit displacement at node 1 while we fix node 2. Thus
we calculate K11and K21. Next, we apply a unit displacement at node 2 while we fix node1. Thus we calculate K22and K12
We can thus show that for a truss element, the element stiffness matrix is as follows:
Now, we want to place the stiffness of each element within a global stiffness for theentire structure. Each element contributes to the stiffness of the entire structure.
K AEL
1 1
1 1
8/13/2019 Ch 4 Truss Analysis 2013
9/22
9
d'1 d1
d1 d1
d2
d1 d2
The Transformation Matrix
We will use 1) compatibility of displacements and 2) equilibrium of forces to derive thetransformation matrix.
1) Compatibility of displacements requires that:
divide by d'1 :
Note that d1/d1=cos and d2/d1=sin . Then,
Similarly:
In matrix form:
or, d' = T d ; where T is the Transformation Matrix, and d is a vector of global
displacements.
d1
d1 cos d2 sin
d1
2 d12d2
2
d2
d3 cos d4 sin
d1
d2
cos sin 0 0
0 0 cos sin
d1
d2
d3
d4
8/13/2019 Ch 4 Truss Analysis 2013
10/22
10
2) Equilibrium of forces requires that:
f1= f1'cosf2= f1'sinf3= f2'cosf4= f2'sin
In matrix notation,
=
2
1
4
3
2
1
'
'
sin0
cos0
0sin
0cos
f
f
f
f
f
f
or, f = TTf' , where T
Tis the transpose of transformation matrix T,and fis a vector of
global forces.
We will make use of matrix algebra to generate the element stiffness matrix in global
coordinates:
K' d' = f' ; Substitute d' = Td
K' T d = f' ; pre-multiply both sides byTT
TTK' T d = T
Tf' ; Substitute f = T
Tf'
[TTK' T] d = f
Thus we obtain the stiffness matrix of Element 1 in global coordinates as
Ke1=TTK' T
Each element in the structure has its own Kand its own Kei. We need to assemble all
the Kes into a global matrix Kfor the structure.
The final Global Stiffness Matrix is the sum of each element stiffness matrix.
# of elements
K Kei
i1
8/13/2019 Ch 4 Truss Analysis 2013
11/22
11
Homework 8: MATLAB exercise on ASSEMBLY OF MATRICES
Write a Matlab subroutine to assemble any number of stiffness matrices into one matrix.
For example, assemble stiffness matrices Aand Bto obtain matrix C. In this example,
you are assembling two 4x4 matrices into one 6x6 matrix. The subroutine should begeneral and work with any size Cand any number of stiffness matrices.
A= ; B=
C=
Which gives a Cof:
C=
Notice the symmetry on matrices A, B and C.
Your algorithm should be general enough to assemble any number of matrices. You may
want to start the algorithm with the statements like
matrixsize=6;
C=zeros(matrixsize)
This will populate a 6x6 with zeros. Add the values of A and B to the correct places in
the C.
Please make sure that your input is included at the beginning of your m-file OR in an
excel file. DO NOT input ANYTHING on the screen while running the program.
8/13/2019 Ch 4 Truss Analysis 2013
12/22
12
EXAMPLE 4.2 Solution for a TrussMatrix Methods
We will use matrix methods to arrive at the global stiffness matrix of the truss of the
previous example.
Step 1: Label global axes, number nodes, degrees of freedom and elements. Number
constrained d.o.f. last.
E = 120 ksi, A1= 3 in2,A2= 4 in
2, from which, k1= 6 k/in, k2= 10 k/in.
First, we set up the global x-y axes, label all degrees of freedom from 1 to 6, and choosethe local xy axes of the elements going from node i to nodej.
Step 2: Find the transformation matrix of each element.
To find Ke1, note that 1,the angle between x and x1, is 126.9
o. Thus cos = 0.6 and
sin = 0.8. For compatibility of displacements,
Thus the transformation matrix Tis:
d1
d2
cos sin 0 0
0 0 cos sin
d1
d2
d3
d4
T 0.6 0. 8 0 0
0 0 0.6 0. 8
8/13/2019 Ch 4 Truss Analysis 2013
13/22
13
Step 3. Find the stiffness matrix of each element in global coordinates.
The element stiffness matrix for Element 1 in local coordinates is:
and we need to find the element stiffness matrix, for Element 1, in global coordinates by
using
Inputting the appropriate matrices,
Step 4. Repeat steps 2 and 3 for each element.
To find the element stiffness matrix for Element 2, Ke2
, in global coordinates, we start
again from the transformation matrix. Note that 2,the angle between x and x2 is 90.Thus cos = 0 and sin = 1.
K AEL
1 1
1 1 6
1 1
1 1
Ke1
0.6 0
0.8 0
0 0. 6
0 0.8
6 6
6 6
0.6 0.8 0 0
0 0 0.6 0.8
2. 16 2. 88 2. 16 2. 88
2. 88 3. 84 2. 88 3. 84
2. 16 2. 88 2. 16 2. 88
2. 88 3. 84 2. 88 3. 84
T cos sin 0 0
0 0 cos sin
0 1 0 0
0 0 0 1
K AEL
1 1
1 1 10
1 1
1 1
10 10
10 10
Ke2
0 0
1 0
0 0
0 1
10 10
10 10
0 1 0 0
0 0 0 1
0 0 0 0
0 10 0 10
0 0 0 0
0 10 0 10
Ke1
TTKT
8/13/2019 Ch 4 Truss Analysis 2013
14/22
14
Step 5. Assemble all stiffness matrices into the structure stiffness matrix K.
The two Ke matrices cannot be added as they are given. For a system with 6 Degrees of
Freedom, the final Global Stiffness Matrix must be 6 x 6. However, the two Ke matrices
are 4 x 4, and adding them will obtain a 4 x 4. Since each row and column represents adegree of freedom, we must place the rows and columns of the Ke matrices into the
correct corresponding rows of the 6 x 6 Global Stiffness Matrix.1 2 3 4 1 2 5 6
The numbers beside and above each row and column represent the degrees of freedom
which the element contains. From the diagram, the ends of Element 1 are represented by
DOF 1, 2 and 3,4 respectively. Element 2 connects DOFs 1, 2 and 5,6. Now we willinsert the corresponding rows and columns into the 6 x 6Kmatrix.
1 2 3 4 5 6
The numbers from each matrix are inserted into the corresponding rows and columns.
Where the two matrices overlap ( i.e. 1, 1 1, 2 2, 1 2, 2 ) the numbers are added
together. For all other inputs, the numbers are inserted as normal. Also, there are emptyspaces in rows 3, 4, 5, and 6. These empty spaces are filled with zeros to make the final
Kmatrix:
Ke1
1
2
3
4
2. 16 2. 88 2. 16 2. 88
2. 88 3. 84 2. 88 3. 84
2. 16 2. 88 2. 16 2. 88
2. 88 3. 84 2. 88 3. 84
8/13/2019 Ch 4 Truss Analysis 2013
15/22
15
EXAMPLE 4.3 Calculating the element forces
In this example we will use the stiffness matrix that we derived in Example 4.2 to solvefor 1) the displacement vector d, 2) the reactions, and 3) the element forces for the truss if
a 20 and a 10 kip load are applied as shown.
E = 120 ksiA1= 3 in
2
A2= 4 in2
k1= 6 k/ink2= 10 k/in
1) Set up the stiffness equation: Kd=Ffor the truss
2) Reduce this matrix and solve for displacements
F
2010
F3
F4
F5
F6
2.16
2.88
2. 16 2. 88 0 02. 88 13. 84 2. 88 3. 84 0 10
2. 16 2. 88 2. 16 2. 88 0 0
2.88 3.84 2. 88 3. 84 0 0
0 0 0 0 0 0
0 10 0 0 0 10
d1d2
0
0
0
0
F
20
10
F3
F4
F5
F6
2.16 2.88 2. 16 2. 88 0 0
2. 88 13. 84 2. 88 3. 84 0 10
2. 16 2. 88 2. 16 2. 88 0 0
2.88 3.84 2. 88 3. 84 0 0
0 0 0 0 0 0
0 10 0 0 0 10
d1
d2
0
0
0
0
8/13/2019 Ch 4 Truss Analysis 2013
16/22
16
3) Now that all the displacements are known, we can solve for the forces using thepart of the matrix that multiplies the known displacements.
4) Use the global displacements to solve for the internal forces of each member.
As determined previously: {f '} = [K' T]{d}
For Element 1:
For Element 2:
20
10
2.16 2.88
2. 88 13. 84
d1
d2
1
K
T
d1
d2
d3
d4
6 6
6 6
0.6 0.8 0 0
0 0 0.6 0.8
11.48
1.67
0
0
33. 312
33. 312
2
KT
d1
d2
d5
d6
10 10
10 10
0 1 0 0
0 0 0 1
11.48
1.67
0
0
16. 7
16. 7
d1
d2
.11.48
1.67
8/13/2019 Ch 4 Truss Analysis 2013
17/22
17
5) Analyze your results
8/13/2019 Ch 4 Truss Analysis 2013
18/22
8/13/2019 Ch 4 Truss Analysis 2013
19/22
19
If you want to START your algorithm, this homework will help. You could start with the
following:
FLOW CHART
Input Node Information in an m-file (PLEASE do NOT use Excel). The node information should
look approximately like this:
NODE X-Coordinate (ft) Y-Coordinate (ft)
1 16 12
2 12 2
3 0 0
4 24 2
Input Element Information approximately like this:
Element Connectivity* Area (in^2) E(psi)
1 1 3 5 1.8E6
2 1 2 2 1.8E6
3 1 4 5 1.8E6
4 etc 3 1.8E6
5 3 1.8E6*For example, Element 1 connects Node 1 to Node3
Input the element stiffness matrix in local coordinates as:
K= k(i) [1 -1;-1 1];
Create a MATLAB algorithm that reads this information and calculates the following:
Node vs DOF
Node 1 is associated with DOF 1 and 2Node 2 is associated with DOF 3 and 4.
Node x is associated with DOF (2*x-1) and 2*x.
(NOTE here that I came up with an association between the NODE number and the DOF. I expect you to
come up with such associations in your algorithm writing.)
Coordinates vs Element Length, sin cos
Here, take the geometry input and program MATLAB to calculate the length of each element and
the, sin cos of each element. ( You never need to calculate the actual angle
Use the calculated information to define T, of each element, use MATLAB to calculate
Ke for each element.
The element stiffness matrix in global coordinates, Ke, for each element is TTKT.
Program MATLAB to calculate the element stiffness matrix in global coordinates.
------Output these calculations for each element.
8/13/2019 Ch 4 Truss Analysis 2013
20/22
20
------Assemble your global stiffness matrix BY HAND.
------Separate this matrix BY HAND.
Input back into MATLAB and solve for displacements, reactions and internal forces
-----Solve your truss by structural analysis methods (equilibrium of nodes) and CHECK youranswers with the computer answers.
The next steps (which constitute your PROJECT) are as follows:
1)AUTOMATE this algorithm to solve for ANY truss, given the geometry
2)program MATLAB to assemble your stiffness matrix,
3)program MATLAB to solve for displacement, reactions and internal forces.
8/13/2019 Ch 4 Truss Analysis 2013
21/22
21
Modeling and Simulation PROJECT 1
Create a subroutine that can solve for the reactions, displacements and internal forces of
an arbitrary truss. The steps that you need to follow are given in the flowchart:
Create an input system for input of nodes,member information, and forces.
Generate element information (length, angle...)Calculate stiffness of each element.
Create transformation matrices and get elementstiffness matrices. Assemble these matrices into a
global stiffness matrix for the structure.
Solve for the global displacements by partitioning andsolving the global stiffness matrix given the input forces.
Solve for the reactions in the trussusing the now known displacements.
Calculate local displacements and use to calculatereactions and member forces. Label member forces asTension (T) or Compression (C). Check your work using
conventional analyses.
8/13/2019 Ch 4 Truss Analysis 2013
22/22
22
The input and the algorithm should be separate from your algorithm (however,not necessarily separate files. I would prefer that all your input is part of your
MATLAB file)
Your algorithm should be able to calculate everything you will need (ex. Lengths,sine/cosines, element stiffness matrices, global stiffness matrix, reactions, element
forces) using the input information.Do not calculate anything by hand.
Please write your own algorithm. Your TA and I will guide and help you.You may discuss with your classmates and help each other understand concepts butyou
may NOT share lines of your code.VIOLATION OF THIS WILL CONSTITUTE
VIOLATION OF THE STEVENS HONOR CODE.
You may use all information available to you to understand MATLAB and programmingbut you may NOT copy code from other sources such as books or the internet. You will
have to create your own and be prepared to explain all lines of your code.
For your MIDTERM, please bring your computer with your code. I will draw a randomtruss on the board. You will input the information into your computer and solve for forces
on the truss members. Please have some way of differentiating in your final answerwhich of the elements are in Tensionand which in Compression.
HINT: Do not write all code at once. Write line-by-line, check to see if what you are
writing is correct and THEN move to the next line/part of the code.