truss lecture (1) - mechanics of materials
TRANSCRIPT
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
1/46
Finite Elements Analysis of Trusses
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
2/46
Trusses Review of Statics
2
DEFINITION OF A TRUSS
A truss is an assembly of bars (in 2D or 3D) with the following properties:
All members are connected by pin joints (no moment transfer) No member is continuous through a node
The external forces are only applied to the nodes (never on the members) The external constraints are only applied at the nodes
No moment is applied to the structure
FUNDAMENTAL CONSEQUENCE
Each member in a truss is a two- force member
(we already know the direction of all internal forces)
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
3/46
Externally determinate trusses
3
QUESTION 1 Can we calculate all the external forces using equilibrium alone?
3 unknowns - 3 equationsYES
4 unknowns - 3 equationsNO
The answer depends on the nature of the external constraints (exactly the sameas for a continuous rigid body)
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
4/46
Statically determinate trusses
4
QUESTION 2 Can we calculate all the internal forces using equilibrium alone?
A TRUSS is STATICALLY DETERMINATE if # of equations = # of unknowns
# of equations = # of equilibrium conditions we can impose
= (# of nodes) X (# of equations per node)
= 2n (in 2 dimensions)
# of unknowns = (# of internal forces) + (# of external reactions)
= m+3 (in 2 dimensions)
n = number of nodes
m = number of membersMAXWELL
S RULE
If a truss is statically determinate, then 2n= m+3 (in 2D)
# of equations = # of unknowns 2n = m+3 (in 2D)
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
5/46
5
Maxwell
s rule for static determinacy
2n = 2 X 4 = 8
m + 3 = 5 + 3 = 8
MAXWELL
S RULE
If a truss is statically determinate, then 2n=m+3 (in 2D)
2n = m+3
2n = 2 X 4 = 8
m + 3 = 6 + 3 = 9
2n < m+3
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
6/46
Quiz #1
6
Is the following truss statically determinate?
(A) Yes (B) No
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
7/46
Statically determinate trussesSolution by method of joints
7
Dismember the truss and create a freebody
diagram for each member and pin.
The two forces exerted on each member areequal, have the same line of action, andopposite sense.
Forces exerted by a member on the pins or joints at its ends are directed along the memberand equal and opposite.
Conditions of equilibrium on the pins provide 2 n equations for 2 n unknowns. For a simple truss,2n = m + 3. May solve for m member forcesand 3 reaction forces at the supports.
Conditions for equilibrium for the entire trussprovide 3 additional equations which are not
independent of the pin equations.
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
8/46
8
Statically determinate trussesSolutions by the method of sections
When the force in only one member or the
forces in a very few members are desired, themethod of sections works well.
To determine the force in member BD, pass asection through the truss as shown andcreate a free body diagram for the left side.
With only three members cut by the section,the equations for static equilibrium may beapplied to determine the unknown memberforces, including F BD.
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
9/46
How can we solve statically indeterminate trusses?
9
OUTLINE OF THE SOLUTION PROCEDURE FOR THE STIFFNESS METHOD
1. Analyze the deformation of one element in a local 1D coordinate system. Deriveits stiffness.
2. Express the stiffness of each element in a common (global) coordinate system.
3. Assemble the stiffness of each element to derive the overall stiffness of the truss(i.e., the relationship between applied external loads and nodal displacements).
4. Account for boundary conditions and apply loads.
5. By linear algebra procedures, calculate the displacement of each node.
6. Solve for the reaction forces at the nodes where displacement BCs are specified.
7. Solve for internal forces (and hence stresses) in each element.
This method shares many common principles with Finite Elements Analysis; the extension fromtrusses to continuum solids only require an alternative definition of the element stiffness.
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
10/46
Stiffness of a single truss element in local CS
10
= PL EA
F 2 ' = EA L
q2 ' q1 '( )
F 1 ' = F 2 ' = EA L
q1 ' q2 '( )
x = local element-based coordinate system
We can combine these two equations in:
F 1 '
F 2 '
=
EA L
1 1 1 1
q1 '
q2 '
F '{ }= k ' q '{ }
or alternatively:
k ' = EA L
1 1 1 1
Stiffness matrix for a truss member in local coordinates
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
11/46
Stiffness of a single truss element in global CS
11
Nodal Displacements
q1' = q
1cos + q
2sin
q2 ' = q3 cos + q4 sin
q1 '
q2 '
=
cos sin 0 00 0 cos sin
q1q2q3
q4
Transformation matrix [L]
x
= local element-based coordinate system(X,Y) = global truss-based coordinate system
Nodal Forces
F 1 = F 1 'cos
F 2 = F 1 'sin
F 3 = F 2 'cos
F 4 = F 2 'sin
F 1
F 2 F 3 F 4
=
cos 0sin 0
0 cos 0 sin
F 1 ' F 2 '
[L]T = Transpose of [L]
F 1 '
F 2 '
= EA L
1 1
1 1
q1 '
q2 '
X
Y
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
12/46
Stiffness of a single truss element in global CS
12
F 1 F 2 F 3 F 4
=
cos 0sin 0
0 cos 0 sin
EA L
1 1 1 1
cos
sin 0 00 0 cos sin
q1q2q3q4
I am now ready to express the stiffness of the truss element in global coordinates
q1 '
q2 '
=
cos sin 0 00 0 cos sin
q1q2q3q4
F 1 F 2 F 3 F 4
=
cos 0sin 0
0 cos 0 sin
F 1 '
F 2 '
F 1 '
F 2 '
=
EA L
1 1 1 1
q1 '
q2 '
Stiffness matrix of truss element in global CS, [k]
k = L T
k ' L
Force-displacement relationship for a truss element in global coordinate system in 2D: F { }= k q{ }
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
13/46
Stiffness of a single truss element in global CS
13
By performing the matrix multiplication, I finally find an explicit expression for [k]
k = EA L
cos 2 sin cos cos 2 sin cos
sin cos sin 2 sin cos sin 2
cos 2 sin cos cos 2 sin cos
sin cos sin2
sin cos sin2
Geometric formulas for the calculation of sines and cosines as a function of the nodal coordinates
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
14/46
Example Analysis of a 1-element truss
14
This single element truss has four globaldegrees of freedom: Q 1, Q 2, Q 3, Q 4.
Because there is only one element, theglobal degrees of freedom correspond to thedegrees of freedom of element e = 1, that is:
Q1 = q 1, Q 2 = q 2, Q 3 = q 3, Q 4 = q 4
I want to calculate:(i) The nodal displacements Q
i
(ii) The reaction forces at the constraints.
K =
k 1
= EA L
1/ 2 1/ 2 1/ 2 1/ 21/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2
= EA2 L
1 1 1 11 1 1 1 1 1 1 1
1 1 1 1
The stiffness matrix for the truss is: The displacement boundary conditions are:
Q1 = Q2 = Q4 = 0
The load boundary conditions are:
F 3 = F
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
15/46
Example Analysis of a 1-element truss
15
EA2 L
1 1 1 11 1 1 1 1 1 1 1 1 1 1 1
00
Q30
=
R1 R2 F R4
The governing equation {F}=[K]{Q} then becomes:
where R i are the unknown reaction forces and Q 3 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 thedisplacement is prescribed (1,2,4) and solve for the remaining displacements.
EA2 L
1 1 1 11 1 1 1 1 1 1 1 1 1 1 1
00
Q30
=
R1 R2 F R4
EA2 L
Q3 = F Q3 =2 LF EA
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
16/46
Example Analysis of a 1-element truss
16
EA2 L
1 1 1 11 1 1 1 1 1 1 1 1 1 1 1
00
Q30
=
R1 R2 F R4
(2) Now that {Q} is fully known, solve for theunknown reaction forces using the rows that wehad previously eliminated.
Row 1:
Row 2:
Row3:
EA2 L
Q3 = R1 R1 = F
EA2 L
Q3 = R2 R2 = F
EA2 L
Q3 = R4 R4 = F
This completes the solution of the problem!
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
17/46
Assembly procedure and analysis of arbitrary trusses
17
a = 1 m
E = 200 GPa (steel)
A = 2 cm X 2 cm = 0.0004 m 2 for all 5 members
F = 10 kN
How do extend the previous analysis to multi-member trusses?
Let
s see this through an example.
Sequence of steps
1. Carefully number nodes, elements (members) andglobal degrees of freedom
2. Derive the stiffness matrix for each member3. Assemble the global stiffness matrix4. Prescribe boundary conditions (loads and
displacements)5. Write down the complete system of equations6. Remove rows and columns corresponding to DOFs for
which the displacement is specified7. Solve the matrix problem for the unknown noda l
d i sp lacements8. By using the rows that were previously eliminated,
solve for the unknown r eac t i on f o r ce s9. Calculate the in te rna l force (and s t ress ) in each
m em ber
Note: the procedure is the same whether the truss is staticallydeterminate or indeterminate (either internally ox externally)
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
18/46
18
Assembly procedure and analysis of arbitrary trusses
STEP 1 Number nodes, elements and global degrees of freedom
Q i = global degrees of freedom
Q{ } =
Q1Q2Q3Q4Q5Q6Q7Q8
x and y displacement at node 1
x and y displacement at node 2
x and y displacement at node 3
x and y displacement at node 4
Connectivity matrix
Element, e Node 1 Node 2
1 1 2
2 2 3
3 3 4
4 4 1
5 1 3
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
19/46
Assembly procedure and analysis of arbitrary trusses
19
STEP 2 Derive the stiffness matrix for each member
k 1
= EA
a
1 0 1 00 0 0 0 1 0 1 00 0 0 0
k 2
= EA
a
0 0 0 00 1 0 10 0 0 00 1 0 1
k 3
= EA
a
1 0 1 00 0 0 0 1 0 1 00 0 0 0
k 4
= EA
a
0 0 0 00 1 0 10 0 0 00 1 0 1
k 3
= EA
2 2 a
1 1 1 11 1 1 1 1 1 1 1 1 1 1 1
Element, e Node 1 Node 2
1 1 2
2 2 3
3 3 4
4 4 1
5 1 3
= 0o
= 90o
= 180o
= 270o
= 45o
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
20/46
Assembly procedure and analysis of arbitrary trusses
20
STEP 3 Assemble the global stiffness matrix
k 1
= EA
a
1 0 1 00 0 0 0 1 0 1 00 0 0 0
Element, e Node 1 Node 2
1 1 2
1 2 3 4
1234 Global DOFs
EA/a 0 -EA/a 0
0 0 0 0
-EA/a 0 EA/a 0
0 0 0 0
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
21/46
Assembly procedure and analysis of arbitrary trusses
21
STEP 3 Assemble the global stiffness matrix
Element, e Node 1 Node 2
2 2 3
3 4 5 6
3456 Global DOFs
0 0 0 0
0 EA/a 0 -EA/a
0 0 0 0
0 -EA/a 0 EA/a
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
k 2
= EA
a
0 0 0 00 1 0 10 0 0 00 1 0 1
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
22/46
Assembly procedure and analysis of arbitrary trusses
22
STEP 3 Assemble the global stiffness matrix
Element, e Node 1 Node 2
3 3 4
5 6 7 8
5678 Global DOFs
EA/a 0 -EA/a 0
0 0 0 0
-EA/a 0 EA/a 0
0 0 0 0
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
k 3
= EA
a
1 0 1 00 0 0 0 1 0 1 00 0 0 0
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
23/46
Assembly procedure and analysis of arbitrary trusses
23
STEP 3 Assemble the global stiffness matrix
Element, e Node 1 Node 2
4 4 1
7 8 1 2
7812 Global DOFs
0 0 0 0
0 EA/a 0 -EA/a
0 0 0 0
0 -EA/a 0 EA/a
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
k 4
= EA
a
0 0 0 00 1 0 10 0 0 00 1 0 1
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
24/46
Assembly procedure and analysis of arbitrary trusses
24
STEP 3 Assemble the global stiffness matrix
Element, e Node 1 Node 2
5 1 3
1 2 5 6
1256
Global DOFs
EA/2V2a
EA/2V2a
-EA/2V2a
-EA/2V2a
EA/2V2a
EA/2V2a
-EA/2V2a
-EA/2V2a
-
EA/2V2a
-
EA/2V2a
EA/2V2
a
EA/2V2
a
-EA/2V2a
-EA/2V2a
EA/2V2a
EA/2V2a
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
k 3
= EA
2 2 a
1 1 1 11 1 1 1 1 1 1 1 1 1 1 1
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
25/46
Assembly procedure and analysis of arbitrary trusses
25
STEP 3 Assemble the global stiffness matrix
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
The global stiffness matrix for the entire truss is then:
K = EA
a
1 + 1/ 2 2 1/ 2 2 1 1/ 2 2 1/ 2 2
1/ 2 2 1 + 1/ 2 2 1/ 2 2 1/ 2 2 1
1 1
1 1
1/ 2 2 1/ 2 2 1 + 1/ 2 2 1/ 2 2 1
1/ 2 2 1/ 2 2 1 1/ 2 2 1 + 1/ 2 2
1 1
1 1
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
26/46
Assembly procedure and analysis of arbitrary trusses
26
STEP 3 Assemble the global stiffness matrix
108 28 -80 0 -28 -28 0 0
28 108 0 0 -28 -28 0 -80
-80 0 80 0 0 0 0 0
0 0 0 80 0 -80 0 0
-28 -28 0 0 108 28 -80 0
-28 -28 0 -80 28 108 0 0
0 0 0 0 -80 0 80 0
0 -80 0 0 0 0 0 80
By plugging in the numerical values, we get:
K = 106 N/m
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
27/46
Assembly procedure and analysis of arbitrary trusses
27
STEP 4 Prescribe boundary conditions
Displacement boundary conditions
Q1 = Q2 = Q4 = 0
Load boundary conditions
F 6 = F
F 7 = F
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
28/46
Assembly procedure and analysis of arbitrary trusses
28
STEP 5 Write down the system of equations
10 6
108 28 80 0 28 28 0 028 108 0 0 28 28 0 80
80 0 80 0 0 0 0 00 0 0 80 0 80 0 0
28 28 0 0 108 28 80 0
28 28 0 80 28 108 0 00 0 0 0 80 0 80 00 80 0 0 0 0 0 80
00
Q30
Q5
Q6Q7Q8
=
R1 R20
R40
F F 0
where R 1, R 2, R 4 are the unknown reaction forces.
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
29/46
Assembly procedure and analysis of arbitrary trusses
29
STEP 6 Remove rows and columns corresponding to the degrees of freedomfor which the displacement is specified
10 6
108 28 80 0 28 28 0 028 108 0 0 28 28 0 80
80 0 80 0 0 0 0 00 0 0 80 0 80 0 0
28 28 0 0 108 28 80 0
28 28 0 80 28 108 0 00 0 0 0 80 0 80 00 80 0 0 0 0 0 80
00
Q30
Q5
Q6Q7Q8
=
R1 R20
R40
F F 0
10 6
80 0 0 0 00 108 28 80 00 28 108 0 00 80 0 80 00 0 0 0 80
Q3Q5Q6Q7
Q8
=
00
10,00010,000
0
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
30/46
Assembly procedure and analysis of arbitrary trusses
30
STEP 7 Solve the matrix problem for {Q}
10 6
80 0 0 0 00 108 28 80 00 28 108 0 00 80 0 80 00 0 0 0 80
Q3Q5Q6Q7
Q8
=
00
10,00010,000
0
Q3 = 0 mm
Q5 = 0.6 mm
Q6 = 0.25 mm
Q7 = 0.73 mm
Q8
= 0 mm
At this point, we know the displacement of every node in the truss.
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
31/46
Assembly procedure and analysis of arbitrary trusses
31
STEP 8 By using the rows I had eliminated at step 6, solve for the reaction forces
10 6
108 28 80 0 28 28 0 028 108 0 0 28 28 0 80
80 0 80 0 0 0 0 00 0 0 80 0 80 0 0
28 28 0 0 108 28 80 0
28 28 0 80 28 108 0 00 0 0 0 80 0 80 00 80 0 0 0 0 0 80
0000
0.0006
0.000250.00073
0
=
R1 R20
R40
10,00010,000
0
from which I finally get:
R1
= 10 kN R2 = 10 kN R4 = 20 kN
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
32/46
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
33/46
Assembly procedure and analysis of arbitrary trusses
33
STEP 9 Calculate the internal force (and stress) in each member
This procedure requires careful bookkeeping, as we need totransition from local to global reference systems.
Example: Calculate the internal force in element #5.
Element, e Node 1 Node 2
1 1 2
2 2 3
3 3 4
4 4 1
5 1 3
q1q2q3q4
=
Q1Q2Q5Q6
=
00
0.00061
0.00025
m
from the solution obtained at step 7
Local Global
5 = 45o cos = sin = 2 / 2
s 5 = 200 109
2 1/ 2 1/ 2 1/ 2 1/ 2
00
0.00061 0.00025
= 36 10 6 Pa = 36 MPa
T 5 = A5s 5 = 0.0004 36 106 N = 14.4 kN
Similarly, we obtain:s 1 = 0 MPas 2 = 50 MPas 3 = 25 MPa
s 4 = 0 MPa
T 1 = 0 kN
T 2 = 20 kN
T 3 = 10 kN
T 4
= 0 kN
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
34/46
34
MATLAB Program for Truss Analysis
Program TRUSS2D
Developed by Chadrupatla and Belegundu
Included in:Chandrupatla and Belegundu, Introduction to Finite Elements in Engineering , Prentice Hall, 2002
Slightly modified by L Valdevit
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
35/46
35
Step 1 - Input file and numbering schemeNext line is problem title >TRUSS EXAMPLENN NE NM NDIM NEN NDN4 5 1 2 2 2
ND NL3 2
Node# X Y1 0 02 1 03 1 14 0 1
Elem# N1 N2 Mat# Area1 1 2 1 0.00042 2 3 1 0.0004
3 3 4 1 0.00044 4 1 1 0.00045 1 3 1 0.0004
DOF# Displacement1 02 04 0
DOF# Load6 -100007 10000
MAT# E1 200.E9
SCALING FACTOR FOR PLOTTING100.
-------- LEGEND --------------NN = Number of nodesNE = Number of truss elementsNM = Number of different materialsNDIM = Number of coordinates per node (2 fr 2D, 3 for 3D)NEN = Number of nodes per element (2 for a truss)NDN = Number of degrees of freedom per node (truss: 2 for 2D, 3 for 3D)
ND = # of DOFs along which displacement is specifiedNL = # of DOFs along which load is applied----------------------------------
F i I D
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
36/46
36
Function InputData Reads the input file and stores all values
function [] = InputData()global NN NE NM NDIM NEN NDNglobal ND NL NCH NPR NBWglobal X NOC F AREA MAT S
global PM NU U STRESS REACTglobal CNSTglobal TITLE FILE1 FILE2global LINP LOUTglobal NQglobal 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 (Y oung'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
%-- --- Connectivity -----DUMMY = fgets(LINP);for I=1 :NE
TMP = str2num(fgets(LINP));[N,NOC(N,:), MAT(N,:), AREA(N,:)] = ...
deal(TMP(1),TMP(2:1+NEN), TMP(2+NEN), TMP(3+NEN));end
%----- S pecified Displacements -----DUMMY = fgets(LINP);for I=1: ND
TMP = str2num(fgets(LINP));[NU(I,:),U(I,:)] = deal(TMP(1), TMP(2));
end
%--- -- Component Loads -----DUMMY = fgets(LINP);F = zeros(NQ,1);for I=1: NL
TMP = str2num(fgets(LINP));[N,F(N)]=deal(TMP(1),TMP(2));
end
%-- --- Material Properties -----DUMMY = fgets(LINP);for I=1:N M
TMP = str2num(fgets(LINP));[N, PM(N,:)] = deal(TMP(1), TMP(2:NPR +1));
end
%--- -- Scaling factor for plotting -----DUMMY = f gets(LINP);
SF = str2num(fgets(LINP));
fclose(LINP);
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
37/46
37
InputData
Nodal coordinate matrix
Connectivity matrix
X =
0 0
1 01 1
0 1
Line = Node #
x y
Line = Element # NOC =
1 2
2 3
3 4
4
1
1
3
Local
Node 1
Local
Node 2
MAT =
1
1
1
1
1
AREA =
0.0004
0.0004
0.0004
0.0004
0.0004
Material
PM (1)=
200 E 9 Line = Element #
Cross-section
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
38/46
38
InputData
Displacement boundary conditions
Applied Loads
Value of the displacementof dof specified in NU
NU =
1
24
Degree of freedom with displacement b.c.
U =0
0
0
F =
0
0
0
0
0 1000010000
0
Line = Degree of F reedom
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
39/46
F ti Stiff
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
40/46
40
Function Stiffness Assemble the global stiffness matrix
Example for element #3 (N=3)
I1 = 3 I2 = 4
Node 1 Node 2
SE =
80 E 6 0 80 E 6 00 0 0 0
80 E 6 0 80 E 6 00 0 0 0
NOC =
1 2
2 3
3 44
1
1
3
globX1=NOC(N,1)*2-1;globY1=NOC(N,1)*2;globX2=NOC(N,2)*2-1;globY2=NOC(N,2)*2;
globX1 = 5globY1 = 6
globX2 = 7globY2 = 8S =
80 E 6 0 80 E 6 0 0 0 0 0 80 E 6 0 80 E 6 0 0 0 0 0
S(globX1,globX1) = S(globX1,globX1) + SE(1,1);
S(globX1,globY1) = S(globX1,globY1) + SE(1,2);
S(globX1,globX2) = S(globX1,globX2) + SE(1,3);S(globX1,globY2) = S(globX1,globY2) + SE(1,4);S(globY1,globY1) = S(globY1,globY1) + SE(2,2);S(globY1,globX2) = S(globY1,globX2) + SE(2,3);S(globY1,globY2) = S(globY1,globY2) + SE(2,4);S(globX2,globX2) = S(globX2,globX2) + SE(3,3);S(globX2,globY2) = S(globX2,globY2) + SE(3,4);S(globY2,globY2) = S(globY2,globY2) + SE(4,4);
and the rest follows from the symmetry of SE;
Function ModifyForBC
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
41/46
41
Function ModifyForBCImpose 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
Suppose we want to impose Q 4 = a 4 (e.g. 0).If you add a large number C to S 44 and Ca 4 toF4, the governing equation becomes:
S 11 S 18
S 41 S 42 S 43 S 44 + C S 45 S 46 S 47 S 48
S 81 S 88
Q1
Q4
Q8
=
F 1
F 4 + Ca 4
F 8
The fourth row yields the equation:
S 41Q1 + S 42Q2 + S 43Q3 + (S 44 + C )Q4 + S 45Q5 + S 46Q6 + S 47Q7 + S 48Q8 = F 4 + Ca 4
Divide by C:
S 41C Q1 +
S 42C Q2 +
S 43C Q3 + (
S 44C + 1)Q4 +
S 45C Q5 +
S 46C Q6 +
S 47C Q7 +
S 48C Q8 =
F 4C + a 4
If C is much larger than any S ij and F j, this is approximately equivalent to: Q4 = a 4which is the BC we want to impose.
Hence all I need to do to enforce a displacement BC to dof N is add to the diagonal stiffness term S NN alarge number C; if the prescribed displacement is different from 0, I will also need to add the term C.a N
to the force term F N. Typically C is chosen as 10,000 times the largest value of S ij
Function ModifyForBC
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
42/46
42
Function ModifyForBCImpose displacement BCs with the penalty method
This is trivially implemented in the MATLAB code
%----- Decide Penalty Parameter CNST -----
CNST = max(max(S))*10000;
%-- --- Modify for Boundary Conditions -----% --- Displacement BC ---
for I = 1:NDN = NU(I);
S(N,N) = S(N,N) + CNST;
F(N) = F(N) + CNST * U(I);end
Value of the displacementof dof specified in NU
NU =1
24
Degree of freedom with displacement b.c.
U =0
0
0
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
43/46
Function StressCalc
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
44/46
44
Function StressCalcCalculate the stress in each member
for I = 1:NEI1 = 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
Example for element #3 (I=3)
I1 = 3 I2 = 4 I3 = 1
Node 1 Node 2 Material
X21 = x(4) - x(3) = 0-1 = -1Y21 = y(4) - y(3) = 1-1 = 0
EL = Sqrt((-1)2
+(0)2
) = 1
EAL = 200E9 * 0.0004 / 1 = 80E6
Sine and Cosine of the angle CS = X21 / EL = -1/1 = -1SN = Y21 / EL = 0/1 = 0
X =
0 0
1 0
1 10 1
NOC =
1 2
2 3
3 4
4
1
1
3
Element length
EA/L
J2 = 6 J1 = 5 K2 = 8 K1 = 7Global DOFs corresponding to element #3
Elongation of element #3DLT = (Q 7-Q 5)*CS+ (Q 8-Q 6)*SNStress in element #3
STRESS(3) = E*DTL/EL = -25 MPa (compression)
Function ReactionCalc
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
45/46
45
Function ReactionCalcCalculate the external reaction forces
%----- Reaction Calculation ----- for I = 1:ND
N = NU(I);REACT(I) = CNST * (U(I) - F(N));end
Value of the displacementof dof specified in NU
NU =1
2
4
Degree of freedom with displacement b.c.
U =0
0
0
The reaction forces follow simply from the Penalty Method.
Let
s look for R 4 = F 4 S 11 S 18
S 41 S 42 S 43 S 44 + C S 45 S 46 S 47 S 48
S 81 S 88
Q1
Q4
Q8
=
F 1
F 4 + Ca 4
F 8
S 41Q1 + S 42Q2 + S 43Q3 + (S 44 + C )Q4 + S 45Q5 + S 46Q6 + S 47Q7 + S 48Q8 = F 4 + Ca 4
F 4 = Ca 4 S 41Q1 + S 42Q2 + S 43Q3 + (S 44 + C )Q4 + S 45Q5 + S 46Q6 + S 47Q7 + S 48Q8( )=
Ca 4
CQ 4 =
C a 4
Q4( )
The fourth equation is:
which can be solved for F 4:
-
8/10/2019 Truss Lecture (1) - Mechanics of Materials
46/46
Functions Output and Draw
Output for Input Data from file TRUSS2D_lv.INP
TRUSS EXAMPLE
Node# X-Displ Y-Displ1 9.2350E-09 9.2350E-092 9.2350E-09 -1.8470E-083 6.0359E-04 -2.5002E-044 7.2859E-04 9.2350E-09
Elem# Stress1 1.3235E-12
2 -5.0000E+073 -2.5000E+074 -0.0000E+005 3.5355E+07
DOF# Reaction1 -1.0000E+042 -1.0000E+044 2.0000E+04