You are on page 1of 22

1


CHAPTER 4. MATRIX METHODS FOR PLANE TRUSSES
Written 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 / A
2) strain-displacements: = / L
3) 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 of
the bar given an applied force P. Therefore, stiffness of the axial member is defined as
AE/L.

2

k
1

A
1
E
1
L
1

3 i n
2
1 2 0 k s i
5 f t 1 2 i n / ft
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, A
1
=3 in
2
,
and A
2
=4 in
2
. The lengths are shown in the figure.





Note: sin q = 3/5 = 0.6
cos q = 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 unit
displacement 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 did
not change because we assume small deformations.



k
2

A
2
E
2
L
2

4 i n
2
1 2 0 k s i
4 f t 1 2 i n / ft
1 0
kip
in
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:





K
11
=3.6 sin =3.60.6=2.16

21
=3.6 cos =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 stresses
have been induced. Therefore, K
51
=0 and K
61
=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
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 , which
translates to a compressive force of 6*4/5=4.8 k, while it takes a force of 10k to displace
member 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: K
12
= -
2.88, K
22
=3.84, K
32
=2.88 and K
42
= -3.84. Equilibrium of member 2 shows that it adds
the following to the stiffness matrix: K
12
=0, K
22
=10, K
52
=0 and K
62
=-10. The total
coefficients of the stiffness matrix are the addition of the participation of each member.
As such,


5
K
12
= 0 + (-2.88) = -2.88 k
K
22
= 10 + 3.84 = 13.84 k
K
32
= 0 + 2.88 = 2.88 k
K
42
= 0 + -3.84 = -3.84 k
K
52
= 0 + 0 = 0 k
K
62
= -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
10 0 0 0 10 0
0 0 0 0 0 0
0 0 84 . 3 8 . 2 84 . 3 88 . 2
0 0 8 . 2 16 . 2 88 . 2 16 . 2
10 0 84 . 3 88 . 2 84 . 13 88 . 2
0 0 88 . 2 16 . 2 84 . 2 16 . 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
6
)
`

=
)
`

50
100
2
1
84 . 13 88 . 2
88 . 2 16 . 2
x
x

from where, x1=70.7 and x2=18.3. Substitute these into the second set of equations and
solve for the unknown forces:

=
)
`

(
(
(
(

6
5
4
3
2
1
10 0
0 0
84 . 3 88 . 2
88 . 2 16 . 2
F
F
F
F
x
x
from 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 then
transformed 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.


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 the
global coordinate system
3. 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 program
5. PROJ ECT 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 the
longitudinal axis of the member. For a consistent notation, we will associate the axes x
to be directed from node i to node j of the element where i<j. The angle is defined
from X to x.

If K is the stiffness matrix for the entire structure, d is a vector of displacements in the
Global Coordinate System and f is a vector of forces in the Global Coordinate System,
the relationship between stiffness, displacements and forces in a linear structure is:
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 K
11
and K
21
. Next, we apply a unit displacement at node 2 while we fix node
1. Thus we calculate K
22
and K
12


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 the
entire structure. Each element contributes to the stiffness of the entire structure.
K


AE
L
1 1
1 1
9

d'
1

d 1
d
1

d
1

d 2
d
1

d
2
The Transformation Matrix

We will use 1) compatibility of displacements and 2) equilibrium of forces to derive the
transformation matrix.




1) Compatibility of displacements requires that:


divide by d'
1
:


Note that d
1
/d
1
=cos and d
2
/d
1
=sin . Then,




Similarly:




In matrix form:




or, d' = T d ; where T is the Transformation Matrix, and d is a vector of global
displacements.

d
1

d
1
cos d
2
sin
d
1


2
d
1

2
d
2

2
d
2

d
3
cos d
4
sin
d
1

d
2


cos sin 0 0
0 0 cos sin
d
1
d
2
d
3
d
4
10
2) Equilibrium of forces requires that:
f
1
=f
1
'cos
f
2
=f
1
'sin
f
3
=f
2
'cos
f
4
=f
2
'sin

In matrix notation,
)
`

