Professional Documents
Culture Documents
FUNDAMENTAL CONSEQUENCE
Each member in a truss is a two-force member
(we already know the direction of all internal forces)
3 unknowns - 3 equations
YES
4 unknowns - 3 equations
NO
The answer depends on the nature of the external constraints (exactly the same
as for a continuous rigid body)
3
n = number of nodes
MAXWELLS RULE
If a truss is statically determinate, then 2n= m+3 (in 2D)
m = number of members
4
2n = 2 X 4 = 8
2n = 2 X 4 = 8
m+3=5+3=8
m+3=6+3=9
2n = m+3
2n < m+3
Quiz #1
Is the following truss statically determinate?
(A) Yes
(B) No
This method shares many common principles with Finite Elements Analysis; the extension from
trusses to continuum solids only require an alternative definition of the element stiffness.
9
PL
EA
EA
( q '- q1 ')
L 2
EA
F1 ' = - F2 ' =
( q '- q2 ')
L 1
F2 ' =
F1 ' EA 1 -1 q1 '
=
L
F
'
-1
1
q2 '
2
EA 1 -1
k ' =
L -1 1
10
F2 ' L -1 1 q2 '
Y
X
x = local element-based coordinate system
(X,Y) = global truss-based coordinate system
Nodal Displacements
q1 ' = q1 cosq + q2 sin q
q2 ' = q3 cosq + q4 sin q
q1
Nodal Forces
F1 = F1 'cos q
F2 = F1 'sin q
F3 = F2 'cosq
F4 = F2 'sin q
F1
cosq
F2 sin q
=
F3 0
F 0
4
0
0
cosq
sinq
F '
1
F2 '
11
0
0
cosq
sinq
F '
1
F2 '
F1 ' EA 1 -1 q1 '
=
F2 ' L -1 1 q2 '
F1
cosq
F2 sin q
=
F3 0
F 0
4
0
0
cosq
sinq
EA 1 -1 cosq
L -1 1 0
q1 ' cosq
=
q2 ' 0
sinq
0
0
cosq
sin q
0
sin q
0
cosq
q1
0 q2
sinq q3
q
4
q1
q2
q3
q4
k = L k ' L
Force-displacement relationship for a truss element in global coordinate system in 2D:
{ F } = k {q}
12
cos 2 q
EA sinq cosq
k =
L - cos 2 q
- sinq cosq
sin q cosq
sin 2 q
- sinq cosq
- sin 2 q
- cos 2 q
- sinq cosq
cos 2 q
sin q cosq
- sin q cosq
- sin 2 q
sinq cosq
sin 2 q
Geometric formulas for the calculation of sines and cosines as a function of the nodal coordinates
13
1
EA
K = k =
L
EA
=
2L
1/ 2 1/ 2 -1/ 2 -1/ 2
1/ 2 1/ 2 -1/ 2 -1/ 2
-1/ 2 -1/ 2 1/ 2 1/ 2
-1/ 2 -1/ 2 1/ 2 1/ 2
1 1 -1 -1
1 1 -1 -1
-1 -1 1 1
-1 -1 1 1
Q1 = Q2 = Q4 = 0
The load boundary conditions are:
F3 = F
14
EA
2L
1 1 -1 -1 0 R1
1 1 -1 -1 0 = R2
-1 -1 1 1 Q3 F
-1 -1 1 1 0 R4
where Ri are the unknown reaction forces and Q3 is the unknown displacement.
This easy problem can be conveniently solved in two steps:
(1) Eliminate the rows and columns of [K] corresponding to the degrees of freedom for which the
displacement is prescribed (1,2,4) and solve for the remaining displacements.
EA
2L
1 1 -1 -1 0
1 1 -1 -1 0 =
-1 -1 1 1 Q3
-1 -1 1 1 0
R1
R2
F
R4
EA
2LF
Q3 = F Q3 =
2L
EA
15
EA
Q = R1 R1 = - F
2L 3
Row 2:
EA
Q = R2 R2 = - F
2L 3
Row3:
EA
Q = R4 R4 = F
2L 3
EA
2L
1 1 -1 -1 0
1 1 -1 -1 0 =
-1 -1 1 1 Q3
-1 -1 1 1 0
R1
R2
F
R4
16
5.
6.
7.
8.
a =1m
E = 200 GPa (steel)
9.
17
{Q} =
Q1
Q2
Q3
Q4
Q5
Q6
Q7
Q8
Connectivity matrix
Element, e
Node 1
Node 2
3
18
1
EA
k =
a
1
0
-1
0
2
EA
k =
a
0 0
0 1
0 0
0 -1
3
EA
k =
a
1
0
-1
0
4
EA
k =
a
0 0
0 1
0 0
0 -1
3
EA
k =
2 2a
0 -1 0
0 0 0
0 1 0
0 0 0
0 0
0 -1
0 0
0 1
0 -1 0
0 0 0
0 1 0
0 0 0
0 0
0 -1
0 0
0 1
1 1 -1 -1
1 1 -1 -1
-1 -1 1 1
-1 -1 1 1
q = 0o
q = 90o
q = 180o
q = 270o
q = 45o
Element, e
Node 1
Node 2
19
1
EA
k =
a
1
0
-1
0
0 -1 0 1
0 0 0 2
0 1 0 3
0 0 0 4
Global DOFs
Element, e
Node 1
Node 2
EA/a
-EA/a
-EA/a
EA/a
4
5
6
7
8
1
20
2
EA
k =
a
0 0
0 1
0 0
0 -1
0 0 3
0 -1 4
0 0 5
0 1 6
Global DOFs
Element, e
Node 1
Node 2
1
2
0
EA/a
-EA/a
-EA/a
EA/a
7
8
1
21
3
EA
k =
a
1
0
-1
0
0 -1 0 5
0 0 0 6
0 1 0 7
0 0 0 8
Global DOFs
Element, e
Node 1
Node 2
1
2
3
4
EA/a
-EA/a
-EA/a
EA/a
22
4
EA
k =
a
0 0
0 1
0 0
0 -1
0 0 7
0 -1 8
0 0 1
0 1 2
Global DOFs
Element, e
Node 1
Node 2
EA/a
-EA/a
2
3
4
5
6
-EA/a
EA/a
23
3
EA
k =
2 2a
1 1 -1 -1 1
1 1 -1 -1 2
-1 -1 1 1 5
-1 -1 1 1 6
Global DOFs
Element, e
Node 1
Node 2
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
1
2
3
4
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
EA/2V2
a
5
6
7
8
24
1+1/ 2 2
1/ 2 2
1/ 2 2
1+1/ 2 2
-1
-1
-1/ 2 2
-1/ 2 2
-1/ 2 2
-1/ 2 2
1
-1
3
-1
EA
K =
a
-1/ 2 2
-1/ 2 2
-1/ 2 2
-1/ 2 2
-1
1+1/ 2 2
1/ 2 2
1/ 2 2
1+1/ 2 2
-1
4
-1
5
6
-1
7
1
8
25
108
28
-80
-28
-28
28
108
-28
-28
-80
-80
80
80
-80
-28
108
28
-80
-28
-28
-80
28
108
-80
80
-80
80
K =
-28
106 N/m
26
Q1 = Q2 = Q4 = 0
F6 = - F
F7 = F
27
28
108
0
0
-28
-28
0
-80
-80 0
80
0
0
0
0
0
0
0
0
80
0
-80
0
0
6
10
-28
-28
0
0
108
28
-80
0
0
0
0
0
-80
0
80
0
0 -80 0
0
0
0
0
80
0
0
Q3
0
Q5
Q6
Q7
Q8
R1
R2
0
R4
0
-F
F
0
28
28
108
0
0
-28
-28
0
-80
-80 0
80
0
0
0
0
0
0
0
0
80
0
-80
0
0
6
10
-28
-28
0
0
108
28
-80
0
0
0
0
0
-80
0
80
0
0 -80 0
0
0
0
0
80
106
80 0
0
0
0
0 108 28 -80 0
0 28 108 0
0
0 -80 0
80 0
0
0
0
0 80
0
0
Q3
0
Q5
Q6
Q7
Q8
Q3
Q5
0
Q6 = -10,000
Q7 10,000
0
Q8
R1
R2
0
R4
0
-F
F
0
29
106
80 0
0
0
0
0 108 28 -80 0
0 28 108 0
0
0 -80 0
80 0
0
0
0
0 80
Q3
Q5
0
Q6 = -10,000
Q7 10,000
0
Q8
Q3 = 0 mm
Q5 = 0.6 mm
Q6 = -0.25 mm
Q = 0.73 mm
7
Q8 = 0 mm
30
6
10
R1
0
108 28 -80 0 -28 -28 0
0
R2
0
28 108 0
0 -28 -28 0 -80
0
0
-80 0
80
0
0
0
0
0
0
R4
0
0
0
80
0 -80 0
0
-28 -28 0
0 108 28 -80 0 0.0006
0
-28 -28 0 -80 28 108 0
0 -0.00025 -10,000
0
0
0
0 -80 0
80
0 0.00073 10,000
0 -80 0
0
0
0
0
80
0
R1 = -10 kN
R2 = -10 kN
R = 20 kN
4
31
s e = E ee e =
Ee
e
q'
=
L
q2 '
( q2 '- q1 ') =
q'
Ee
1
-1
1
e
q2 '
q1
q2
q3
q4
se =
Ee
- cosq
e
q2 '- q1 '
T e = Aes e
- sin q
cosq
sin q
q1
q2
q3
q4
32
q1
q2
=
q3
q4
Q1
Q2
0
=
m
Q5 0.00061
Q6 -0.00025
q 5 = 45o
cosq = sinq = 2 / 2
Global
200 10
6
s5 =
-1/
2
-1/
2
1/
2
1/
2
0.00061 = 36 10 Pa = 36 MPa
2
-0.00025
9
Similarly, we obtain:
Element, e
Node 1
Node 2
s 1 = 0 MPa
2
s = -50 MPa
3
s = -25 MPa
s 4 = 0 MPa
T 1 = 0 kN
2
T = 20 kN
3
T = -10 kN
T 4 = 0 kN
33
34
35
Function InputData
Reads the input file and stores all values
function [] = InputData()
global NN NE NM NDIM NEN NDN
global ND NL NCH NPR NBW
global X NOC F AREA MAT S
global PM NU U STRESS REACT
global CNST
global TITLE FILE1 FILE2
global LINP LOUT
global NQ
global SF
FILE1 = input('Input Data File Name ','s');
LINP = fopen(FILE1,'r');
FILE2 = input('Output Data File Name ','s');
LOUT = fopen(FILE2,'w');
DUMMY = fgets(LINP);
TITLE = fgets(LINP);
DUMMY = fgets(LINP);
TMP = str2num(fgets(LINP));
[NN, NE, NM, NDIM, NEN, NDN] =
deal(TMP(1),TMP(2),TMP(3),TMP(4),TMP(5),TMP(6));
NQ = NDN * NN;
DUMMY = fgets(LINP);
TMP = str2num(fgets(LINP));
[ND, NL]= deal(TMP(1),TMP(2));
NPR=1; % E (Young's modulus)
%----- Coordinates ----DUMMY = fgets(LINP);
for I=1:NN
TMP = str2num(fgets(LINP));
[N, X(N,:)]=deal(TMP(1),TMP(2:1+NDIM));
end
fclose(LINP);
36
InputData
x
1
X =
1
1 2
2
3
NOC = 3 4
4
1
1 3
1
Material
MAT = 1
1
PM(1) = 200 E9 1
0
1
Line = Node #
Local
Node 2
Local
Node 1
Connectivity matrix
Line = Element #
0.0004
0.0004
AREA = 0.0004
Cross-section
0.0004
0.0004
Line = Element #
37
InputData
Displacement boundary conditions
1
NU = 2
4
0
U = 0
0
Applied Loads
F =
0
-10000
10000
38
Function Stiffness
Assemble stiffness matrix for each element
%----- First initialize stiffness matrix
S = zeros(NQ,NQ);
I1 = 3
I2 = 4
I3 = 1
Node 1
Node 2
Material
1
X =
1
0
1
1 2
2
3
NOC = 3 4
4 1
1 3
80E6
0
SE =
-80E6
0 -80E6 0
0
0
0
0 80E6 0
0
0
0
39
Function Stiffness
Assemble the global stiffness matrix
1
80E6
0
SE =
-80E6
globX1=NOC(N,1)*2-1;
globY1=NOC(N,1)*2;
globX2=NOC(N,2)*2-1;
globY2=NOC(N,2)*2;
I1 = 3
I2 = 4
Node 1
Node 2
globX1 = 5
globY1 = 6
globX2 = 7
globY2 = 8
S =
-
-
-
- 80E6 0 -80E6 0
0
0
0
0
- -80E6 0 80E6 0
0
0
0
0
- - -
0 -80E6 0
2
3
0
0
0 NOC =
3 4
0 80E6 0
4 1
0
0
0
1 3
40
Function ModifyForBC
Impose displacement BCs with the penalty method
Removing lines and columns is easy to do by hand, but rather cumbersome computationally.
Changing a matrix (or a vector) dimension within a program is never an advisable operation.
The Penalty Method is a very convenient alternative that provides an approximate solution
S11
S41 S42
S81
S43
S44 + C S45
S46
S47
S18 Q1 F1
S48 Q4 F4 + Ca4
=
S88 Q8 F8
S41Q1 + S42Q2 + S43Q3 + (S44 + C)Q4 + S45Q5 + S46Q6 + S47Q7 + S48Q8 = F4 + Ca4
Divide by C:
S41
S
S
S
S
S
S
S
F
Q1 + 42 Q2 + 43 Q3 + ( 44 +1)Q4 + 45 Q5 + 46 Q6 + 47 Q7 + 48 Q8 = 4 + a4
C
C
C
C
C
C
C
C
C
If C is much larger than any Sij and Fj, this is approximately equivalent to:
which is the BC we want to impose.
Q4 = a4
Hence all I need to do to enforce a displacement BC to dof N is add to the diagonal stiffness term SNN a
large number C; if the prescribed displacement is different from 0, I will also need to add the term C.aN
to the force term FN. Typically C is chosen as 10,000 times the largest value of Sij
41
Function ModifyForBC
Impose displacement BCs with the penalty method
This is trivially implemented in the MATLAB code
%----- Modify for Boundary Conditions ----% --- Displacement BC --for I = 1:ND
N = NU(I);
S(N,N) = S(N,N) + CNST;
F(N) = F(N) + CNST * U(I);
end
1
NU = 2
4
0
U = 0
0
Function Solver
Solve the matrix equation for Q using Gauss elimination
MATLAB has a built-in solver that uses the Gauss elimination.
This function is simply:
function []=Solver()
%--------Gauss Elimination and Back Substitution via the MATLAB \ function-------Q = S\F;
F = Q; %the displacements are renamed F to avoid introducing one more variable
43
Function StressCalc
Calculate the stress in each member
for I = 1:NE
I1 = NOC(I, 1);
I2 = NOC(I, 2);
I3 = MAT(I);
X21 = X(I2, 1) - X(I1, 1);
Y21 = X(I2, 2) - X(I1, 2);
EL = sqrt(X21 * X21 + Y21 * Y21);
CS = X21 / EL;
SN = Y21 / EL;
J2 = 2 * I1;
J1 = J2 - 1;
K2 = 2 * I2;
K1 = K2 - 1;
DLT = (F(K1) - F(J1)) * CS +
+ (F(K2) - F(J2)) * SN;
STRESS(I) = PM(I3, 1) * (DLT / EL);
end
1
X =
1
I2 = 4
I3 = 1
Node 1
Node 2
Material
0
1
1 2
2 3
NOC = 3 4
4
1
1 3
44
Function ReactionCalc
Calculate the external reaction forces
1
NU = 2
4
S41 S42
S81
S43
S44 + C S45
S46
S47
0
U = 0
0
S18 Q1 F1
S48 Q4 F4 + Ca4
=
S88 Q8 F8
S41Q1 + S42Q2 + S43Q3 + (S44 + C)Q4 + S45Q5 + S46Q6 + S47Q7 + S48Q8 = F4 + Ca4
which can be solved for F4:
F4 = Ca4 - ( S41Q1 + S42Q2 + S43Q3 + (S44 + C)Q4 + S45Q5 + S46Q6 + S47Q7 + S48Q8 ) =
Ca4 - CQ4 = C ( a4 - Q4 )
45
Y-Displ
9.2350E-09
-1.8470E-08
-2.5002E-04
9.2350E-09
46