

Chapter 8
Theory and Implementation of the Finite Element Method
8.2 The Finite Element Method for dynamic linear elasticity
In this section, we show how to extend the finite element method to solve dynamic problems. Specifically: 1. The principle of virtual work is used to derive a discrete system of equations for the (time varying) nodal displacements 2. Three methods for integrating the equation of motion with respect to time are presented: (i) explicit timestepping; (ii) implicit time stepping; and (iii) modal analysis.Â The properties of each scheme are illustrated by solving simple problems. 3. As always example codes are provided so you can see how the method is actually implemented, and explore its predictions for yourself.
8.2.1 Review of the governing equations of dynamic linear elasticity
As before, we begin by summarizing the governing equations for a standard dynamic linear elasticity problem.Â Â Given: 1. The shape of the solid in its unloaded condition 2. The initial stress field in the solid (we will take this to be zero in setting up our FEM code) 3. The elastic constants for the solid 4. The thermal expansion coefficients for the solid, and temperature distribution (we will take this to be zero for our FEM code, for simplicity) 5. The initial displacement field in the solid , and the initial velocity field 6. A body force distribution Â acting on the solid (Note that in this section we will use b to denote force per unit volume rather than force per unit mass, to avoid having to write out the mass density all the time) 7. Boundary conditions, specifying displacements Â on a portion Â or tractions Â on a portion Â of the boundary of R
Calculate (time varying) displacements, strains and stresses Â satisfying the governing equations of dynamic linear elasticity 1. The straindisplacement equation 2. The elastic stressstrain law 3. The equation of motion for stresses 4. The boundary conditions on displacement and stress
8.2.2 Expressing the governing equations using the principle of virtual work
Just as for static problems, the principle of virtual work can be used to write the governing equation for the displacement field in a linear elastic solid in an integral form (called the `weak formâ€™).Â Instead of solving the governing equations listed in the preceding section, the displacements, strains and stresses Â are calculated as follows.Â 1. Find a displacement field Â satisfying
for all virtual velocity fields Â satisfying Â on . 2. Compute the strains from the definition 3. Compute the stresses from the stressstrain law The stress will automatically satisfy the equation of motion and boundary conditions, so all the field equations and boundary conditions will be satisfied.
You can derive this result by following the method outlined in Section 8.1.2.
8.2.3 The finite element equations of motion for linear elastic solids
1. As before, the displacement and virtual velocity fields are interpolated between nodal values as Â Â Â Â Â Â 2. Substitute into the virtual work equation to see that
3. This is once again a linear system which may be expressed in the form
where
are the finite element stiffness matrix and force vector introduced in Section 7.2, and
is known as the finite element mass matrix.Â Procedures for computing the mass matrix are given below. 4. Again, since the principal of virtual power holds for all virtual velocity fields such that Â for Â on Â we conclude that this requires
Nodal velocities must also satisfy initial conditions. This is a set of coupled secondorder linear differential equations that may be integrated with respect to time to determine Â as a function of time.Â Observe that Â and Â are constant matrices for linear elastic problems, but Â will in general be a function of time.
To find the solution, we now need to integrate these equations with respect to time. Â For linear problems, there are two choices 1. Bruteforce time stepping methods (e.g. Newmark time integration).Â This technique can be used for both linear and nonlinear problems. 2. Modal methods, which integrate the equations of motion exactly.Â This method only works for linear problems.
Both methods are described in detail below.
8.2.4 Newmark time integration for elastodynamics
The general idea is simple.Â Given values of Â and Â at some time t, we wish to determine values at a slightly later time , using the governing equations of motion.Â There are of course many ways to do this.Â Here, we will present the popular â€˜Newmarkâ€™ time integration scheme.
Newmark method for a 1 DOF system: It is simplest to illustrate the procedure using a 1DOF system (e.g. a forced,Â undamped springmass system) first.Â Â For this case the equation of motion is
where f(t) and the initial conditions Â are given.
Suppose
that we are able to get estimates for the acceleration Â and Â both at the start and end of a general time
step .Â We could then use a
Here, Â and Â are two adjustable parameters that determine the nature of the time integration scheme.Â If we set Â the acceleration is estimated based on its value at time t.Â This is known as an explicit time integration scheme.Â Alternatively, if we put , the acceleration is estimated from its value at time .Â This is known as implicit time integration.
The acceleration at the start and end of the time step is computed using the equation of motion.Â At time t we have
while at time
This then gives us the following time stepping scheme: Given: k, m, f(t), 1. At t=0 compute . 2. Then for successive time steps, compute
Newmark applied to FEM equations: This can immediately be extended to the general n DOF case as follows. Given , , , 1. AtÂ t=0, compute 2. Then for successive time steps, solve
for 3. Then compute
8.2.5 1D implementation of a Newmark scheme.
It is straightforward to extend a static FEM code to dynamics.Â As before, we illustrate the method in 1D before developing a 3D code.
Consider a long linear elastic bar.Â Assume 1. The bar has shear modulus Â and Poissonâ€™s ratio Â Â and mass density ; 2. The bar has cross section Â and length L; 3. The bar is at rest and strain free at t=0 with Â 4. It is constrained on all its sides so that 5. The bar is subjected to body force , 6. The bar is either loaded or constrained at its ends, so that the boundary conditions are eitherÂ Â or displacement Â at x=0 and x=L.Â
For this 1D example, then, the finite element equations reduce to
where
We adopt exactly the same interpolation scheme as for the static solution, and calculate stiffness matrix and force vector accordingly.Â In addition, we need to determine the mass matrix.Â This can also be done by evaluating integrals for each element by numerical quadrature, and then assembling element mass matrices into a global matrix.Â Specifically,
Â Â For each element, compute the element mass matrix. The mass matrix can either be evaluated by numerical qudrature, by evaluating the formula
where
and the integration points Â , and shape functions Â were listed in Section 7.2.5. Note that that a higher order integration scheme is required to integrate the mass matrix than we needed for the stiffness matrix.Â Specifically, for quadratic elements we need a cubic
Â integration scheme (with 3 integration points) while for linear elements we need a quadratic scheme (2 integration points).Â If the mass matrix is underintegrated it will be singular (you can check this out using the example code provided below).Â Alternatively, the mass matrix can be integrated analytically (a table is given on the right) Â Â Assemble the contribution from each element to the global mass matrix Â Â Modify the stiffness and mass matricesÂ to enforce the constraints Â Â Run the Newmark timestepping scheme outlined above.
8.2.6 Example 1D dynamic FEM code and solution
A simple example MAPLE code for this 1D example is given in the file FEM1D_newmark.mws.Â It is set up to solve for displacements for a bar with the following properties: 1. Length 5 and unit unit xsect area, 2. Mass density 100; shear modulus 50, Poissonâ€™s ratio 0., (so the wave speed is 1); 3. Â No body force,Â displacement u=0 at x=0, and traction t=10 applied at x=L suddenly at t=0 and then held constant for t>0
As an example, we plot the variation of displacement at the end of the bar (x=L) with time.Â You should be able to verify for yourself that the exact solution is a sawtooth, amplitude 0.5 and period 20 (the time for a plane wave to make two trips from one end of the bar to the other) Â Notice how the peaks of the sawtooth are blunted Â this is because the FEM interpolation functions cannot resolve the velocity discontinuity associated with a propagating plane wave.
The MAPLE file produces animations of the displacement and velocity field in the bar.Â In the exact solution, a plane wave propagates down the bar, and repeatedly reflects off the free and fixed ends of the bar.Â You can see this quite clearly in the simulation results, but the wavefront is not sharp, as it is supposed to be.Â This gives rise to spurious high frequency oscillations in the velocity fields.Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
It is interesting to investigate the effects of the two adjustable parameters in the time integration scheme.Â
First, we look at the solution with Â (both velocity and displacement update are fully explicit).Â The plots below show the predicted displacement at the end of the bar for two values of time step Â Â Â Â Â Â Â The result with smaller time step is good, but with a larger time step the solution is oscillatory.Â This is an example of a numerical instability, which is a common problem in explicit time stepping schemes.Â Eventually the solution blows up completely, because the oscillations grow exponentially.Â With a small enough time step an explicit scheme will usually work, but the critical time step for stability is proportional to the time required for a wave to propagate through the smallest element in the mesh.
With larger values of Â the problem disappears.Â In fact, one can show that for the equation of motion considered here, setting
makes the time stepping scheme is unconditionally stable Â no oscillations will occur even for very large time steps. Â
Stability does not necessarily mean accuracy, however.Â Results with a fully implicit integration scheme ( Â ) and a large time step are shown on the right (set dt=0.5 in the example code).Â This shows a different problem Â energy is dissipated due to the numerical time integration scheme.Â Â So, larger values of Â buyÂ stability by introducing artificial damping, at the expense of a loss of accuracy.Â A good compromise is to set .
In the Newmark time integration scheme, accelerations are computed by solving a set of linear equations
This is the most timeconsuming part of the procedure.Â But notice that if we set Â and somehow find a way to make the mass matrix diagonal, then equation solution is trivial.
The socalled `lumpedâ€™ mass matrix is a way to achieve this.Â Instead of using the correct element mass matrix
we replace it with a diagonal approximation.Â Various procedures can be used to do this.Â
1. Integrate the mass matrix using integration points located at the element nodes 2. Diagonal scaling procedure: Set Â and , with the constant c selected to satisfy 3. Rowsum method: Set Â and .
In general, the three approaches give different answers.Â For some element types, it turns out that some of these procedures give zero or negative masses, which is clearly undesirable.Â Â Use whichever method gives the best answers.
Explicit time integration with a lumped mass matrix has been implemented in the 1D FEM code FEM1D_newmark.mws. To use a lumped mass matrix, find the line in the file that reads > Â Â Â Â Â Â Â lumpedmass := false: and change it to > Â Â Â Â Â Â Â lumpedmass := true: As an example, the figure on the right shows the predicted displacement at the end of the bar with relatively large timestep (set dt=0.1, beta1=1 and lumpedmass=true in the code to reproduce the result)
In general lumped mass matrices introduce some additional damping which can help stabilize the time stepping scheme, but lead to some accuracy loss.Â You can see this in the result shown in the figure.Â Using a smaller timestep reduces the energy loss.
Explicit time integration is cheap, easy to implement and is therefore a very popular technique.Â Its disadvantages are that it is conditionally stable and can require very small timesteps (the critical step size for stability is proportional to the size of the smallest element in the mesh and inversely proportional to the wave speed).Â
8.2.8 Example 2D and 3D dynamic linear elastic code and solution
It is straightforward to extend a 3D static linear elasticity code to timedomain dynamics.Â As an example, the Maple code outlined in Section 8.1.14 has been extended for this purpose. 1. The code is in a file called FEM_2Dor3D_linelast_dynamic.mws.Â You will need to modify the line of the code that reads the input file to point to wherever you store the input file, as described in 8.1.14. 2. An input file that sets up a simulation of the vibration of a cantilever beam that is subjected to a transverse force at its end is provided in the file Linear_elastic_dynamic_beam.txt.
The format for the input file is described in detail in Section 8.1.14.Â The mesh is assumed to be at rest at time t=0, and any loads are applied as a step and held constant for t>0.Â You can always extend the code to do more complex loadings if you need to.Â The motion of the beam is animated at the end of the file.
8.2.9 Modal method of time integration
The finite element equations
are a standard set of coupled, second order linear differential equations such as one would meet in analyzing forced vibrations in discrete systems.Â They can therefore be solved using the usual modal techniques.Â The procedure is to rearrange the system of equations to yield n decoupled 2^{nd} order differential equations, by means of the following substitutions.Â We will drop index notation in favor of matrix notation. 1. Write the governing equation as 2. Let Â Â Â Â Â Â Â Â Â Â Â Â Â and substitute for u
3. Note that H is a symmetric, positive definite matrix.Â Consequently, we may perform a spectral decomposition and write
where Q is an orthogonal matrix ( Â ) and Â is diagonal.Â This spectral decomposition is accomplished as follows: compute the eigenvalues Â and corresponding normalized eigenvectors Â of H (normalized to satisfy Â ), then set
4. Next let Â and rearrange the equation of motion a second time to get
Since Â is diagonal this is now a set of n uncoupled ODEs for w. 5. The initial conditions for w follow as
6. Solve the decoupled ODEs for w, thenÂ recover the displacements through
You can use any method you like to solve the ODEs for w Â for harmonic forcing you could use the exact solution.Â For general F(t) you could use Fourier transforms (the FFT works for periodic F).Â You could even use the Newmark algorithm if you want, although this would be rather perverse!
Effectively, this procedure reduces the general forced FEM problem to an equivalent one that involves solving the equations of motion for n forced, springmass systems.
8.2.10 Natural frequencies and mode shapes
The procedure outlined in 8.2.9 can also be used to extract the natural frequencies and mode shapes for a vibrating, linear elastic solid.Â To see how to do this, note that 1. By definition, the natural frequencies and mode shapes of a continuous solid or structure are special deflections and frequencies for which the solid will vibrate harmonically. 2. The governing equations for w can be regarded as describing the vibration of n uncoupled springmass systems; 3. If we solve the problem with F=0, and excite only the ith springmass system (e.g. by choosing appropriate initial conditions), the solution will be a harmonic vibration at the natural frequency of the ith springmass system.Â 4. The natural frequencies of the n decoupled systems are therefore the natural frequencies of vibration of the structure.Â The corresponding eigenvectors Â are related to the deflections Â associated with the ith vibration mode through .
The following procedure can be used to determine the natural frequencies and mode shapes of a linear elastic solid: 1. Compute the finite element mass and stiffness matrices M and K 2. Find 3. Compute the eigenvalues Â and corresponding eigenvectors Â of H 4. The natural frequencies , are related to the eigenvalues of H by Â . 5. The deflections Â associated with the ith vibration mode follow as . The deflections calculated in this way will have some random magnitude Â if you like, you can normalize them appropriately.
The procedure is simple on paper (as always) but there are two problems in practice.Â First, we need to find the square root of the mass matrix.Â For a general matrix, we would have to compute a spectral decomposition of M to do this.Â However, if we use a lumped mass matrix, its square root is easily found Â just take the square root of all the diagonal elements!Â Secondly, computing all the eigenvalues and eigenvectors of a general dynamical matrix H is an exceedingly time consuming process.Â To make this a viable scheme, we normally extract only the lowest few eigenvalues and the corresponding eigenvectors (say 10 to 100), and discard the rest.Â
8.2.11 Example 1D code with modal dynamics
As an example, a version of the 1D code with modal dynamics is provided in the file FEM_1D_modal.mws
The code is set up to plot the displacements associated with the fundamental (lowest frequency) vibration mode, as well as to calculate the displacement of the end of the bar as a function of time.Â The code will handle computations with a full mass matrix as well as a lumped matrix, so you can compare the results with the two cases.Â
The plots below show the mode shape (displacements) for the fundamental vibration mode, and the predicted motion at the end of the bar.Â The code will also animate the displacement in the bar (not shown here).
Â Â Â Â Â Â Â Â Here is a brief comparison of the Newmark and modal time integration schemes: 1. For linear problems the modal decomposition method usually beats direct time integration in both accuracy and speed. 2. If you are interested in looking in detail at transient wave propagation through the solid there is not much difference between the two methods Â in this case you need to retain a huge number of terms in the modal expansion for accurate results. 3. For most vibration problems, however, it is generally only necessary to retain a small number of modes in the expansion, in which case the modal decomposition method will be vastly preferable to direct time integration.Â Moreover, knowledge of the vibration modes can itself be valuable information. You can use also use the modal approach to handle very complex forcing, including random vibrations, directly. 4. The main limitation of the modal decomposition approach is that it can only handle undamped, linear systems (one can introduce modal damping for vibration applications, but this does not model any real energy dissipation mechanism).Â This is of course far too restrictive for any real application except the simplest possible problems in vibration analysis.
8.2.12 Example 2D and 3D FEM code to compute mode shapes and natural frequencies
It is straightforward to extend a 3D static linear elasticity code to modal dynamics.Â 1. An example program is provided in the file FEM_2Dor3D_modeshapes.mws; 2. The code can be run with the file Linear_elastic_dynamic_beam.txt Â it computes and plots mode shapes for the beam as shown below (you need to edit the code to select which mode is displayed)


(c) A.F. Bower, 2008 