You are on page 1of 22

Chapter 2

Truss Analysis: A Structural Mechanics Tour


of the FEM—Nodal Equilibrium
and Compatibility

Abstract Linear elastic behavior and small displacements and rotations (Spencer,
Continuum mechanics. Longman, London, 1980) are assumed throughout. This
model of linear systems allows us to obtain the nodal forces in terms of the
bar stiffness matrices and nodal displacements that are the primary variables.
The equilibrium equations can then be constructed in terms of displacements at
nodes. The given forces and displacements are assumed to be prescribed as nodal
quantities. The resulting system equation, which is in the matrix form, can be
obtained in terms of nodal displacements and solved by employing the Mathematica
function Solve.
A very important area of numerical analysis, i.e., solving positive definite
simultaneous equation systems, will not be addressed in this textbook.
This chapter introduces Mathematica codes. To get started, a summary introduc-
tion is provided in Appendix A that should be studied before reading the current
chapter.
After the first reading, Appendix B should be reviewed for additional examples
and theoretical analysis.

2.1 Truss Structures

A truss is a pin-connected assembly of bars. As shown in Fig. 2.1, the structure is


subjected to axial loading only, without bending [1, 6].
In a truss structure, vide Fig. 2.1, loads are applied only at joints.
In the finite element literature, a point where many elements meet or where
a boundary condition is prescribed is called a node. Rollers and hinges provide
the boundary conditions. The objective is to calculate all member forces and joint
displacements.
In Fig. 2.1, the roller is at node 3. A roller is always placed on a frictionless
platform. Then it can roll freely on the platform and the displacement along that
direction is unknown and orthogonal to that the displacement is zero. Consequently,

© Springer Science+Business Media, LLC 2018 43


G. Dasgupta, Finite Element Concepts, DOI 10.1007/978-1-4939-7423-8_2
44 2 Trusses

Fig. 2.1 Truss:


pin-connected bar elements
with hinge and roller supports 5

5 4 4

5 6 7 3

1 1 2 2 3

the roller reaction develops only along the latter direction, i.e., perpendicular to
the platform.1 Furthermore, we idealize the roller support to act as an anchor that
permits the structure to be pulled.
The hinge, at node 1 in Fig. 2.1, does not permit any movement whatsoever. As a
result, the hinge reaction can develop in any direction. The direction of the platform,
indicated under the hinge, is inconsequential.
The truss in Fig. 2.1 has five nodes. Horizontal and vertical displacements at each
node constitute the ten nodal degrees-of-freedom.
From Eq. (1.86), we obtain element stiffness matrices: Œk.1/ : : : Œk.7/ W

Œk.i/ W stiffness matrix for the ith element (2.1a)


from nodal equilibrium and compatibility

Œk.S/ W system (or global) stiffness matrix (2.1b)


superscript encased within parentheses

In Fig. 2.2, bar forces P1 ; P2 and nodal displacements r1 ; r2 2 are unknown.


Figure 2.2b is unstable, the load can freely move on a circular arc!
We now add one extra member (also called a redundant member since it is not
essential for stability) to Fig. 2.2 and generate Fig. 2.3. There are now three unknown
bar forces P1 ; P2 and P3 , but two unknown nodal displacements r1 ; r2 ; as before.

1
Details are in Sect. B.4, vide Fig. B.10.
2
The fonts in figures and text do not match. This issue is described in Sect. B.4.1.
2.1 Members and Joints 45

(a) (b) r4

r2
r3
2
r1
3
1

1 2
R

(c) (d)
r2
common node
P2 P1
P1 P2

O r1
y

R R

Fig. 2.2 A two bar system and a mechanism with a single load. (a) A stable structure. (b) A
mechanism: not a structure. (c) Forces at O. (d) All forces and displacements

2.1.1 Equilibrium Is Satisfied Explicitly at Joints

In Figs. 2.2d and 2.3b, as in all truss problems, at each joint, i; equilibrium is
satisfied by balancing3 the externally applied forces and support reactions Rj and
the member forces P.m/ :
X X
Rj C P.m/ D 0I bold P; R represent vectors (2.2)

j W external forces at node iI this index is a subscript


m W members meeting at node iI superscript index in parentheses

In Figs. 2.2 and 2.3 since all forces are acting at a point, Eq. (2.2) denotes
equilibrium of the entire plane structures. It then suffices to satisfy equilibrium
individually in the x- and y- (or in any two orthogonal) directions. The zero net
moment condition is trivially satisfied.

