You are on page 1of 19

2D TRUSS SOLUTION WITH MATLAB

2D TRUSS SOLUTION WITH MATLAB

Purpose
Purpose of this document is to provide solution for 2D Truss for
weight optimization and material properties.

2D TRUSS SOLUTION WITH MATLAB


Table of Contents
1

PROBLEM STATEMENT ............................................................................................................................ 1


1.1
1.2
1.3
1.4

FIRST CONFIGURATION ................................................................................................................................ 1


ND
2 CONFIGURATION................................................................................................................................... 1
MATERIAL PROPERTIES................................................................................................................................ 2
ASSUMPTION ............................................................................................................................................ 2

MATHEMATICAL MODELING ................................................................................................................... 2


2.1
2.2
2.3
2.4

FRIST CONFIGURATION ................................................................................................................................ 2


MATLAB CODE FOR FIRST CONFIGURATION ................................................................................................... 6
ND
2 CONFIGURATION................................................................................................................................. 11
MATLAB CODE FOR 2ND CONFIGURATION .................................................................................................. 15

SETUP OF ANALYSIS FOR BOTH CONFIGURATIONS ................................................................................ 19

COMPARISON OF BOTH CONFIGURATIONS ........................................................................................... 20

DISCUSSION ........................................................................................................................................... 21

CONCLUSION ......................................................................................................................................... 22

II

2D TRUSS SOLUTION WITH MATLAB


List of Tables
Table 1-1 Material properties of steel .................................................................................................... 2
Table 2-1 Truss nodes coordinates for configuration 1 .......................................................................... 3
Table 2-2 Elements connected by nodes for configuration 1 ................................................................. 3
Table 2-3 Truss nodes coordinates for configuration 2 ........................................................................ 11
Table 2-4 Elements connected by nodes for configuration 2 ............................................................... 11
Table 4-1 Element lengths and cross section for both configurations ................................................. 20
Table 4-2 Comparison of stresses in elements for both configuration ................................................ 20
Table 4-3 Strain Comparison for both truss configurations ................................................................. 21

III

2D TRUSS SOLUTION WITH MATLAB


List of Figures
Figure 1-1 Truss Configuration 1
Figure 1-2 Truss Configuration 2
Figure 2-1 Free body diagram of first configuration
Figure 2-2 Truss configuration 1 plot in MATLAB
Figure 2-3 Free body diagram of Configuration 2
Figure 2-4 Truss Configuration 2 in MATLAB

1
1
2
6
11
14

IV

2D TRUSS SOLUTION WITH MATLAB

2D Truss Solution with Matlab

1 Problem Statement
Assessment of a 2D truss structure with 7 members and 5 connecting points. There are two possible
configurations of this truss system.

1.1

First Configuration
Figure 1-1 Truss Configuration 1

1.2

2nd Configuration
Figure 1-2 Truss Configuration 2

2D Truss Solution with Matlab

Purpose is to select appropriate cross section using discrete method and Matlab Programming method.
Stress, strain and overall performance of the structures will be evaluated and a comparison will made.

1.3

Material Properties

Material properties used for the given truss members are shown in Table below

Table 1-1 Material properties of steel


Material
Youngs Modulus (E)
Poissons ratio
Density
Yield Strength

1.4

Mild Steel
200000 MPa
0.27
7860 kg/m3
250 MPa

Assumption

Following assumption have been made for calculation of cross sectional area of the truss.
Max. Deflection at any node 5mm
Factor of safety for the truss system 2

2 Mathematical Modeling
2.1

Frist Configuration

The free body diagram showing the nodal degrees of freedom, element notations, forces and boundary
conditions.

Figure 2-1 Free body diagram of first configuration

2D Truss Solution with Matlab

The coordinates of all the nodes in truss are tabulated below.

Table 2-1 Truss nodes coordinates for configuration 1


Node Coordinate x Coordinate Y
1
600
0
2
1400
0
3
1400
600
4
600
600
5
0
600
Elements in truss extending from one node to other are defined in table below

Table 2-2 Elements connected by nodes for configuration 1


Element From Node
To Node
1
1
2
2
2
3
3
3
4
4
4
5
5
5
1
6
1
4
7
2
4
The nodal stiffness matrix for each element can be expressed as given in the equation below.

Where
A = cross sectional area of truss element.
E = Youngs modulus.
L = length of truss element.
c = cosine of angle formed by that truss element.
s = sine of angle formed by that truss element.

2D Truss Solution with Matlab


Stiffness Matrices for all 7 elements are given below.
A Matlab program is written to calculate the elemental stiffness matrices

