Professional Documents
Culture Documents
If em
If em
Implementation of
One-Dimensional
Elements
21–1
Chapter 21: IMPLEMENTATION OF ONE-DIMENSIONAL ELEMENTS 21–2
TABLE OF CONTENTS
Page
§21.1. THE PLANE BAR ELEMENT 21–3
§21.1.1. Element Formulation . . . . . . . . . . . . . . . 21–3
§21.1.2. Element Formation Modules . . . . . . . . . . . . 21–4
§21.1.3. Testing the Plane Bar Element Modules . . . . . . . . . 21–5
§21.2. THE PLANE BEAM-COLUMN ELEMENT 21–8
§21.2.1. Element Formulation . . . . . . . . . . . . . . 21–9
§21.2.2. Element Formation Modules . . . . . . . . . . . . 21–11
§21.2.3. Testing the Beam-Column Element Modules . . . . . . 21–13
§21.3. THE SPACE BAR ELEMENT 21–15
§21.3.1. Element Formulation . . . . . . . . . . . . . . . 21–16
§21.3.2. Element Formation Modules . . . . . . . . . . . . 21–18
§21.3.3. Testing the Space Bar Element Modules . . . . . . . . 21–20
EXERCISES . . . . . . . . . . . . . . . . . . . . . . 21–21
21–2
21–3 §21.1 THE PLANE BAR ELEMENT
This Chapter begins Part III of the course. This Part deals with the computer implementation of the
Finite Element Method. It is organized in “bottom up” fashion. It begins with simple topics, such
as programming of bar and beam elements, and gradually builds up toward more complex models
and calculations.
Theis Chapter illustrates, through specific examples, the programming of one-dimensional elements:
bars and beams, using Mathematica as implementation language. The programming of both stiffness
and mass matrices are illustrated although only the stiffness matrix is used in this course.
The element geometry is described by the coordinates {xi , yi }, i = 1, 2 of the two end nodes.
The two material properties involved in the stiffness and mass computations are the modulus of
elasticity E and the mass density per unit volume ρ. The only fabrication property required is the
cross section area A. All of these properties are taken to be constant over the element.
x−
2 (x 2 , y2 )
= L(e)
y−
y
ϕ E, A, ρ
x 1 (x 1 , y1 )
21–3
Chapter 21: IMPLEMENTATION OF ONE-DIMENSIONAL ELEMENTS 21–4
PlaneBar2Stiffness[ncoor_,mprop_,fprop_,opt_]:= Module[
{x1,x2,y1,y2,x21,y21,Em,Gm,Ρ,Α,A,numer,L,LL,LLL,Ke},
{{x1,y1},{x2,y2}}=ncoor; {x21,y21}={x2-x1,y2-y1};
{Em,Gm,Ρ,Α}=mprop; {A}=fprop; {numer}=opt;
If [numer,{x21,y21,Em,A}=N[{x21,y21,Em,A}]];
LL=x21^2+y21^2; L=PowerExpand[Sqrt[LL]]; LLL=Simplify[LL*L];
Ke=(Em*A/LLL)*{{ x21*x21, x21*y21,-x21*x21,-x21*y21},
{ y21*x21, y21*y21,-y21*x21,-y21*y21},
{-x21*x21,-x21*y21, x21*x21, x21*y21},
{-y21*x21,-y21*y21, y21*x21, y21*y21}};
Return[Ke]
];
PlaneBar2ConsMass[ncoor_,mprop_,fprop_,opt_]:= Module[
{x1,x2,y1,y2,x21,y21,Em,Gm,Ρ,Α,A,numer,L,MeC},
{{x1,y1},{x2,y2}}=ncoor; {x21,y21}={x2-x1,y2-y1};
{Em,Gm,Ρ,Α}=mprop; {A}=fprop; {numer}=opt;
If [numer,{x21,y21,Ρ,A}=N[{x21,y21,Ρ,A}]];
L=Simplify[PowerExpand[Sqrt[x21^2+y21^2]]];
MeC=(Ρ*A*L/6)*{{2,0,1,0},{0,2,0,1},{1,0,2,0},{0,1,0,2}};
Return[MeC]
];
PlaneBar2LumpMass[ncoor_,mprop_,fprop_,opt_]:= Module[
{x1,x2,y1,y2,x21,y21,Em,Gm,Ρ,Α,A,numer,L,MeL},
{{x1,y1},{x2,y2}}=ncoor; {x21,y21}={x2-x1,y2-y1};
{Em,Gm,Ρ,Α}=mprop; {A}=fprop; {numer}=opt;
If [numer,{x21,y21,Ρ,A}=N[{x21,y21,Ρ,A}]];
L=Simplify[PowerExpand[Sqrt[x21^2+y21^2]]];
MeL=(Ρ*A*L/2)*IdentityMatrix[4];
Return[MeL]
];
Both mass matrices are independent of the orientation of the element, that is, do not depend on the
angle ϕ.1
1 For the derivation of the consistent mass matrix, see, e.g., the book by Przemieniecki, Matrix Structural Analysis, Dover,
1968.
21–4
21–5 §21.1 THE PLANE BAR ELEMENT
These four arguments are actually lists that collect the following data:
node coordinates, material properties, fabrication properties, options
Here x1,y1 and x2,y2 are the coordinates of the end nodes, and Em, Gm, rho, alpha and A stand
for E, G, ρ, α and A, respectively. For the stiffness matrix only E and A are used. In the mass
matrix modules only ρ and A are used. Entries Gm and alpha are included to take care of other 1D
elements.
The only option is numer, which is a logical flag with the value True or False. If True the
computations are carried out in numerical floating-point arithmetic.
The modules are tested by the statements listed in Figures 21.3 and 21.5.
The script of Figure 21.3 tests a numerically defined element with end nodes located at (0, 0) and
(30, 40), with E = 1000, A = 5, ρ = 6/10, and numer set to True. Executing the statements in
Figure 21.3 produces the results listed in Figure 21.4. The tests consist of the following operations:
Testing K(e) . The stiffness matrix returned in Ke is printed. Its four eigenvalues are computed
and printed. As expected three eigenvalues, which correspond to the three independent rigid body
motions of the element, are zero. The remaining eigenvalue is positive and equal to E A/. The
symmetry of Ke is also checked but the output is not shown to save space.
Testing MC(e) . The consistent mass matrix returned in MeC is printed. Its four eigenvalues are
computed and printed. As expected they are all positive and form two pairs. The symmetry is also
checked but the output is now shown.
Testing M(e)
L . The lumped mass matrix returned in MeL is printed. This is a diagonal matrix and
consequently its eigenvalues are the same as the diagonal entries.
21–5
Chapter 21: IMPLEMENTATION OF ONE-DIMENSIONAL ELEMENTS 21–6
ncoor={{0,0},{30,40}}; mprop={1000,0,6/10,0};
fprop={5}; opt={True};
Ke= PlaneBar2Stiffness[ncoor,mprop,fprop,opt];
Print["Numerical Elem Stiff Matrix: "];
Print[Ke//MatrixForm];
Print["Eigenvalues of Ke=",Chop[Eigenvalues[N[Ke]]]];
Print["Symmetry check=",Simplify[Transpose[Ke]-Ke]];
MeC= PlaneBar2ConsMass[ncoor,mprop,fprop,opt];
Print["Numerical Consistent Mass Matrix: "];
Print[MeC//MatrixForm];
Print["Eigenvalues of MeC=",Eigenvalues[N[MeC]]];
Print["Symmetry check=",Simplify[Transpose[MeC]-MeC]];
MeL= PlaneBar2LumpMass[ncoor,mprop,fprop,opt];
Print["Numerical Lumped Mass Matrix: "];
Print[MeL//MatrixForm];
Print["Eigenvalues of MeL=",Eigenvalues[N[MeL]]];
Figure 21.3. Test of plane bar element modules with numerical inputs.
75.
0 0 0
0 75. 0 0
0 0 75. 0
0 0 0 75.
Eigenvalues of MeL75., 75., 75., 75.
The script of Figure 21.5 tests a symbolically defined element with end nodes located at (0, 0) and
(L , 0), which is aligned with the x axis. The element properties E, ρ and A are kept symbolic.
Executing the statements in Figure 21.4 produces the results shown in Figure 21.5.
The sequence of tests on the symbolic element is essentially the same carried out before, but a
21–6
21–7 §21.1 THE PLANE BAR ELEMENT
ClearAll[A,Em,Ρ,L,opt];
ncoor={{0,0},{L,0}}; mprop={Em,0,Ρ,0}; fprop={A}; opt={False};
Ke= PlaneBar2Stiffness[ncoor,mprop,fprop,opt];
kfac=Em*A/L; Ke=Simplify[Ke/kfac];
Print["Symbolic Elem Stiff Matrix: "];
Print[kfac," ",Ke//MatrixForm];
Print["Eigenvalues of Ke=",kfac,"*",Eigenvalues[Ke]];
MeC= PlaneBar2ConsMass[ncoor,mprop,fprop,opt];
mfac=Ρ*L*A/6; MeC= Simplify[MeC/mfac];
Print["Symbolic Consistent Mass Matrix: "];
Print[mfac," ",MeC//MatrixForm];
Print["Eigenvalues of MeC=",mfac,"*",Eigenvalues[MeC]];
Print["Squared frequencies=",Simplify[kfac/mfac],"*",
Simplify[Eigenvalues[Inverse[MeC].Ke]]];
MeL= PlaneBar2LumpMass[ncoor,mprop,fprop,opt];
mfac=Ρ*L*A/2; MeL= Simplify[MeL/mfac];
Print["Symbolic Lumped Mass Matrix: "];
Print[mfac," ",MeL//MatrixForm];
Print["Eigenvalues of MeL=",mfac,"*",Eigenvalues[MeL]];
Print["Squared frequencies=",Simplify[kfac/mfac],"*",
Simplify[Eigenvalues[Inverse[MeC].Ke]]];
Figure 21.5. Test of plane bar element modules with symbolic inputs.
21–7
Chapter 21: IMPLEMENTATION OF ONE-DIMENSIONAL ELEMENTS 21–8
y−
u− x 2 θz 2
u−x1 θz1
u− y 2
u− y1
1 2 x−
= L(e) E, A, Izz , ρ
x−
2 (x 2 , y2 )
y y−
x
1 (x 1 , y1 )
frequency test has been added. This consists of solving the one-element vibration eigenproblem
in which ωi are circular frequencies and vi the associated eigenvectors or vibration mode shapes.
Because the 3 rigid body modes are solution of (21.5), three zero frequencies are expected, which is
borned out by the tests. The single positive nonzero frequency ωa > 0 corresponds to the vibration
mode of axial extension and contraction. The consistent mass yields ωa2 = 12E/(ρ L 2 ) whereas
the lumped mass yields ωa2 = 4E/(ρ L 2 ). The exact continuum solution for this axial mode is
ωa2 = π 2 E/(ρ L 2 ) ≈ 9.86E/(ρ L 2 ). Hence the consistent mass overestimates the true frequency
whereas the lumped mass underestimates it, which is a well known property.
Running the script of Figure 21.5 produces the output shown in Figure 21.6. One thing to be noticed
is the use of stiffness and mass matrix scaling factors, called kfac and mfac, respectively, in Figure
21.5. These embody symbolic quantities that can be taken out as matrix factors, for example E A/L
in K(e) . The effect is to clean up matrix and vector output, as can be observed in Figure 21.6.
21–8
21–9 §21.2 THE PLANE BEAM-COLUMN ELEMENT
We consider such an element in its local system (x̄, ȳ) as shown in Figure 21.7, and then in the
global system (x, y) as shown in Figure 21.8. The six degrees of freedom and conjugate node
forces of the elements are:
¯
ū x1 f x1 u x1 f x1
ū y1 f¯y1 u y1 f y1
θ (e) m θ m
ū(e) = z1 , f̄ = z1 , u(e) = z1 , f(e) = z1 . (21.6)
ū x2 ū x2 u x2 f x2
ū y2 ū y2 u y2 f y2
θz2 m z2 θz2 m z2
The rotation angles θ and the nodal moments m are the same in the local and the global systems
because they are about the z axis, which does not change.
The element geometry is described by the coordinates {xi , yi }, i = 1, 2 of the two end nodes. The
element length is . The two material properties involved in the stiffness and mass computations
are the modulus of elasticity E and the mass density per unit volume ρ. The fabrication properties
required are the cross section area A and the bending moment of inertia I = Izz about the neutral
axis, which is taken as defining the position of the z axis. All of these properties are taken to be
constant over the element.
21–9
Chapter 21: IMPLEMENTATION OF ONE-DIMENSIONAL ELEMENTS 21–10
PlaneBeamColumn2Stiffness[ncoor_,mprop_,fprop_,opt_]:= Module[
{x1,x2,y1,y2,x21,y21,Em,Gm,Ρ,Α,A,Izz,numer,c,s,L,LL,
LLL,ra,rb,T,Kebar,Ke},
{{x1,y1},{x2,y2}}=ncoor; {x21,y21}={x2-x1,y2-y1};
{Em,Gm,Ρ,Α}=mprop; {A,Izz}=fprop; {numer}=opt;
LL=Simplify[x21^2+y21^2]; L=PowerExpand[Sqrt[LL]]; LLL=L*LL;
c=x21/L; s=y21/L; ra=Em*A/L; rb= 2*Em*Izz/LLL;
Kebar= ra*{
{ 1,0,0,-1,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0},
{-1,0,0, 1,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}} +
rb*{
{ 0,0,0,0,0,0},{0, 6, 3*L,0,-6, 3*L},{0,3*L,2*LL,0,-3*L, LL},
{ 0,0,0,0,0,0},{0,-6,-3*L,0, 6,-3*L},{0,3*L, LL,0,-3*L,2*LL}};
T={{c,s,0,0,0,0},{-s,c,0,0,0,0},{0,0,1,0,0,0},
{0,0,0,c,s,0},{0,0,0,-s,c,0},{0,0,0,0,0,1}};
Ke=Transpose[T].Kebar.T; If [numer,Ke=N[Ke]];
Return[Ke]
];
The first matrix on the right is the contribution from the axial (bar) inertia, whereas the second one
comes from the bending (beam) inertia. The expression for the latter neglect the shear and rotatory
inertia. Their derivation may be followed in the book of Przemieniecki cited in footnote 1.
The displacement transformation matrix between local and global systems is
ū x1 c s 0 0 0 0 u x1
ū y1 −s c 0 0 0 0 u y1
θz1 0 0 1 0 0 0 θz1
ū(e) = = = T u(e) (21.9)
u x2 0 0 0 c s 0 u x2
ū y2 0 0 0 −s c 0 u y2
θz2 0 0 0 0 0 1 θz2
where c = cos ϕ, s = sin ϕ, and ϕ is the angle between x̄ and x, measured positive-counterclockwise
from x; see Figure 21.3. The stiffness and consistent mass matrix in the global system are obtained
(e) (e)
through the congruential transformation K(e) = TT K̄ T, MC(e) = TT M̄ T. The lumped mass
matrix is diagonal and is the same in the local and global systems:
1 0 0 0 0 0
0 1 0 0 0 0
(e) ρ
0 0 mθ 0 0 0
M(e)
L = M̄ L = . (21.10)
2 0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 mθ
Here the rotational lumped mass is shown as m θ . There are several ways to compute m θ , including
the simplest one of leaving it zero. In the implementation shown in Figure 21.6, m θ = ρ A3 /78.
21–10
21–11 §21.2 THE PLANE BEAM-COLUMN ELEMENT
PlaneBeamColumn2ConsMass[ncoor_,mprop_,fprop_,opt_]:= Module[
{x1,x2,y1,y2,x21,y21,Em,Gm,Ρ,Α,A,Izz,numer,c,s,L,LL,m,
T,MeClocal,MeC},
{{x1,y1},{x2,y2}}=ncoor; {x21,y21}={x2-x1,y2-y1};
{Em,Gm,Ρ,Α}=mprop; {A,Izz}=fprop; {numer}=opt;
LL=x21^2+y21^2; L=PowerExpand[Sqrt[LL]];
c=x21/L; s=y21/L; m=Ρ*L*A;
MeClocal= (m/6)*{
{2,0,0,1,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0},
{1,0,0,2,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}}+
+(m/420)*{
{0,0,0,0,0,0},{0,156,22*L,0,54,-13*L},
{0,22*L,4*LL,0,13*L,-3*LL},
{0,0,0,0,0,0},{0,54,13*L,0,156,-22*L},
{0,-13*L,-3*LL,0,-22*L,4*LL}};
T={{c,s,0,0,0,0},{-s,c,0,0,0,0},{0,0,1,0,0,0},
{0,0,0,c,s,0},{0,0,0,-s,c,0},{0,0,0,0,0,1}};
MeC=Transpose[T].MeClocal.T; If [numer,MeC=N[MeC]];
Return[MeC]
];
PlaneBeamColumn2LumpMass[ncoor_,mprop_,fprop_,opt_]:= Module[
{x1,x2,y1,y2,x21,y21,Em,Gm,Ρ,Α,A,Izz,numer,L,LL,MeL},
{{x1,y1},{x2,y2}}=ncoor; {x21,y21}={x2-x1,y2-y1};
{Em,Gm,Ρ,Α}=mprop; {A,Izz}=fprop; {numer}=opt;
LL=Simplify[x21^2+y21^2]; L=PowerExpand[Sqrt[LL]];
(* HRZ lumping scheme for rotational masses *)
MeL=(Ρ*A*L/2)*
{{1,0,0,0,0,0},{0,1,0,0,0,0},{0,0,LL/39,0,0,0},
{0,0,0,1,0,0},{0,0,0,0,1,0},{0,0,0,0,0,LL/39}};
If [numer,MeL=N[MeL]];
Return[MeL]
];
2 See e.g., R. D. Cook, D. S. Malkus and M. E. Plesha, Concepts and Applications of Finite Element Analysis, 3rd ed.,
Wiley, 1989.
21–11
Chapter 21: IMPLEMENTATION OF ONE-DIMENSIONAL ELEMENTS 21–12
Ke= PlaneBeamColumn2Stiffness[ncoor,mprop,fprop,opt];
Print["Numerical Elem Stiff Matrix: "];
Print[Ke//MatrixForm];
Print["Eigenvalues of Ke=",Chop[Eigenvalues[Ke]]];
MeC= PlaneBeamColumn2ConsMass[ncoor,mprop,fprop,opt];
Print["Numerical Consistent Mass Matrix: "];
Print[MeC//MatrixForm];
Print["Eigenvalues of MeC=",Eigenvalues[MeC]];
Print["Squared frequencies (consistent)=",
Chop[Eigenvalues[Inverse[MeC].Ke],10^(-7)]];
MeL= PlaneBeamColumn2LumpMass[ncoor,mprop,fprop,opt];
Print["Numerical Lumped Mass Matrix: "];
Print[MeL//MatrixForm];
Print["Eigenvalues of MeL=",Eigenvalues[MeL]];
Print["Squared frequencies (lumped)=",
Chop[Eigenvalues[Inverse[MeL].Ke],10^(-7)]];
Figure 21.11. Test of 2-node plane beam-column element with numeric inputs.
21–12
21–13 §21.2 THE PLANE BEAM-COLUMN ELEMENT
ClearAll[L,Em,Ρ,A,Izz,opt];
ncoor={{0,0},{L,0}}; mprop={Em,0,Ρ,0}; fprop={A,Izz};
opt={False};
Ke= PlaneBeamColumn2Stiffness[ncoor,mprop,fprop,opt];
Print["Symbolic Elem Stiff Matrix:"]; kfac=Em*A/L;
Ke=Simplify[Ke/kfac]; Print[kfac," ",Ke//MatrixForm];
Print["Eigenvalues of Ke=",kfac,"*",Eigenvalues[Ke]];
MeC= PlaneBeamColumn2ConsMass[ncoor,mprop,fprop,opt];
Print["Symbolic Consistent Mass Matrix:"]; mfac=Ρ*A*L;
MeC= Simplify[MeC/mfac]; Print[mfac," ",MeC//MatrixForm];
Print["Eigenvalues of MeC=",mfac,"*",Eigenvalues[MeC]];
Print["Squared frequencies=",Simplify[kfac/mfac],"*",
Simplify[Eigenvalues[Inverse[MeC].Ke]]];
MeL= PlaneBeamColumn2LumpMass[ncoor,mprop,fprop,opt];
Print["Symbolic Lumped Mass Matrix:"]; mfac=Ρ*A*L;
MeL= Simplify[MeL/mfac]; Print[mfac," ",MeL//MatrixForm];
Print["Eigenvalues of MeL=",Eigenvalues[MeL]];
Print["Squared frequencies=",Simplify[kfac/mfac],"*",
Simplify[Eigenvalues[Inverse[MeL].Ke]]];
Figure 21.13. Test of 2-node plane beam-column element with symbolic inputs.
As in the case of the plane bar, the calling argument sequence of the three modules is exactly the
same:
[ ncoor, mprop, fprop, opt ]
These four arguments are lists that collect the following data:
node coordinates, material properties, fabrication properties, options
The internal structure of these lists is
Here x1,y1 and x2,y2 are the coordinates of the end nodes, while Em, Gm, rho, alpha, A and Izz
stand for E, G, ρ, α, A and Izz , respectively. For the stiffness matrix only E, A and Izz are used.
In the mass matrix modules only ρ and A are used. Entries Gm and alpha are included to take care
of other 1D elements.
The only option is numer, which is a logical flag with the value True or False. If numer=True
the computations are carried out in numerical floating-point arithmetic.
21–13
Chapter 21: IMPLEMENTATION OF ONE-DIMENSIONAL ELEMENTS 21–14
The script of Figure 21.7 tests a numerically defined element of length = 5 with end nodes located
at (0, 0) and (3, 4) respectively, with E = 100, ρ = 84/5, A = 125 and Izz = 250. The output is
shown in Figure 21.12. The tests consist of the following operations:
Testing K(e) . The stiffness matrix returned in Ke is printed. Its six eigenvalues are computed and
printed. As expected three eigenvalues, which correspond to the three independent rigid body
motions of the element, are zero. The remaining three eigenvalues are positive.
Testing MC(e) . The consistent mass matrix returned in MeC is printed. Its symmetry is checked. The
six eigenvalues are computed and printed. As expected they are all positive. A frequency test is
also carried out.
Testing M(e)L . The lumped mass matrix returned in MeL is printed. This is a diagonal matrix and
thus its eigenvalues are the same as the diagonal entries. A frequency test is also carried out.
The script of Figure 21.13 tests a symbolically defined element with end nodes located at (0, 0) and
21–14
21–15 §21.3 THE SPACE BAR ELEMENT
(L , 0), which is aligned with the x axis. The element properties E, ρ, A and Izz are kept in symbolic
form. The output is shown in shown in Figure 21.14, except that the output of the eigenvalues of
the mass matrices has been deleted to save space.
The sequence of tests on the symbolic element is similar to that performed for the bar element in
Figure 21.4. The vibration eigenproblems are
K(e) vi = ωi2 MC(e) vi , K(e) vi = ωi2 M(e)
L vi , (21.12)
where ωi are circular frequencies and vi the associated eigenvectors or vibration mode shapes.
Because the three rigid body modes are solution of (21.12), three zero frequencies are expected
for the consistent mass eigenproblem, which is borned out by the tests. The three positive nonzero
frequencies corresponds to one free-free axial and two free-free bending modes. The consistent
mass gives for the latter ω2 = 720E I /(ρ AL4 ) and ω2 = 8400E I /(ρ A4 ). These are upper
bounds to the exact continuum solution for the first two free-free bending frequencies, which are
are 502E I /(ρ A4 ) and 1382E I /(ρ A4 ).
The lumped mass vibration eigenproblem, using the HRZ lumping scheme for the rotational masses,
yields three zero frequencies, one finite positive axial vibration frequency, which is the same
as that provided by the bar element, and two bending frequencies ω2 = 156E I /(ρ AL4 ) and
ω2 = 516E I /(ρ A4 ). These are lower bounds to the exact free-free continuum frequencies given
above.
y−
−
z 1 (x 1 , y1, z 1 )
y E, A, ρ
2 (x 2 , y2 , z 2 )
z x
= L(e) x−
To provide a taste of the world of space structures, this section outlines the extension of the bar
element to three dimensions.
The two-node, prismatic, three-dimensional bar element is shown in Figure 21.15. It has two nodes
and six degrees of freedom. The element node displacements and congugate forces are
u x1 f x1
u y1 f y1
u f
u(e) = z1 , f(e) = z1 . (21.13)
u x2 f x2
u y2 f y2
u z2 f z1
21–15