3
‘Equating to zero the sum in the vector sense.’ Components of all forces, which are meeting at a
point, in any two orthogonal directions should add up to zero.
46 2 Trusses

(a)

1 3 2

(b)
r2 P3

P2
P1

r1
y

R
Fig. 2.3 Three bar forces and two displacements are unknown. (a) A redundant system. (b) Nodal
displacements are positive along coordinates; in the members tensile forces are positive

2.1.2 Matrix Notation

In Figs. 2.2 and 2.3 R is a vector. On the other hand, in Figs. 2.2d and 2.3b, the
displacement components, not the displacement vectors, are clearly indicated by
r1 ; r2 : The matrix notation allows component-wise representation of external forces
and nodal displacements, at all degrees-of-freedom.

2.1.3 An Argument for the Displacement Method

We can add any number of bars at the joint O of Fig. 2.2 without increasing the
number of displacement unknowns. There are only two equilibrium equations for a
2.1 Members and Joints 47

joint. Then only from equations of statics, even for Fig. 2.3, member forces (and
support reactions) cannot be evaluated. The method must involve r1 and r2 that
explicitly satisfy compatibility.
Overwhelmingly, the number of displacement unknowns is (significantly) less
than that of the forces. Also, the solution demands less numerical efforts when
the displacements are the primary variables,4 as compared to the force counterpart,
i.e., the flexibility method. Therefore we select the displacement and the stiffness
formulation for all truss problems, and use these in the finite element method.

2.1.4 Notations: Superscripts and Subscripts

In Figs. 2.2 and 2.3, the compatibility requirement dictates that at joint O, the .x; y/
displacement components, r1 and r2 should be the same for all members. Let us
consider the equilibrium equation:
8 9 8 9
<Rx = X <P.i/
x =
C D0 (2.3)
:R ; :P.i/ ;
y iW members meeting at node O y

To avoid cluttering the symbols in the textbook, the element number will be
indicated with a superscript. The subscripts are reserved to indicate components that
could be the coordinates or the degree-of-freedom number designator. In Figs. 2.2
and 2.3, the member forces P.i/ will be finally obtained from the element stiffness
matrices with .r1 ; r2 / as the primary unknowns:
 
r1
D frg W displacement vector (a column matrix) (2.4)
r2

In displacement-based finite element method, which is the focus of this textbook,


nodal displacements will always be treated as the target variables to be calculated.
Subsequently, all physical quantities are evaluated in terms of the displacements at
the degrees-of-freedom.

2.1.5 Truss System Stiffness Matrix Equation

In Fig. 2.1, there are five nodes. Before the application of the displacement con-
straints provided by the roller and the hinge, each node can independently freely

4
The same principle applies to all complicated structures. Once the element stiffness matrices
Œk.i/ are obtained then at each node compatibility and equilibrium conditions lead to the system
equations, via the system stiffness matrix Œk.S/ , relating all unknowns.
48 2 Trusses

move in two orthogonal directions. Hence there are ten degrees-of-freedom in the
truss system of Fig. 2.1. Then, in the spirit of footnote 4 we can define the 10  10
truss stiffness5 or the system stiffness matrixŒk.S/ :

.S/ .S/ .S/


fRg101 D Œk1010 frg101 I superscript .S/ : system (2.5)

The virtual displacement counterpart of Eq. (2.5) will have ı fRg ; ı frg W

ı fRg.S/ D Œk.S/ ı frg.S/ (2.6)

The components of ı frg.S/ must be zero at the degrees-of-freedom where the


displacement boundary conditions are prescribed. This is formalized next.

2.1.6 Unit Virtual Displacement in a System

A procedure to ‘pull out’ the i; j element kij of any stiffness matrix (local or global,
singular or non-singular) Œk (a general matrix is encased in [ ]) is:

the unit virtual displacement


2 3 ‚ …„ 8 9 ƒ
   ˆ
ˆ 0> >
6   ˆ0>
ˆ
6      7
7 ˆ
ˆ
ˆ
>
>
>
6 :: 7 ˆ:>
ˆ >
>
6 7 ˚ .j/  < : =
6   :   7 :
6 7 and define ır D then: (2.7)
6   ki;j   7 ˆ1>
ˆ >
6 7 ˆ
ˆ >
6 :: 7 ˆ :: >
ˆ >
>
4   :   5 ˆ >
ˆ : >
:̂ ; >
   0