25
0
6
k1 10
25

0 25 0
0 0 0
0 25 0

0 0 0

0 0
0 33
6
k2 10
0 0

0 33

0
0 33
0 0

0 33
0

25
0
6
k3 10
25

0 25 0
0 0 0
0 25 0

0 0 0

33
0
6
k4 10
33

0 33 0
0 0 0
0 33 0

0 0 0

-11785113

-11785113

11785113

11785113

11785113

11785113

-11785113

-11785113

0 0
0 33
6
k6 10
0 0

0 33

0
0 33
0 0

0 33

11785113
-11785113
k5
-11785113

11785113

12800000
-9600000
k7
-12800000

9600000

11785113
-11785113
-11785113

11785113

-9600000

-12800000

7200000

9600000

9600000

12800000

-7200000

-9600000

9600000
-7200000
-9600000

7200000

All these elemental stiffness matrics are combined to make the global stinffnes matrix as given below.

2D Truss Solution with Matlab


-25
36.8 -11.8
-11.8 45.1
0

0
0
0

0
-9.6
0
0
0
0
k gs 106
0
0
0
0
0
0

0
0
0
-11.8 11.8
0

11.8 -11.8
0

40.5

-33.3

-33.3

-11.8 11.8
-33.3
11.8 -11.8

0
0
0

-7.2
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
45.1
-11.8

0
-11.8
11.8
0

9.6

Applied force matrix is given by

0
0

0
0
Fa

0
0

0
0

10000
The nodal displacement matrix

is related with Force matrix

by following equation

Fa k gsU
Where
is nodal displacement matrix given by

U T u1 u2

u3

u4

u5

u6

u7

u8

u9

u10

U k gs1Fa
By using the MATLAB code written for configuration 1. Following results have been obtained.
Nodal deflections are given in mm units.

U T 0.4 0.3 0 0 0 0 0 0 0.3 1.8

2D Truss Solution with Matlab


2.3

2nd Configuration
Figure 2-3 Free body diagram of Configuration 2

The coordinates of all the nodes in truss are tabulated below.

Table 2-3 Truss nodes coordinates for configuration 2


Node Coordinate x Coordinate Y
1
0
0
2
800
0
3
1400
0
4
800
600
5
0
600
Elements in truss extending from one node to other are defined in table below

Table 2-4 Elements connected by nodes for configuration 2


Element
1
2
3

From Node
1
2
3

To Node
2
3
4

11

2D Truss Solution with Matlab


4
5
6
7

4
5
2
5

5
1
4
2

A Matlab program is written to calculate the elemental stiffness matrices

11785113
-11785113
k3
-11785113

11785113

25
0
k1 106
25

0 25 0
0 0 0
0 25 0

0 0 0

33
0
k2 106
33

0 33 0
0 0 0
0 33 0

0 0 0

-11785113

-11785113

11785113

11785113

11785113

11785113

-11785113

-11785113

25
0
6
k4 10
25

0 25 0
0 0 0
0 25 0

0 0 0

0 0
0 33
6
k5 10
0 0

0 33

0
0 33
0 0

0 33

0 0
0 33
k6 106
0 0

0 33

0
0 33
0 0

0 33

11785113
-11785113
-11785113

11785113

12

2D Truss Solution with Matlab

12800000
-9600000
k7
-12800000

9600000

-9600000

-12800000

7200000

9600000

9600000

12800000

-7200000

-9600000

9600000
-7200000
-9600000

7200000

All these elemental stiffness matrics are combined to make the global stinffnes matrix as given below.

0
0

-25

0
0
k gs 106
0
0

0
0

33.3

71.1

-9.6

-33.3

-12.8

-9.6

40.5

-33.3

9.6

-33.3

45.1

11.8

-11.8

11.8 -11.8

-11.8 -11.8
11.8

0
-33.3
9.6

-7.2
0

0
0

0
0

Applied force matrix is given by

0
Fa

100000

0
The nodal displacement matrix

is related with Force matrix

by following equation

Fa k gsU
Where
Is nodal displacement matrix given by
13

2D Truss Solution with Matlab


U T u1 u2

u3

u4

u5

u6

u7

u8

u9

u10

U k gs1Fa
By using the MATLAB code written for configuration 1. Following results have been obtained.
Nodal deflections are given in mm units.

U T 0 0 0.3 0.1 0.6 1.43 0 0 0 0


Elements forces are given in N

F T 7037 10000 14142 0 0 2222 3704

Normal stresses in truss elements are given in MPa

T 70 100 141 0 0 22 37