(
(
(
(

2
1
4
3
2
1
'
'
sin 0
cos 0
0 sin
0 cos
f
f
f
f
f
f



or, f = T
T
f' , where T
T
is the transpose of transformation matrix T, and f is 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 by T
T


T
T
K' T d = T
T
f' ; Substitute f = T
T
f'

[T
T
K' T] d = f


Thus we obtain the stiffness matrix of Element 1 in global coordinates as
K
e
1
=T
T
K' T

Each element in the structure has its own K and its own K
e
i
. We need to assemble all
the Kes into a global matrix K for the structure.

The final Global Stiffness Matrix is the sum of each element stiffness matrix.

#of elements








K K
e
i
i1
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 A and B to obtain matrix C. In this example,
you are assembling two 4x4 matrices into one 6x6 matrix. The subroutine should be
general and work with any size C and any number of stiffness matrices.

A= ; B=


C=


Which gives a C of:

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.


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, A
1
=3 in
2
,

A
2
=4 in
2
, from which, k
1
=6 k/in, k
2
=10 k/in.

First, we set up the global x-y axes, label all degrees of freedom from 1 to 6, and choose
the local xy axes of the elements going from node i to node j.

Step 2: Find the transformation matrix of each element.

To find K
e
1
, note that
1
, the angle between x and x
1
, is 126.9
o
. Thus cos = 0.6 and
sin =0.8. For compatibility of displacements,









Thus the transformation matrix T is:

d
1

d
2


cos sin 0 0
0 0 cos sin
d
1
d
2
d
3
d
4
T
0.6 0.8 0 0
0 0 0.6 0.8
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, K
e
2
, in global coordinates, we start
again from the transformation matrix. Note that
2
, the angle between x and x
2
is 90.
Thus cos = 0 and sin =1.















K


AE
L
1 1
1 1
6
1 1
1 1
K
e
1

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


AE
L
1 1
1 1
10
1 1
1 1

10 10
10 10
K
e
2

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
K
e
1
T
T
K

T
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 a
degree 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 will
insert the corresponding rows and columns into the 6 x 6 K matrix.

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 empty
spaces in rows 3, 4, 5, and 6. These empty spaces are filled with zeros to make the final
K matrix:

K
e
1

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
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 solve
for 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 ksi
A
1
=3 in
2

A
2
=4 in
2

k
1
=6 k/in
k
2
=10 k/in











1) Set up the stiffness equation: Kd=F for the truss











2) Reduce this matrix and solve for displacements








F
20
10
F
3
F
4
F
5
F
6

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
d
1
d
2
0
0
0
0
F
20
10
F
3
F
4
F
5
F
6

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
d
1
d
2
0
0
0
0
16







3) Now that all the displacements are known, we can solve for the forces using the
part 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
d
1
d
2
f
1

T
d
1
d
2
d
3
d
4

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
f
2

T
d
1
d
2
d
5
d
6

10 10
10 10
0 1 0 0
0 0 0 1
11.48
1.67
0
0

16. 7
16. 7

d
1
d
2

.
11.48
1 . 6 7
17
5) Analyze your results




18
Homework 9

Use matrix methods to solve for the truss below (i.e. Repeat Example 4.2 and 4.3 for the truss
given below.) The area and length of each member are shown in the figure. Use a modulus
E=1.8E6psi

You may solve this homework without the help of MATLAB or you may use MATLAB
whenever you need it (for example to multiply matrices.)

1. Calculate the element stiffness matrices K
e
i

2. Assemble to a global stiffness matrix (by hand)
3. Use the global stiffness matrix to solve for displacements, reactions and internal forces
4. Check your answers (Reactions and internal forces) by solving the truss by traditional
methods (equilibrium of nodes)


DO NOT TURN IN THIS HOMEWORK UNLESS IT IS CORRECT.
ASK FOR HELP IF YOU NEED. I would be more than happy to help you through with this,
step-by-step.



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 2
Node 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 T
T
K

T.
Program MATLAB to calculate the element stiffness matrix in global coordinates.

------Output these calculations for each element.
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 your
answers 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.

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 element
stiffness matrices. Assemble these matrices into a
global stiffness matrix for the structure.

Solve for the global displacements by partitioning and
solving the global stiffness matrix given the input forces.
Solve for the reactions in the truss
using the now known displacements.
Calculate local displacements and use to calculate
reactions and member forces. Label member forces as
Tension (T) or Compression (C). Check your work using
conventional analyses.

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 but you
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 programming
but 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 random
truss 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 answer
which of the elements are in Tension and 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.

You might also like