„ ƒ‚ …
1 at row j; other values are zero
˚ .i/ T ˚ .j/ 
ır Œk ır D kij : clearly a virtual work quantity (2.8)

This idea is generalized ˚in the continuum sense with finite element shape functions
that are the analogs of ır.i/ —the displacement field due to a unit virtual nodal
displacement.6

5
Roller and hinge boundary conditions are not considered in the system stiffness matrix Œk.S/ :
There are three zero eigenvalues, for two rigid body translations in .x; y/, and one rigid body
rotation on the truss plane.
6
Vide ni .x; y/ of Sect. 3.1 for an illustration with plane problems.
2.1 Members and Joints 49

2.1.6.1 Reduced Stiffness Matrix of a Truss Œk from the Global


Stiffness Matrix Œk.S/

The global displacements are housed in a row matrix < r >.S/ (a row matrix is
encased in <> but a column matrix in {}):
* arbitrary prescribed +
.S/
‚…„ƒ ‚ …„ ƒ
<r> D <r> ; < ro > W partitioned (2.9)

*to be calculated zero +


‚ …„ ƒ ‚ …„ ƒ
.S/
then: ı < r > D ı<r> ; ı < ro > (2.10)

The prescribed displacement boundary conditions fro g cannot be altered:

hence: ı < r >.S/ D hı < r >; < 0 >i (2.11)

whose imposition reduces Œk.S/ —the global matrix—to the reduced matrix Œk.
Associated with the three zero eigenvalues of Œk.S/ , there must be at least three
prescribed nodal displacements to “anchor down” the truss.

2.1.6.2 Stiffness Elements as Virtual Work Quantities

For a generic stiffness matrix Œk we shall temporarily state, without resorting to the
concept of virtual work or virtual displacement, that:
“kij is the force needed at the ith degree-of-freedom, when a unit displacement is
gradually applied at the jth degree-of-freedom with all other degrees-of-freedom
held (rigid or) locked.”
From the unit nodal virtual displacement concept, we state:
“kij is the virtual work due to the application of the unit virtual displacement at the
the ith degree-of-freedom, when a unit displacement is imposed at the jth degree-
of-freedom7 while all other degrees-of-freedom are held locked.”
As explained in Sect. 2.1.6, we can polish up the definition of kij to:
“kij is the virtual work necessary to impose a unit virtual displacement at the
ith degree-of-freedom, on the virtual nodal forces introduced by a unit virtual
displacement applied at the jth degree-of-freedom.”
Recall, the unit virtual nodal displacement at the jth degree-of-freedom necessar-
ily implies that all other degrees-of-freedom are held fixed.

7
There is a slight anomaly, depending on whether the displacements at ith and jth degree-of-
freedom be zero or unity.
50 2 Trusses

2.1.6.3 Equations To Be Solved

The n displacement boundary conditions reduce the global stiffness matrix Œk.S/ to
the non-singular8 reduced stiffness matrix Œk : Now, the number of m unknowns in
frg gets reduced by n due to the displacement constraints:
.S/
global : Œkmm ! Œk.mn/.mn/ : reduced (2.12)

For degrees-of-freedom where the displacements are unknown:

fRg D Œk frg I all displacements in frg to be calculated (2.13)

In the summation convention we have to solve:


X X
Rj D kji ri D kij ri (due to symmetry of Œk) (2.14)
i i

However, due to the symmetry of stiffness matrices we shall always utilize


symmetric equation solvers to drastically reduce computing time and storage.
The bar problems in Figs. 2.2 and 2.3 capture the essence of the finite element
method. In fact, Eqs. (2.3) through (2.6) and Eqs. (2.12) and (2.14) encapsulate the
formulation in the .x; y/ frame.

2.2 Displacement Formulations: Statically Determinate


and Indeterminate Trusses

Trusses are classified into two groups: statically determinate and indeterminate,
[1, 6]. In statically determinate systems, e.g. Fig. 2.2a, equations of statics alone
suffice to complete the analysis.

2.2.1 Statically Determinate Trusses

In Fig. 2.4a, an important implication is that the member areas and material
properties do not enter into the equations. Also, there is no redundancy, i.e., if any
member is knocked-off the entire system will collapse as a mechanism. That is to
say there are just enough members laid out in a fashion that geometrical stability is
guaranteed.
We consider equilibrium of selected sections and generate enough equations to
solve all unknowns. Obviously, the stiffness properties of the elements play no role.