Normal Strain in all elements is given below.

T .00035 0.0005 0.0007 0 0 0.0001 0.0002


Figure 2-4 Truss Configuration 2 in MATLAB

14

2D Truss Solution with Matlab

3 Setup of analysis for both configurations


Both configurations are modeled and assigned numbering to their elements and nodes as shown
in Fig. 2-1 and 2-3. The boundary conditions and loads are applied as mentioned in the problem
statement documents.
Following properties are used.
Material = Mild steel.
Youngs Modulus = 2 x 1011 N/m2
Poissons ration= 0.3
Density = 7860 kg/m3
Design factor of safety is assumed 1.5
Section lengths are found based on data provided in problem statement for both configurations.
The cross sectional area is determined after iterative studies using MATLAB code for given
truss configurations. Effort is made to keep same cross-section for both configurations to make
comparison more realistic. The section cross section is assumed solid square rod with side
length = 10mm.
Degrees of freedom on each node are defined as shown in Fig. 2-1 & 2-3 based on loading and
boundary conditions.
A program is written in MATLAB based on Finite element approach and element stiffness
matrices are found assuming uniform cross section of each element along its length.
Then these stiffness matrices are combined into a global stiffness matrix showing entries for all
degrees of freedom for each element in truss structure.
Using equation

19

2D Truss Solution with Matlab


The nodal displacements are found which are further transformed to elements to find elemental
deformations and hence finding the normal strains in each member of truss.
Similarly, the truss forces are calculated and by knowing the cross-sectional area of each
member the normal stresses in each member are found.

4 Comparison of both configurations


Element dimensions for both truss configurations are tabulated below.
Table 4-1 Element lengths and cross section for both configurations
Element

1
2
3
4
5
6
7

Length
Config. 1
(mm)
800
600
848.53
800
600
600
1000

Length
Config. 2
(mm)
800
600
848.53
800
600
600
1000

x-sectional Area of
elements (m2)
0.0001
0.0001
0.0001
0.0001
0.0001
0.0001
0.0001

Table 4-1 shows that both configurations are numbered in such a way that numbering in similar
for both the configurations to simplify the comparison.
Stresses in elements for both configurations are tabulated below for all elements.
Table 4-2 Comparison of stresses in elements for both configuration
Element
1
2
3
4
5
6
7

Stresses in Conif. 1 (MPa)


-100
0
0
100
-141
100
0

Stresses in Conif. 2 (MPa)


-70
-100
141
0
0
22
-37

Negative sign in values against stress show the compressive stresses and no sign show the
tensile stresses.

20

2D Truss Solution with Matlab


From the Table 4-2 it is clear that peak stress value i.e. 141 MPa is same for both the
configurations but, peak value in configuration 1 is in compression while that in configuration 2
is in tension. Though both the configurations have same peak stress value but configuration 1 is
much stiffer as compared to configuration 2 based on directions of stress components in
elements. In general yield strength of MS is 250 MPa, based on this yield both configurations
have same factor of safety.

Table 4-3 Strain Comparison for both truss configurations


Element
1
2
3
4
5
6
7

Stresses in Conif. 1 (MPa)


-0.0005
0
0
0.0005
-0.0007
0.0005
0

Stresses in Conif. 2 (MPa)


-0.00035
-0.0005
0.0007
0
0
0.0001
-0.0002

Table 4-3 shows a comparison between strains in elements for both the configurations. The
negative sign shows the compressive strain and values without sign are for tensile strain. From
table it is evident that peak strain is same for both the configurations though configuration 2 has
tensile strain and configuration 1 has compressive strain at peak value. Based on this analysis
configuration 1 seems more stable than configuration 2.

5 Discussion
Matlab codes are written for both the truss configurations and boundary conditions and forces
are applied as mentioned in problem statements. The results are obtained for stresses, strains in
all elements and results are given in previous sections.
From results its evident that both configurations show similar peak stress and strain values,
however configuration 1 shows peak values in compression and configuration 2 shows values in
tension.
Based on truss stability rules, elements loaded in compression are stiffer as compared to those in
tension. Based on this fact, configuration 1 looks more suitable for the problem in hand.
21

2D Truss Solution with Matlab

6 Conclusion
Cross section is decided on the bases of factor of study for sections. The design factor of safety
is kept above 1.5. Peak stresses in our cases while keeping the section 100mm2(square solid rod)
is 141 MPa. Which give 1.7 Factor of Safety? The section is standard.
Configuration 1 is more suitable than configuration 2 for given loading and boundary
conditions.

22

You might also like