8
Here, a square matrix with non-zero determinant.
2.2 Redundancy 51

(a) (b)

Fig. 2.4 Truss problems. (a) Statically determinate. (b) Statically indeterminate

Any standard structural analysis book, such as Chap. 2 in [1], addresses this in detail.
The material properties need to be considered only when the joint displacements9
are to be determined [1, 3].

2.2.2 Statically Indeterminate Trusses

It is often necessary to strengthen the structure by adding additional members


beyond the element arrangement that ensures stability, vide Fig. 2.4b. We must
satisfy compatibility at joints. This statement implies that all members meeting at a
joint should undergo the same displacement. The displacements depend on member
stiffnesses that involve cross-sectional areas and elastic moduli.
In general, the number of displacements at a joint is less than the number of
member forces, vide Fig. 2.3. One vertical and one horizontal joint displacement
help determine three member forces. Thus, for structural analysis it is more
convenient to solve all trusses with the same computer program based on the
displacement formulation with matrix notation.

2.2.3 Importance of the Truss Problem

In a plane truss, (at the minimum) the triangular bar structure attributes stability.
Thus, statically determinate trusses, with the minimum number of members, can
be solved for all its member forces without consideration of any displacement
variables. Since the equations of statics suffice, the member properties, such as the

9
From Williot Mohr’s diagrams we can determine the nodal displacements from bar (positive or
negative) extensions.
52 2 Trusses

Young’s moduli and bar cross-sectional areas, do not enter into the picture of force
computations. In statically indeterminate trusses additional members (also called
redundancy) secure a higher strength requirement, and need additional equations
(beyond static equilibrium) that come from displacement compatibility conditions.
For practical structures with a high redundancy number, it is convenient to carry
out a displacement formulation where element stiffness matrices are used where
equilibrium of forces and displacement compatibility only at joints suffices.

2.2.4 Symbolic Computation for Finite Element Systems

Systems other than the two-dimensional trusses will require different element
stiffness matrices than those discussed in this chapter. But the way the nodal
displacement unknowns are solved remains practically intact.
Mathematica programming facilitates code development irrespective of spatial
dimensionality. If each nodal coordinate List has 1 entry, then the system must
be a connected bar system, as in Fig. 1.12. If the Length of each nodal coordinate
List is two or three, then the appropriate element stiffness matrices will have two
and three degrees-of-freedom per node.
Equilibrium and compatibility is enforced only at the nodal degrees-of-freedom;
the equation generator Listing 2.2 does not need any modification.

2.3 A Mathematica Formulation to Evaluate Unknowns:


Input: nodes, connections, and Member Properties

In any problem, we first identify the reference coordinates and the associated
degrees-of-freedom,10 vide Fig. 2.5 where an isolated member is shown.

Fig. 2.5 A truss element;


nodal forces and
displacements with subscript
are global

10
In Fig. 2.5, the MaTeX fonts, vide Sect. B.4.1, match the symbols in the text and figures.
2.3 Mathematica Codes 53

In general, e.g. in Fig. 2.1, the two lists: nodes and connections furnish the
geometrical description and they will be used throughout:

nodes D ffx1 ; y1 g; : : : ; fxj ; yj g; : : : ; fxnNodes ; ynNodes ggI (2.15a)


nNodes W total number of nodes, in Fig. 2.1: nNodes D 5
connections D ffi.1/ ; j.1/ g; : : : ; fi.nEl/ ; j.nEl/ gg (2.15b)
nEl W total number of elements, in Fig. 2.1: nEl D 7

Note, all Mathematica lists are encased in curly braces.


In Fig. 2.5, R; r are associated with degrees-of-freedom; they are indicated with
subscripts. For the member force and extension, P; the element number, which is
within a circle, is encased within parentheses as superscripts. For the ith element, the
stiffness matrix Œk.i/ ntransforms the independent
o nodal displacements fr1 ; r2 ; r3 ; r4 g
.i/ .i/ .i/ .i/
into the nodal forces R1 ; R2 ; R3 ; R4 :

D E
.i/ .i/ .i/ .i/
R1 ; R2 ; R3 ; R4 D hr1 ; r2 ; r3 ; r4 i Œk.i/ W by balancing forces (2.16)

A displacement, ri , is typeset in LATEX as:


{\ensuremath{{r\hspace{-.03in}}_{_i}}}
Mathematica modules to generate element stiffness matrices are merely coded
equation (1.86) in Listing 2.3. The boundary conditions are expressed as a list of
rules in Listing 2.4. This is a better choice than setting up equations with == or the
Equal construct of Mathematica. The rollers and hinge boundary conditions are
transformed into rules.
In a truss problem, e.g. in Fig. 2.1, resulting member forces P.i/ and axial
stretches .i/ ; as in Fig. 2.5, are needed for design-analysis. All such P.i/ and .i/
are calculated from the nodal quantities, Rj and rj : These are obtained by the stiffness
formulation summarized below.
A list11 fkSg houses all element stiffness matrices, Œk.i/ of Eq. (2.1a):
n o
fkSg D Œk.1/ ; Œk.2/ ; : : : ; Œk..nEl// I nEl W number of elements (2.17)

In Fig. 2.1, nEl equals seven. Then fkSg is a list12 consisting of seven 4  4
element stiffness matrices. Compare this fkSg with the global stiffness matrix Œk.S/
that is 10  10 associated with the five nodal displacements.
The global displacements, e.g. fr1 ; r2 ; r3 ; r4 g in Eq. (2.16), pertaining to the element
number iEl can be retrieved from the list connections, via the nodal numbers
fi.iEl/ ; j.iEl/ g: connections[[iEl]]; the associated four nodal displacements
correspond to the degrees-of-freedom numbered:

2i.iEl/  1 ; 2i.iEl/ ; 2j.iEl/  1 ; 2i.jEl/ (2.18)

11
It is very different from the global stiffness matrix Œk.S/ of Eq. (2.1b).
12
In Mathematica, fkSg is kS; Œk.i/ can be extracted as: ki D PartŒkS; i or ki D kSŒŒi .
54 2 Trusses

2.3.1 The Balance Principles of Physics

In finite elements, equilibrium of forces prevails only in a global sense.13 The


global balance of energy is equivalent to satisfying the global14 equilibrium, vide
Sect. 1.5.1. The Eulerian formulation averages out the local errors. Ritz in [4]
minimized the Eulerian E of Eq. (1.8), which is the foundation of the finite element
method. He devised the best possible adherence to the global (not point-wise)
balance principle (derived as an integral) associated with assumed approximate
response fields.
Akin to the Ritz variational formulation, the force-displacement relations:
Œk.i/ ; Œk.S/ ; and fkSg are virtual work quantities that originate from the global
balance of energy. These two concepts share the same notation, ı; as elaborated
in Sect. 1.5.1.1.

2.3.2 Satisfying Equilibrium at Each Joint

The compatibility at each joint has been assured by using global numbering for each
member nodal displacements. This is the advantage of the displacement formulation
on which the finite element method is anchored.
In Fig. 2.6, the generic joint shows two degrees-of-freedom labeled I and J where
several members j applying forces P.j/ . At the Jth degree-of-freedom, RJ ; rJ 15 are
the respective force and displacement.
locationP = {{-1.45, -0.83},{-0.48‘, -1.8}, {0.78‘, -1.64}};
names = {"1", "i", "j"};
iTexts = Table[Text[ StringJoin["( ", ToString[names[[i]]], "
)"]], {i,3}]

Listing 2.1 Code for P.i/

In Sect. B.4.1 proper typesetting in LATEX figures is described. In particular, the


MaTeX package is used in Mathematica.
From the list connections in Eq. (2.15b), the Mathematica built-in function
Position yields the element numbers and the order the degree-of-freedom occurs
in the member. Suppose for a given degree-of-freedom I an element number p has
its qth local degree-of-freedom. Part[kS,p,q] pulls out the stiffness row that
contributes the force for the Ith degree-of-freedom.

13
For a given distributed skin force f .x/; vide Sect. 1.5, we still approximate the displacement field
to be a linear function u.x/: By considering a constant bar stress, we do not satisfy equilibrium at
individual sections.
14
Also for members, vide Eq. (2.16).
15
Fonts of graphics from Listing 2.1 do not match those in the text, e.g. Eq. (2.16).
2.3 Mathematica Codes 55

Fig. 2.6 Equilibrium at


degrees-of-freedom

(1)

(j)
(i)

2.3.3 Generation of Finite Element System Equations

From Eq. (2.18) we get all the degrees-of-freedom that pertain to the member
number p. This facilitates programming, vide Listing 2.2. The equilibrium statement
in Eq. (2.14) is coded in Listing 2.2:
systemEquations::usage = "systemEquations[{r,R},connections, kS]
returns the form: R[i]=a[i,j] r[j]; sum
on j
R[i], r[i]: force and displacement at degree-of-freedom
number i
connections: array containing element node numbers
kS: houses all element stiffness matrices (same order of
connections)"

systemEquations[{r_, R_}, connections_, kS_] :=


Module[{elementDofs, nDim},
nDim = Length[kS[[1]]]/Length[connections[[1]]];
elementDofs = Flatten[Range[(# - 1)*nDim + 1, #* nDim ]] &
/@ connections;

Table[R[iDofForce] == Plus @@ ((Part[


kS, #[[1]], #[[2]]].(r[#] & /@ Part[elementDofs,
#[[1]]])) & /@
Position[elementDofs, iDofForce]), {iDofForce,
(Length[kS[[1]]]/
Length[connections[[1]]])*Max[Flatten
[connections]]}]]

Listing 2.2 Code for the system equations


56 2 Trusses

2.3.4 An Example from Timoshenko and Young [6]: Fig. 2.7

There are a number of excellent problems in [6]. Listing 2.3 generates element
stiffness matrices. The loads and support conditions are input as rules as in
Listing 2.4:

strussElementStiffnessMatrix::usage="strussElementStiffnessMatrix[
{node1, node2}, ae_] returns the 4 by 4 matrix for an
element with nodal coordinates node1 and node2.
The bar stiffness ae = area * Young’s modulus has a
default value 1"

strussElementStiffnessMatrix[{node1_, node2_}, ae_:1] :=


Module[{c, s, L},
L = Sqrt[(node2 - node1). (node2 - node1)];{c, s} =
(node2 - node1)/L;
(ae/L)* {{c^2, c s, -c^2, -c s}, {c s, s^2, -c s, -s^2},
{-c^2, -c s, c^2,
c s}, {-c s, -s^2, c s, s^2}} // N]

Listing 2.3 Code for 2-D truss element stiffness matrices from Eq. (1.86)

Prescribed boundary conditions from Eq. (2.20), are organized as Mathematica


rules (using the syntax form: a ! b):
boundaryCondition = Flatten[{
{r[1] -> 0, r[2] -> 0, r[4] -> 0 },
{R[5] -> 2 , R[11] -> -1, R[12] -> 1},
Thread[{R[3], R[6], R[7], R[8], R[9], R[10]} -> 0]}]

Listing 2.4 Boundary conditions in Eq. (2.20) as a set of rules

In Fig. 2.7, from [6], a member number is shown within a circle. The connections
are described by:

member number: 1 2 3 4 5 6 7 8 9

first node number: 1 2 3 4 5 6 1 2 3 (2.19)


other node number: 2 3 1 5 6 4 4 6 5

The problem description is:


2.3 Mathematica Codes 57

2
3

2
3
4 4 5

5
6

1
7 6
8

1
1 2
Fig. 2.7 From Timoshenko and Young [6, p. 84, Fig. 2.43]

0 1
node fx; yg
B C
B C Numbering degrees-of-freedom W
B n p o C
B C at a node i
B 1  3; 1 C
B C 2i  1 along x
B C
B np o C 2i along y
B C
B 2 3; 1 C
B C
B C
B C Prescribed quantities W
B C
B 3 f0; 2g C
B C Loading W
B C
B C R5 D 2I R11 D 1I R12 D 1
B 8 p  p  9C
B p C
B < 3 1 C 3 1 C 3 = C
B C Displacements W
B 4  p ; p C
B : 1C 3 1 C 3 ;C r1 D 0I r2 D 0I r4 D 0
B C
B C
B 8p  p  9 C
B
B < 3 1 C 3 1 C p3 = C C Quantities to be calculated W
B 5 p ; p C
B : 1C 3 1C 3 ; C
B C
B C R1 ; R2 ; andR4
B 8  p 9  C
B < 2 1 C 3 = C
B C
@ 6 0;  p A r3 ; r5 ; r6 : : : r12
: 1C 3 ;
(2.20)
58 2 Trusses

The geometrical description from Eq. (2.20) and Fig. 2.7 is in nodes and
connections in Listing 2.5:
nodes = {{-10 Sqrt[3], -10}, {10 Sqrt[3], -10}, {0, 20},
{30 - 20 Sqrt[3],-10 (-2 + Sqrt[3])}, {-30 + 20
Sqrt[3], -10 (-2 + Sqrt[3])}, {0, 20 (-2 + Sqrt[3])}};
connections = {{1, 2}, {2, 3}, {3, 1}, {4, 5}, {5, 6}, {6, 4},
{1, 4},
{2, 6}, {3, 5}};
memberForces ={-0.314459, -1.6151, 2.14088, 0.3849, -0.525783,
-0.281766,
0.345092, 1.16159,
-0.471405}

Listing 2.5 Input and output data; result with all AE D 1

tensileForce[kS_, i_, connections_, r_, allValues_, nodes_] :=


Module[{f1, f2, f3, f4, elementDofs, nDim, c, s, n1, n2, n},
{n1, n2} = nodes[[#]] & /@ connections[[i]];
n = n2 - n1; {c, s} = n/Sqrt[n.n];

nDim = Length[kS[[1]]]/Length[connections[[1]]];
elementDofs = Flatten[Range[(# - 1)*nDim + 1, #*nDim]] & /@
connections;
{f1, f2, f3, f4} = kS[[i]]. ((r[#] & /@ elementDofs[[i]])
/. allValues); -(f1 *c + f2 *s)]

Listing 2.6 Calculating the tensile force in a member from Eq. (1.82b)

memberForces ={-0.314459, -1.6151, 2.14088, 0.3849, -0.525783,


-0.281766,
0.345092, 1.16159,
-0.471405}

Listing 2.7 Calculated tensile force in a member from Eq. (1.82b) in memberForces

In Fig. 2.8, the external forces are indicated in black and the bar tensile
forces, obtained from Eq. (1.82b) and Listings 2.6 and 2.7, are in white on black
background.
In all cases, we shall indicate the tensile member force with a positive number.
The nodal forces and displacements are positive along coordinate axes.
All graphics can be generated from the geometry and boundary data. The lists,
nodes and connections , are always included in all function calls that draw on
different components.
More elaborate graphics and calculations are presented in Appendix B.
Listing 2.8 evaluates all nodal displacements frg and forces fRg:
2.3 Mathematica Codes 59

9: 0
.4714
05

2:
8
408

1.6
2.1

15
3:

4 : 0.3849

1
3
6:

78
25
0.2

0.5
81
2
09

76
45

5:

2.09808
6
.3

1
:0
7

8 : 1.1
6159
1. 1 0
1 : 0.314459

1.09808

Fig. 2.8 Calculated forces—figure and forces displayed algorithmically

(* Solve all forces and displacement at all degrees-of-freedom *)

(* generate all element stiffness matrices in kS *)

kS = Table[strussElementStiffnessMatrix[nodes[[#]] & /@
connections[[iElm]]],
{iElm, Length[connections]}];

(* indicate nodal displacements and forces by r and R *)

eqs = systemEquations[{r, R}, connections, kS];


nDof = (Length[kS[[1]]]/Length[connections[[1]]])*
Max[Flatten[connections]];

allDOF = Flatten[{Array[r, nDof], Array[R, nDof]}];


variablesToBeSolved = Complement[allDOF, (First /@
boundaryCondition)]

sol = Flatten[Solve[eqs /. boundaryCondition,


variablesToBeSolved]];

(* values of all nodal displacements and forces *)

allValues = Union[sol, boundaryCondition]

Listing 2.8 Solving all nodal displacements and forces


60 2 Trusses

2.3.5 A Note on Numerical Efficiency

A finite element system equation, indicated by eqs in Listing 2.8, is always


symmetric, positive definite, and banded. In Listing 2.8, Solve[] does not
take advantage of these mathematical properties; hence, it employs a robust but
inefficient algorithm to yield the solutions in sol. In concept development and
homework problems, Solve[] is adequate. Mathematica has a number of ‘under
the hood’ enhancements to speed up calculations.
For production runs CCC libraries can be called from Mathematica; such
programming details, e.g. [2], are not within the scope in this textbook.
Finite element system equations are not only symmetric but sparse in general,
and mostly banded. These features enhance numerics significantly. Mathematica
functions such as:
SparseArray\[RawBackquote]KrylovLinearSolve
can be employed in production runs. In this textbook, we shall not go into any such
detail.

2.4 Extensions to General Finite Element Systems

For general finite elements we can keep most of the computer codes from truss
problems.16 For example, in plane strain analysis, we replace the bar stiffness
matrices by the two-dimensional plane strain stiffness matrices. The assembly and
solution procedures, hence the Mathematica routines, remain intact.

2.4.1 Spatial Discretization

Finite elements, ˝ .i/ with a boundary  .i/ ; are non-intersecting geometrical entities
whose collection fully covers the body ˝ with a boundary  W

[ ˝ .i/ D ˝I for ; i ¤ j; ˝ .i/ \ ˝ .j/ D ; W the empty set (2.21)

Mesh generation, with a predetermined spatial discretization by design, is an active


field of research. There are modules (also included in Mathematica) that are widely
available for all computer systems.

16
Except for the incompressible case where the set of degrees-of-freedom contains isochoric shape
functions and a constant pressure for each finite element.
2.4 Extentions 61

(a) (b)

Fig. 2.9 Covering arbitrary 2-D shapes with simplex elements. (a) Covering with truss elements.
(b) Covering with triangular elements

2.4.2 Triangulation: Simplex Elements

Figure 2.9a furnishes a generic example where truss-like triangles cover an arbitrary
domain. In Fig. 2.9b, we have filled in the space between the truss members with
thin plane sheets and encountered a plane stress problem. The elements of the
figures have the simplest geometrical shapes, and are thus termed simplex (in three-
dimensions, a simplex element is a tetrahedron).

2.4.3 The Scope of Truss Problems

It is of the utmost importance to treat distinctly the scalar17 problems from their
vector field counterparts, e.g. continuum elasticity.18 The latter is converted into the
former by idealizing the axial displacement to be the only independent variable in
individual members, in trusses.
In Fig. 2.10, we have non-simplex tessellation. For elasticity problems in two-
and three-dimensions, the shape functions themselves must be vectors coupled via
the Poisson’s ratio, even though the triangulation scalar shape functions suffice.
These issues are addressed in the following chapters of this textbook.
For two-dimensional plane strain cases, incompressibility, i.e., for the Poisson’s
1
ratio  D ; poses additional difficulties. The shape functions are kinematically
2
constrained and a constant element pressure p0 needs to be addressed. The notion
of the pseudoinverse, described in Sects. 1.8 and 1.9, provides the computational
concept and the tool to resolve the ‘zero dilatation’ situation.

17
For example, temperature distributions and the torsion in non-circular prismatic shafts.
18
For triangles and tetrahedra the interpolants are identical for scalar and vector problems.
62 2 Trusses

2
1

Fig. 2.10 2D system with same nodes as in Fig. 2.7

2.5 Comments on Problems

Linear elastic behavior and small displacements and rotations [5] are assumed
throughout. Truss analyses, especially those pertaining to statically indeterminate
cases, encompass all crucial aspects of linear elastostatic modeling by finite
elements. This is the reason why the entire Appendix B is developed to demonstrate
a number of truss problems using Mathematica. By following these examples, we
can grasp the details of the analytical and computational steps. In all finite element
approximations, the shape functions are the basic objects. They are (simply) linear
in the axial direction, for truss problems.
In the finite element method, equilibrium and compatibility conditions are
enforced only at nodes. The (equivalent) nodal forces are obtained as virtual work
quantities by conjugating the distributed forces with assumed shape functions.
The advantage of Mathematica programs is that the reader can design their own
examples. This is indeed very strongly suggested. An adequate set of problems,
specified by the reader, will provide the skill normally earned through a fixed
number of exercises. The graphic codes of Appendix B are indispensable for
generating meaningful results. These aspects can be fully comprehended with basic
truss examples.
No problems (exercises) are assigned in this chapter. The reader is encouraged
to follow Appendix B for self-study. For example, the reader can change all the
necessary data to solve truss problems related to Fig. 2.11.
References 63

2 3

Fig. 2.11 A modification of Fig. 2.10 in two- and three-dimensions

References

1. Connor JJ, Faraji S (2013) Fundamentals of structural engineering. Springer, New York
2. Fritzson P (2004) Principles of object-oriented modeling and simulation with Modelica 2.1.
Wiley, London
3. Lubliner J, Papadopoulos P (2016) Introduction to solid mechanics, 2nd edn. Springer, New
York
4. Ritz W (1908) Über eine neue methode zur lösung gewisser variationalprobleme der mathema-
tischen physik. J Reine Angew Math 135:1–61
5. Spencer AJM (1980) Continuum mechanics. Longman, London (also 1990 Dover, New York)
6. Timoshenko SP, Young DH (1965) Theory of structures, 2nd edn. McGraw-Hill, New York
http://www.springer.com/978-1-4939-7421-4

You might also like