0% found this document useful (0 votes)
17 views

NotesDay5 9

Uploaded by

Antonio Benigni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
17 views

NotesDay5 9

Uploaded by

Antonio Benigni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 37
Day 5 Continuum modelling (1) ‘The truss structures considered previously were already discretized structures. In the following chapters, it is shown how the Finite Element method can be used to solve continuum type problems by discretizing them into a large number of finite elements. ‘The derivations today will be performed for 2D linear elasticity. ‘This chapter should be read as a supplement to (Cook et al. 2002), Chapters 3-3.3 and 3.6, 5.1 Constitutive models for 2D linear elasticity ‘The relations between Cauchy (or engineering) strains and displacements for 2D linear elasticity under the assumption of small displacement gradients and thereby small strains can be written as au av 1 (au, av ened ean and ened (M42) en the strain and stress vectors are defined as en on {e}=4 en } and {o}=4 on p. 62) 2e2 or ‘The relation between stresses and strains are given by Hooke’s law (constitutive relation) {o}=[Ci{e}, 63) where the constitutive matrix [C] written with tensor terms is Cun Crm Cin C)= | Chaz Coz Cari 64) Cuz Caz Can For isotropic materials and plane stress or plane strain assumptions, the constitutive matrix takes two different forms lv 0 (Clotane sress vio 0 5) 0 0 (1-v)/2 where —1 6). Based on the principal stresses, the von Mises stress can be found as Gum = y/ OF +03 — 0102. 627) 5.7. EXERCISES 29 5.7 Exercises ‘The handout Fortran code (available on DTU Learn) works on Windows platforms and we suggest using Code::Blocks along with the build-in GNU Compiler. ‘The Code::Blocks plat- form is pre-installed on the computers in the databar. For Windows-users a “Getting started with Code::Blocks” instruction can be found in the same zip-file holding the code. Other plat- forms/compilers may also be used on your Laptop but here you must be able to set the system, up yourselves. To get started with today’s exercises: ‘* Download and extract the “Day5basisCode.zip" file from the course homepage to a folder on your X-drive. ‘© Unzip the file and find the pdf-file “Getting started with Code:-Blocks” and follow the instructions herein. ‘* The file “FEM_fortran.cbp” holds a predefined project which you need to load into Code::Blocks. And now to some related preparations ‘+ In the handout Fortran program, the force vector is fixed to be a zero vector with -0.1 in DOF 6. Modify it such that it can handle any input forces given by an input file Hints: Write a small do loop that runs over the input load matrix loads as you did in the Matlab code. Note, however, that an extra column (first column) has been added to the loads matrix. The indices in the first column decide whether the load is a point load (oads (i, 1)=1) or an element surface load (Loads (i ,1)=2).. jut file in order to solve the truss problem from Figure 1,3. Hint: Modify the "example" input file to do this. Check the results with your Matlab code. ‘Also check the result with a larger truss structure. ‘* Run the Fortran code with the input file "continuum!". Change the input file such that ‘you obtain the problem shown in Figure 5.1 0.005 4 Ras . Y ‘Figure 5.1: 6-element cantilever beam, ‘The handout Fortran code solves truss problems and plots both truss and continuum strue- tures (continuum structures only after you have assembled the stiffness matrix). Modify it such that it can calculate the nodal displacements of continuum structures discretized by 4-node rectangular elements. Hint: The element stiffness matrix for rectangular 4-node 30 DAY 5. CONTINUUM MODELLING (1) elements is given in the subroutine plane42rect (part of the "plane42rect”-module). Use the problem from Figure 5.1 as a test case! Exercise 5.1 Implement distributed (traction) loads in the Fortran program and verify with comparisons to ‘an analytical solution. ‘The input file statement for surface tractions (pressure) is, SFE,elemi,face#PRES,0,15. apply pressure of 15 across face facet of ele- ‘ment elem# ‘The "input" subroutine converts this line to a row in the Loads matrix e.g. (2,elemi#,face#,15), where the first number is the code (2) for surface loads. For modeling of surface tractions, element face numbers are I, 2, 3 and 4, to the lower, right, upper and left edges. Note that the commercial FE-software ANSYS only can model surface tractions as pressure loads, i.e. perpendicular to the surface. Since we try to follow the ANSYS input format, our input format does the same, The pressure loads are always. positive into the cell Hint: The "Nface” matrix is already calculated for the four different cases in subroutine “plane42rect_re", where for example for face 1 [Nface [ “iM ete. (5.28) In order to calculate the consistent nodal loads corresponding to the surface tractions, you should multiply the particular [Nface] matrix with the load vector {F} = {F; Fy}? for that edge. ‘The "plane42rect_re" routine is called with the command-line call plane42rect_re(xe, eface, fe, thk ,re) where the input variables are element nodal coordinates, face number, pressure value, element thickness and the output is the element load vector. You may validate the program on a structure as seen in Figure 5.2 where you use distributed loads instead of the point loads. The horizontal displacements at the right edge should all be the same! Solve a beam bending example with distributed loads (for various Poisson's ratios, thick- nesses, lengths and widths) and compare with analytical solutions. Use a fine discretization to get reliable results Hint: The input file format for element thickness is Rw,17 define thickness value of 17 for material prop- erty number r# TNote that this example i only intended for test purposes. Practical problems always require at least hundreds and beter thousands of elements forthe discretization inorder to get reliable results 5.7. EXERCISES 31 Exercise 5.2 Compute element strains and stresses (e.g. €1, 622, etc.) for the simple test case in Figure 5.2 and compare with analytical values. Hint: Compute strains and stresses (in the centroid (¢=y=0)) in the subroutine "plane42rect_ss”, Call the plotting routine "plotmatlabeval" with a vector containing the stresses (from the "displ" subroutine). The "plane42rect_ss” routine is called with the command-line call plane42rect_ss(xe, de, young, nu, estress, estrain) where the input variables are clement nodal coordinates, Young’s modulus and Poisson's ratio and the outputs are the element stress and strain vectors, F-0.005 F=001 F=0.005 @ igure 5.2: 6-element cantilever beam, *Exercise 5.3 Implement volume loads and demonstrate this by an example, Hint: Write a subroutine very similar to the "plane42rect_re” subroutine, Use also that ab 0 ab 0 ab 0 ab 0 aps T dy de vot [ h WM dyds~ | 9 ab 0 ab 0 ab 0 ab 65.29) The input-file syntax for volume (acceleration) loads is MP,.DENS,1,7.1 define material specific density of 7.1 (kg/m) ACEL,ax,ay,0 apply acceleration in x-direction (ax) or y- direction (ay) ‘The acceleration values are saved in the vector accel ={ax ay}. DAY 5. CONTINUUM MODELLING (1) Day 6 Continuum modelling (II) and equation solving ‘This chapter discusses efficient solving and storage of the FE-equations as well as stress and strain computations. The chapter should be read as a supplement to Chapter 2.8 and Appendix B in (Cook et al. 2002). 6.1 Solution of Systems of Linear Equations Until now, we have been solving the governing finite element equations without concern for how this is accomplished. Now, we examine the numerical methods that form the basis for their solution. In particular, the solution of systems of linear equations of the form [A] {X} = {B} repeatedly arises in the finite clement analysis and its design sensitivity analysis. Recall that the displacement {D} for the linear finite element solution is computed from [K]{D} = {P}, the displacement update {AD} for the nonlinear finite element solution by the Newton-Raphson method is computed from [K;] {AD} = {F}, and the displacement sensitivity 421 with respect toa p® design variable is computed by [K] 42! — 441 {1} in the direct differentiation method. ‘Therefore, we investigate the numerical solution for the unknown state n-vector {D} of the general system [K]{D} = {P} 6.1) after assembling the n xn coefficient matrix [&] and right-hand-side n-vector {P}. We assume that we have 7 linearly independent equations available to solve for n unknown states. We denote the entries of the coefficient matrix [K] by ki for equation row i= 1,--- ,n and unknown state column j= 1,-+-,n and the entries of {D} and {P} by d; and pi, respectively. ‘As an example problem, we want to determine the displacement d; for each node i of the one-dimensional three-spring system, i.e. di, dz, and ds, depicted in 6.1. Each linear spring Py Figure 6.1: One-dimensional three-spring system, Left end is supported and there are three unknowns (n = 3). 33 34 DAY 6. CONTINUUM MODELLING (Il) AND EQUATION SOLVING clement ¢ has a stiffness ke, i.e. kr, ka, and ky, and an external force p; is applied at the each node i, ie. pi, pp, and ps. When we use Newton’s second law to express static equilibrium, the system of equations satisfy (ki +ke)di kad = pr (6.2) ky dy + (ke + ks)d2 — kad Pr (6.3) ksdy+hady = ps 4) Note that the coefficients ki) are constant and independent of the unknown displacement states di, and therefore, this is a system of linear (in {D}) equations. Alternatively, the system of {P} as Pi pr (65) P Let us assume that the spring stiffnesses and external forces are ky = ky = ky = 1, pi = Pp2 = 0, and ps = | so that the resulting system is 2 -1 0 dy 0 12 -1/) & 0 (66) 0-11 ds 1 How do you solve such a system of equations 6.1.1 Gaussian Elimination Perhaps the most common approach to solve a system of linear equations is Gaussian elimi- nation. ‘Through a sequence of elementary row operations on |K]{D} = {P}, the coefficient matrix [K] is reduced to upper triangular form, and then the resulting upper triangular system is readily solved for each d by backward substitution. To reduce the n xm [K] matrix to upper triangular form, we eliminate unknowns d, for s=1,-- m= from the s+ 1 to m equations of [K] {D} = {P}. Let us return to our example in (6.6). If you multiply equation 1 by and add it to equation 2, then the unknown dy is removed from the new equation 2, ic. 2-1 0 dy 0 0 3-1/4 & $=)0 7) or isla 1 ‘The pivot value of } arises by dividing the coefficient of the unknown dj we are trying to eliminate, i. kz; =—1 in row 2 and column 1, by the negative of the current diagonal entry corresponding to the unknown we are trying to eliminate, Le. (—)k11 = (—)2 in row 1 and column 1. Note that we did not need to eliminate dy from equation 3 because its corresponding, coefficient is zero, ie. ks, = 0 in row 3 and column 1. However, if we want to construct a systematic algorithm, we multiply equation 1 by the pivot value of (—)2 = 0 and add it to equation 3 to get a "new" equation 3. Similarly if the new equation 2 is multiplied by 2 and added to equation 3, then the unknown dy is removed from the new equation 3, The pivot value of 2 arises by dividing k, = —1 in row 3 and column 2 by (—)k,) = (—)3 in row 2 and column 2. The resulting system of equation reduction by triangulation is 2-1 07(a 0 03-1 dy p=9 0 (6.8) 00 tila 1 6.1. SOLUTION OF SYSTEMS OF LINEAR EQUATIONS 35 We can express this in algorithmic form as DOs = 4, at DO i= st, a a = K(i,s)/K(s,s) PCG) = PC) ~ axP(s) DO j= st, a KG, 3) = KG,j) - aekG, 5) END DQ END DO END DO Now, we can easily determine unknowns d; for i= n,--- , by solving the 1* ton equations by backward substitution. For our example, the third equation of (6.8) reduces to ds = 3. By back substituting d3 = 3 into the second equation of 6.8, d2 =2. Similarly, d ~ 1 after backward substitution, In algorithmic form, the backward substitution is accomplished by D(m) = P(n)/K(n,n) DOi=n-1, 1, -1 a= PG) DO j= itt, a a =a - KG,j)4D(5) END DO DG) = a/K(4,4) END DO ‘There are a couple of noteworthy items. First, the numerical method fails whenever the diag- onal entry ki of the pivot value is numerically zero. This can be circumvented by swapping rows of equations (partial row pivoting) so that a nonzero diagonal entry is always available. First, of course, if the coefficient matrix [K] is singular, ic. the system contains equations that are linear combinations of other equations (linearly dependent equations) which render [K] uninvertible ', a zero pivot entry will appear whether we use partial (or full row and column) pivoting, and therefore we cannot find a unique solution, Second, we modify both the coefficient matrix [K] and the right-hand-side vector {P}. Third, we have not taken advantage of the structure of the stiffness matrix [K] that we commonly encounter in the finite element method. The storage of (K] in computer memory and the computational expense are critical issues, particularly for large problems, We address the second and third issues in the next section. 6.1.2 LU Decomposition Gaussian elimination is the basis for more efficient numerical methods that directly solve sys- tems of linear equations. More efficient algorithms are based on the idea of decomposing the coefficient matrix [K] into a form that does not require modification of the right-hand-side vec- tor {P}. Consequently, the solutions for multiple right-hand-sides can be efficiently solved after decomposing the coefficient matrix once. In LU decomposition, the n x n coefficient matrix [K] is decomposed into [kK] = [d)(U] 69) T Symboliealy, we are solving {D) = [K]~!{P} where (K]-1 is the inverse of the coefficient matrix (K]. Ifthe inverse [K] ' does not exist ic. [K] is singular, then a unige solution {D} does not exist. However, notice that wwe do not expiily assemble the inverse (&) by Gaussian elimination 36 DAY 6. CONTINUUM MODELLING (Il) AND EQUATION SOLVING where [L] is an x n lower unit triangular matrix, ie. nonzero entries below the unity diagonal and zero entries above the diagonal, and [U] is a n Xn upper triangular matrix, ie. nonzero entries above the nonzero diagonal entries and zero entries below the diagonal. The decompo- sition of [K] into [L] and [U] is not unique. In practise, one does not need to form additional matrices for the lower and upper forms. Instead, all computations can be performed by altering the original stiffness matrix. ‘The approach we describe here is not rigorous. If you want more details, e.g. for properties of lower unit triangular matrices, please consult more comprehensive linear algebra references, We utilize two aspects of the basic Gaussian elimination algorithm. First, [K] is reduced to upper diagonal form, i.e. [U), by the process of Gaussian elimination. Here, we assign [U] to the upper diagonal form produced by the Gaussian elimination, ie -1 0 3 oli. 6.10) Second, pethaps you recognized that we discarded the pivot information that was used to reduce the coefficient matrix to upper diagonal form in the Gaussian elimination, Therefore, it seems logical that the lower unit triangular matrix (Z] should contain the pivot information that is used to reduce the [K] matrix to an upper triangular matrix [U]. For the [U] from our Gaussian elimination, it conveniently turns out that the entries of [Z) consist of the negatives of the pivot values required to eliminate a leading unknown from any equation. Returning to our example, ‘we multiply equation 1 of (6.6) by the pivot value of + and add it to equation 2 to remove the unknown dj from the new equation 2. Therefore, the negative of the pivot value (~)} is placed in row 2 and column 1 of [L), ie 21 = —4.. Similarly, /s1 = 0 and ly = —3 so that 1 00 10 (6.1) 2 o 21 where the diagonal entries are set to unity. One may verify that the method outlined above satisfies [K] = [L][U]. We can express this in algorithmic form as DOs = 1, at DO i= et, a KG,s) = KG,s)/K(s,s) DO j= ett, KG,j) = KG,j) - KG,s)*K(s, 5) END DO END DO END DO This algorithm has been coded into a Fortran 90 subroutine called factor in the numeth module. Now that [K] has been decomposed into [L] and [U], we compute the solution {D} by a two-step process of forward substitution u(y} = {P} (6.12) and backward substitution U\{D} = {¥} 6.13) 6.1. SOLUTION OF SYSTEMS OF LINEAR EQUATIONS 37 since [K] {D} = [L][U]{D} = {P}. The forward and backward substitutions are efficient com- putations because [C] and (U] are triangular matrices. In algorithmic form, forward substitution using (J) is accomplished by DOi= 2,0 a-0 Dojr4, at apa - KG,j) * PG) END DO PG) = PG) +a END DO and the solution {D} is computed by backward substitution using [U] via P(n) = P(n)/K(n,n) DOi=n-4t, 1, -1 a=0 DO j= itt, a a =a - KCi,j)4P(5) END DO PCi) = a/KG, i) END DO Note that the right-hand.-side vector {P} is overwritten by the solution {D}. This algorithm has been coded into a Fortran 90 subroutine called solve in the numeth module. In terms of storage cost, the full [K] matrix requires n entries. The computational expense of the decomposition and substitution is about n° /3 and 1? (n? /2 for forward and backward sub- stitution each) multiplication operations, respectively. Clearly, the decomposition task is more computationally expensive than the forward and backward substitutions for large problems. 6.1.3 Band storage A property of the stiffness matrix [K) in (6.5) (and (6.6)) is thatthe nonzero entries form a band along the diagonal of the matrix ®, We define the half (or semi-) bandwidth bw of [K] as the largest (integer) distance plus one between the diagonal and a nonzero row entry below it over all columns in [K). In equations (6.5) (and 6.6) , bw = 2. The key point is that only zero entries appear outside of the half bandwidth bw, so we need not store the entire [K] matrix. Therefore, returning to our example in equation (6.5), we actually store the symmetric, banded n x n [K] matrix in banded bw ) in the exercises at the end of this chapter. The sketch in Figure 6.2 may help you in the programming of the band storage. As a result of the banded matrix storage, the algorithm for the decomposition of the symmetric, banded [K] matrix is modified to Tin MATLAB, the span ofthe nonzero entries in [K] can be readily viewed by the spy command, ie >> spy(K) 38 DAY 6. CONTINUUM MODELLING (Il) AND EQUATION SOLVING DOs=4,0 Doi = 2, bw IF (KG,s) t= stil a= K(i,s)/K(1,8) n-0 DO j= 4, bw m= mitt K(m,t) = K(m,t) - a*k(j,s) END DQ KG,s) END DO END DO 0) CYCLE and the solution {D} is computed by forward substitution and backward substitutions, i.e. DOs=1,2 DO i = 2, bw IF (K(i,s) t= sti-d 0) CYCLE P(t) = P(t) - KG,s)*P(s) END DO P(s) = P(s)/K(1,8) END DO and DO i = 2, bw IF (K(i,s) t= stint P(s) = P(s) ~ KCi,s)#P(t) END DO END DO 0) CYCLE ‘These algorithms have been coded into Fortran 90 subroutines called bfactor and bsolve in the numeth module, Figure 6.2: Foll matrix and band storage. The black lines indicate rows and columns inthe full and banded matrix modes, ‘The storage requirement for the symmetric, banded (R] matrix is bw x n entries. Therefore, the storage requirement is reduced by a factor of about bw x n/n? = bw/n compared to the full 6.1. SOLUTION OF SYSTEMS OF LINEAR EQUATIONS 39 [R] matrix storage. In terms of computational expense, the decomposition requires bw? x n/2 multiplication operations, and the forward and backward substitutions require about bw x m multiplication operations each. We can further reduce our stiffness matrix memory requirements by storing [&] in skyline or sparse matrix form. In skyline matrix form, we recognize that the local half bandwidth bw varies in each column, and therefore we only store entries corresponding to local bandwidts. For sparse matrices, we only store the nonzero entries. The impact on the decomposition efficiency depends on the sparsity of the [K] matrix. If many zero entries appear within [K], then sparse matrix decomposition is computationally efficient. However, the more dense [K] is, the less efficient are sparse matrix computations. Before we leave this section, it is important to note that you, the finite element analyst, cannot afford to blindly construct finite element meshes without concer for the numerical methods employed to solve the finite element problem. As an example, let us return to our three-spring example problem. Rather than assign nodal numbers as depicted in figure 6.1 suppose that we define the nodes as depicted in figure 6.3, i.e. by swapping node 2 and node 3 of figure 6.1. This may seem rather innocuous to you, but as you will see, the ramification Figure 6.3: One-dimensional three-spring system with reordered nodal numbering, on the efficiency of the numerical method can be dramatic (or traumatic for extremely large problems). The system of equations satisfy (ki + ka) di— kad (6.15) ksd)—kad3 = po (6.16) ‘Kd —kydz + (ko +ks)ds = ps. 6.17) that is expressed in [K] {D} = {P} form as, 2 0 -1)(a 0 O 1-1) ae b=od (6.18) -1-1 2 a 0 where ky = ky = ks = 1, p1 = ps =0, and pp = 1 as equivalently defined before. If we solve the system of equations by LU decomposition, then we compute the solution dy = 1, d2 =3, and ds =2 which mirrors the previous results. Note that our storage requirement and computational expense are the same as before since we did not take advantage of the structure of [&]. However, if we store (K] in symmetric, banded form as ki ka iss 2 12 (R= | kr kes =| 0 -1 (6.19) 3 1 the half bandwidth bw = 3, The previous storage requirement for the symmetric, banded [K] matrix was bw x n = 6 entries, but the current storage requirement for [R] is now bw xn = 9 entries, ‘Similarly, the previous computational cost for the decomposition of the symmetric, 40 DAY 6. CONTINUUM MODELLING (Il) AND EQUATION SOLVING banded [R] matrix was about bw? x n/2— 4 multiplication operations, but now the computa~ tional cost is bw? x n/2 = 13.5 multiplication operations. Clearly, we did not order the nodes to our best advantage. You, the finite clement analyst, generate the finite clement mesh, and there- fore, you clearly want the half bandwidth bw to be as small as possible. This nodal reordering process can be automated and optimized to minimize the bandwidth, e.g. by the Gibbs-Poole- Stockmeyer algorithm. 6.1.4 Iterative Methods In contrast to the previous methods that directly solve [K] {D} = {P}, ic. direct methods, there exists a number of iterative methods that never perform the full factorization (or assembly) of the stiffness matrix. More or less elaborate schemes, like e.g. Gauss-Seidel, Conjugate Gradient (CG), or Generalized Minimal Residual (GMRES), that exploit the structure of [K] can be found in the literature. The advantage of iterative methods is that they are easier and more efficiently solution can be using parallel computing, but the disadvantage is that the convergence properties can be slow (or diverge) depending on condition numbers. Development of efficient linear solvers for large scale FE-calculations is a research area of its own. Using the right solver for a specific problem can decrease the computational time by orders of magnitude. 6.2 Exercises Before starting todays exercises it is recommended to copy the contents of the directory you used on DAY 5 to a new directory and use this as the new working directory. Only copy the Fortran and include files to the new directory. It is highly recommended to start a new project when you work in a new directory to avoid mismatches in file paths. Exercise 6.1 Implement band storage of the global stiffness matrix and solve the FE-equation using ("bfac~ tor" and "bsolve"). Hint: Remember to declare the size of the stiffness matrix in subroutine “initial”, Test it on the problem from Figure 5.1 (it must also work for truss structures where you can compare with your Matlab code). There is a logical parameter named "banded" and a parameter for the bandwidth "bw" in the fedata module which are predefined for you. A few Fortran lines that will print the stiffness matrix in a compact format are DOi=1, bw print "(24(F4.2,tr1))", kmat(i,l:neqn) END DO PAUSE Use "FiExtract” to generate Fortran input files for large (ie, many elements) continuum structures and investigate time savings associated with the switch to band storage format. Hint: For time measurements in the Fortran code you may use the "stopwatch" routine given in the processor-module to measure cputime. The stopwatch is started by inserting the line "stop- watch(’star’)” in the Fortran code and the stopwatch is stopped (and the epu-time is printed) by inserting the line "stopwatch(’stop’)" in the Fortran code. Switch off all debug options in the Fortran compiler during timing comparisons to get the best computational efficiency. Compute and plot Von Mises stresses (in the element centroids) and plot them for some more complex test cases (for example an L-shaped domain or a structure with an internal hole) 6.2, EXERCISES 41 Compute and plot the principal stresses and directions (in radians) and store them in the ‘matrix ’principal_stresses’ with three columns corresponding to the two principal stress values and the angle for each element, Hint: The directions can be found using the Fortran function y =atan2{s,c)/2., where s and are the sine and cosine values from Eq. 5.26. Use the plot- ting routine “plot” to show the results graphically (see the subroutine ‘plot’ in the ‘processor’- ‘module for the options). Exercise 6.2 Prepare your code to be able to evaluate global compliance as well as nodal stress values as function of discretization. A typical assignment is the cantilever problem in Figure 6.4. a) Plot the compliance as a function of the element size and the square of the element size h? and b) lot the Von Mises stresses in points A and B as functions of the element size h and the square of the element size h. Hint: the best agreement with theory is obtained by calculating the stresses in the upper element comers at points A and B. Hint: save the computed stress and compliance values in a file and use Matlab (o plot their dependencies on discretization, 5 thk=1/4 1 °3 (load/area) Figure 6.4: Cantilever test example 42 DAY 6. CONTINUUM MODELLING (Il) AND EQUATION SOLVING Day 7 Derivation of the Virtual Work Principle ‘The Virtual Work Principle (VWP) is a universal principle in mechanics and provides the basis, for most finite clement formulations. The principle can be derived in several different ways — here we show a few. The chapter should be read in conjunction with Cook et al. (2002), Chapter 4, It may also be a good idea to read up on tensor notation from your prior Strength of Materials, courses to make it easier to follow the derivations in this chapter. 7.1 Simple spring examples ‘We start with a simple linear spring with stiffness K and loaded with the force P. The internal energy is o=3KD, a where D is the displacement. The potential work ofthe external force is W=PD. (7.2) ‘The total potential energy of the system is equal to the intemal energy minus the potential work of the external forces 1 Tl=Q-W 3kp —PD. (7.3) ‘An equilibrium for this system is found when the total potential energy takes a minimum. value. A necessary condition for a minimum is stationarity with respect to the variables, ie. the first derivative with respect to the displacement variable must be zero an_aa_aw oT _ 20 BW _ gp _ po, 7.) 3D wD : sa which gives the well-known relation for the spring deflection D — P/K. Calculus of variation notation In calculus of variations one writes a variation of a functional IT with respect to a variable as, SII, which should be interpreted as 811 = 418D. Thus the stationarity condition (7.4) may also bbe written as atl = 8Q—aw =3DKD—SDP=0, Va @s) which is the VWP for a one degree-of-freedom system. This should hold for any infinitesimal (virtual) variation in displacement 8D, thus resulting in the known expression KD = P. 43 44 DAY 7. DERIVATION OF THE VIRTUAL WORK PRINCIPLE 7.1.1 Two-spring system If we extend the analysis to a system of two linear springs in series but just one force (at the free end), we may find the total potential energy as n= D3 + 4 Ka(D2~ D1)? —PDz 6) or in matrix/vector form I Ki +K2 K; D 0 m= 340 ox | ee Oe {Bi} oa{ > } 1 = {PHT ID} — (DY {P} an Stationarity of (7.6) wrt, D, and D2 gives the equations on (7.8) BL= KD) —K,(D.—Di)= 0 B= Rx(D)—D,)-P= which may be solved to give Dy = P/K) and Dz = P(1/Ki +1/K2). ‘The effective stiffness may then be found as Ky = P/D = 1/(1/Ki +1/Ka) which corresponds to the well-known stiffness for springs in series the general spring case, stationarity of (7.7) again gives us the VWP. 81 = {8D}" [k]{D} — {8D}" {P} = 0. 9) This has to hold true for any infinitesimal (virtual) displacement variations {8D}. ie. K|{D} = {P}, (7.10) which gives the same solution for Dy and D2 as above. 7.2, Bounds on deformations This section proves that the compliance obtained with an FE model always underestimates the true compliance. Hence, extreme caution must be taken when using FE methods in practise. First we show that the true minimum potential energy gives us a lower bound for the poten- tial energy of a system and subsequently we use this finding to prove above statement about the compliance for a discretized structure. 7.2.1 Minimum of total potential energy ‘The principle of minimum potential energy gives us a lower bound on the potential energy of a system. For a discretized structure, any displacement that deviates from the exact solution will have a higher potential energy than the correct one. This can be show in the following way: Assuming that we know the true solution to a problem! {D..}, we may insert it into the potential energy expression and get Th, = ${D.}"[K{D.} {Da}"P} = FD.) (P} aan "For example obained analytically or for an infinitely fe mesh 7.3. DERIVATION OF VWP FROM MINIMUM OF TPE 45 If we have a non-perfect solution to the same problem it may be written as {D} = {Da} + {8D}, ic. the true solution plus a small number ¢ times a perturbation {8D} (that satisfies the kinematic boundary conditions). Remark that in this equation the size (number of degrees of freedom) of {D} is not the same as {D..}, ic. they are obtained for different discretizations and hence the expressions here shall be understood in an abstract sense. With above assumption we may write the total potential energy of the approximate solution as T= SVK} — (DY (P} = F(a} +e{BD))" 1K] (De) +e{BD}) ~ {Da} + {BOPP (P} = H{D=}TUK){D} —{D-}{P} + €[{D.} (KI {6D} — {80} (P} SO{BDITIKI{SD} = m+ $2{ap}" {8D}, 7.12 where the fourth line of (7.12) cancels out since [K]{D..} = {P}. Now, since [K] is positive definite, the second term in the last line of (7.12) will always be positive (or zero) and hence, ‘we get the fundamental expression stating that the true total potential energy provides a lower bound for the approximate solution TI({D}) 2M. for V{D} # {Da}. (7.13) 7.2.2. Bound Equation (7.13) can also be written as Fey ey Eva} {P) for (0) 4 {Da} 14) “This means that the minimum potential energy principle gives us a conservative estimate of the true compliance (ic. it will underestimate the true compliance). Note that for a multi degree-of-freedom system we cannot predict whether a single displace- ment will be larger or smaller than the true displacement. We can only say that {D}"{P} < {Dw}"{P} for ¥{D} # {Dw}. (1.15) ile. the compliance for the true solution will provide an upper bound for the compliance of the approximate solution”. In other words: we will always have underestimated the deformation of a structure when we have found a solution by FEM! Therefore extreme caution should be taken and one should always check solutions by convergence studies, 7.3 Derivation of VWP from minimum of TPE For a lincar clastic continuum structure, the strain energy (integrated strain energy density) may be written as 1 1 = 5 [Lev (wav — 5 [tev cneav, 7.16) ti ales based on numberof asaraptionsincluting cers eld continuity requirements between ele rents (discussed in (Cook et al. 2002), section 4.9), The 4-node elements used here fulfil the rule whereas some plate elements with discontinuous rotations between adjacent elements do not 46 DAY 7. DERIVATION OF THE VIRTUAL WORK PRINCIPLE where the strain vector is a function of the continuous displacement field, ie. {e} = {e({u})}. ‘The total work of external forces may be written as we [ (wi (rjas+ [ 0)" (w)av, aly i.e. a surface traction and a volume force contribution, Requiring stationary total potential energy, we get a= 50 aw = | {8e}"{o}av J {8u)" (F}as [80 (@hav =o, (7.18) which has to hold for any kinematically admissible displacement variation {Su}. This is the virtual work principle for continuum structures. 7.4 Derivation of VWP from the strong formulation: The Galerkin method From volume force equilibrium we have (in tensor notation) 6j,j +) =0 in V, (7.19) where 0 is symmetric oj; = 6; to ensure balance of angular momentum. From surface traction equilibrium we have Gini = Fj on Sr, (7.20) and the prescribed displacements can be written as us =uj on Sy ay Equations (7.19-7.21) constitute the so-called strong (point-wise) formulation. In this setting the word "strong" refers to the level of requirements on the solution field, ie. the solution has to be twice differentiable and fullfil equations (7.19-7.21) in every point in V. Solutions of the strong formulation only exist for a very limited number of PDEs when solved on domains with arbitrary geometry. ‘The basis of the FEM is to represent the original problem in a form for which solutions can be obtained. That is, we wish to weaken the requirements on the solution. This is exactly what the VWP does. However, the derivation of the VWP using variational calculus for general problems, e.g. plasticity, requires a high level of mathematical sophistication. In these cases another method is therefore often preferred. The procedure is known as the Galerkin method and is named after the Russian mathematician Boris Galerkin, Galerkin’s method is attractive since it isa simple, yet general and very powerful tool for obtaining the FEM equations directly from the original strong form of the PDE. The method consists of the following steps First, the PDE in (7.19) is multiplied by a kinematically admissible test field, 8u; (i statisfies 84; = 0 at supported boundaries S,), and then integrated over the domain it [ou (on, +41) av =0. (7.22) I, ‘The expression (7.22) corresponds to (7.19) when it is satisfied for any kinematically admissible virtual displacement field 8, 7.4, DERIVATION OF VWP FROM THE STRON (G FORMULATION: THE GALERKIN METHOD47 ‘The second step is to perform integration by parts (here known as Green’s Theorem), c.f Appendix to this chapter, which yields bu; i on dV 4 f Bu; on; dS 4 f Bu; @; dV =0. 7.23) Oxy i ‘The middle term ean be split into two terms Bu on; dS+ f Bu; on; dS, 7.24) s- Is, where the first term can be rewritten by use of (7.20) and the second term is zeto due to the kinematic admissibility of the test field (8; = 0 on S,) and hence we get ~ [8 oy av [, bu Iv se Rewritten in vector form, this corresponds exactly to the VWP from (7.18). Equation (7.25) is called the weak form of equations (7.19-7.21)°, ie. the solution now only has to be once differentiable and only has to fullfil the equilibrium equations in an integral sense. ‘The third and final step in the Galerkin approach is to recast the continuous problem in a discrete form as demonstrated in Chapter 5. Note that the weak form (7.25) holds for both the linear problem as well as for any non-linear problem, For the derivations we neither specified the constitutive law, nor the strain measure or a minimum energy principle. s+ [bu 0 av 0. (725) 7.4.1 Inclusion of prescribed displacements Note that the prescribed displacement conditions (7.21) do not enter into the virtual work prin: ciple (7.25). For zero displacement conditions (i.e. uj = 0 on S,), we have earlier seen that we ignore those degrees of freedom when we assemble the global system of equations or we can insert ones in the diagonal and zeros in rows and columns corresponding to the DOFs of the constrained displacements. However, prescribed boundary conditions may also systemati~ cally be included in the virtual work principle. Two ways to do this are by the introduction of Lagrangian multipliers or by the penalty approach which both are very briefly described in the following. ‘Lagrangian multipliers Here we augment the potential energy TI with an extra term tram [ 2 (u—us)as. 7.26) ss We note that the added term is zero when the displacement constraint uj —uj = 0 is fulfilled. ‘The variable 2 is called a Lagrange multiplier. Taking the variation, we get alt= ans [dA (u—uf) ds+ | du Aas. 27 Se Se ‘This results in an extra set of equations and unknowns that have to be included in the global system of equations before solving. When the solution has been obtained, the value of the Lagrange multipliers will correspond to the unknown reaction forces. For further details on the implementation of this approach see Cook et al. (2002), Chapter 13.2. "Nove, however, that we have not yet dealt wih the Dirichlet boundary conditions (7.21. 48 DAY 7. DERIVATION OF THE VIRTUAL WORK PRINCIPLE Penalty approach In the alternative approach we add a penalty term to the potential energy IT f=t+a/ (u—uj)* ds. (7.28) Se ‘We note that the added term is zero when the displacement constraint uj — uj = 0 is fulfilled > Dis called the penalty factor. Taking the variation, we get aft atta f 28u; (ui —ut) ds. (7.29) Se This results in the penalty method for imposing displacement constraints as discussed in Chapter 1 of these notes. For further details on the implementation of this approach see Cook et al (2002), Chapter 13.3. 7.5 Discussion We have shown that the Virtual Work Principle (VWP) can be found from the principle of minimum total potential energy and from basic (strong form) equilibrium equations. The VWP was derived for both discrete spring systems and continuum structures. The VWP for continuum structures provides the basis for FE-analysis and may be extended to account for dynamics, plasticity and many other mechanical or alternative physics problems. It should be noted that the minimum total potential energy principle requires that one can write a functional for the total potential energy. This can be done for potential systems like linear elastic systems but not for non-linear dissipative problems like plasticity. In contrast, the ‘VWP is general and may be applied to find equilibrium for general mechanical problems. 7.6 Appendix on Green’s Theorem Green’s theorem may be seen as an application of “Integration by Parts” (sce also Cook et al (2002), Chapter 5.4) [rea ~ [aca ab (7.30) Consider the volume integral [ Mav aan This may also be written as r [om dx dy, (7.32) where x2 and xg are the boundaries of the modelling domain on the left and the right hand sides and yz and yy are the boundaries of the modelling domain at the bottom and the top, respectively. By partial integration this is equal to = [ Beans Pouitay On the right and left hand sides of the boundary (where x = x, and x — xg, respectively) we have that [Peers 000 Weald. 0.33 In, dy= nS and dy = —ndS, (7.34) 7.7. FURTHER READING 49 ‘Therefore the last integral of (7.33) may be rewritten as a surface integral [ovmas. (735) which results in 2 » y 0 ined. [exe haw ie as (739) ‘This expression may also be written in tensor form as [ovuav —— [ rmav+ [ovinas, 31) iy Vv s assuming that yy isa first order tensor, Inclasticity (and other applications) we may use a generalized form of integration by parts, whieh holds for the higher order tensorial case. Therefore let f; be a vector (fist order tensor) and let Gy be a second order tensor. The tensorial form of the integration by parts formula then becomes f fiGiy dV [s6s av4 [iGins as. (7.38) Following standard Einstein summation notation f,; is the gradient of the vector fj and Gi; is the divergence of the tensor Gi 7.7 Further reading For further readings on variational and finite element methods the references Johnson (1987) and Demkowicz (2007) can be recommended. 7.8 Exercise Exercise 7.1 Poisson’s equation represents a well-established model for steady-state heat conduction in a solid material. The strong form of the equation posed on a domain V with a partitioned boundary S(S=S,USy and S,Sp = 0) takes the form V-(kVu)=f in (7.39a) (k¥u)-n=h ony, (7.396) 0 oS, (7.390) w where u = u(x,y) is the scalar temperature field, k > 0 is the conductivity constant of the material and f is the volumetric heating. n denotes the outward unit normal and h is a prescribed hheat flux. To simplify the problem only u = 0 is prescribed on Sy For the PDE (7.39) derive ‘© the corresponding variational problem, (i.e. the Virtual Work Principle) for the heat conduction problem. ‘© the discrete finite element equation based on the variational problem 50 DAY 7. DERIVATION OF THE VIRTUAL WORK PRINCIPLE + element stiffness matrices, surface load vectors, etc., equivalent to the expressions derived {for stiffness analysis in chapter 5. Please also use the notation of chapter 5. Hint: The strong form of the heat conduction problem (7.39) can also be written in tensor form as qi=f inv (7.40a) qiti—h — on Sy (7.400) u=0 onSy (7.40c) where the heat flux is defined as gi = —kuy. Day 8 The isoparametric formulation ‘This chapter introduces the isoparametric formulation and should be read in conjunction with Chapters 6-6.3, 6.8, 6.10 and 6.11 (Cook et al. 2002). 8.1 Isoparametric 4-node elements In the En)-coordinate system, the shape functions are 1 1 M aT), M=GL+E)L=n), ete @.) ‘The interpolation of internal element values (position x, displacements 6, etc.) in terms of nodal values is x=EDMEn x = LMEn) 6 62) In order to determine the strain-displacement matrix, we need to determine derivatives of field variables, e.g. 09/Ax or 26/2y. These are not directly available but we may find them from 86 30x 30a; 8 — 8ax dH ay Baa ae ™ Sp ae t DaM 8.3) which may be put in matrix form as ax ay ] aM, OM, g\-|% & | z = Ye. bas £ ce) 2 ey TLE yon pM, | LS am an am | Gi ~ ma where [/] is the so-called Jacobian-matrix which gives the connection between derivatives in the two coordinate systems. The determinant of the Jacobian matrix ||J)| gives the scaling between the areas dx dy and d& dn, ie. dx dy = |{J)| db dn Now we can find the field derivatives in terms of the original coordinates as Eh-m{ $\-2 [% mf Elin s es By poole ie LST MS ; where [I] isthe inverted Jacobian matrix. 51 52 DAY 8, THE ISOPARAMETRIC FORMULATION Now the strain vector may be written as (refer to (5.1)) an 100o0]{] %* an p=}0001)]) % 4, 8.6) 2a o1io0}] Sl» where (8.7) and (8) and thus _. {9 =U Ifa} Co) EN Bs ‘The clement stiffness matrix is now found as mn w= [ie Tcl av = [ : [ 18 (Ce [ul a8 an (8.10) where 1 is the (assumed constant) thickness of the element, The latter integral is difficult to evaluate analytically (ratio of two polynomials) and must therefore be calculated numerically. 8.2 Numerical integration An area integral can be calculated numerically by Gaussian quadrature as L [isGmaeane 3 Smiw, oom), 1 Ar 1 where mg is the number of Gauss points (in each direction), &; and 7; give the coordinates of the Gauss points and W; are the weights of the Gauss points. ‘The location and weight factors for 1 to 3 Gauss points are given in the following table # Gauss points Location & ory Weight Wj i 0 z 2 t1/v3 1 3 +V06 s/o 0 8/9 Note that a (1D) polynomium of order 2n — 1 is exactly evaluated with n Gauss points. ‘This means that a rectangular 4-node element can be evaluated exactly using two-by-two Gauss. points since the function to be integrated is bi-linear. In special cases it may be an advantage to use reduced integration but in general, reduced integration (i.e. using too few Gauss points) may cause numerical trouble as discussed in Cook et al. (2002), sections 6.8. 8.3, FLOW DIAGRAM FOR GAUSS QUADRATURE 53 8.2.1 Consistent nodal loads Surface and volume loads should also be integrated numerically. The load vector originating from a surface pressure, p, on a surface with normal, {7}, of the finite element mesh writes fore ds=- [iT vim ds where [N] is the 2x8 shape function matrix used in Chapter 5. Using Nanson’s formula to map from the xy-coordinate system to the En-coordinate system allows substituting; {n}dS = UJ] *{a}dS, where [J] is the Jacobian matrix defined in Eqs. (8.4)-(8.5), and {fi} is the normal to the corresponding boundary area dS in the En-coordinate system. Thus, tn Sia mpas=[ Jn Sis | {apa ‘The consistent nodal loads for surface pressure load on face 1 (where 1) = —I and {a}! = {0, —1}) of a quadrilateral element can be found as orerve=ferlwr Y)L. eeBmer(r tn Dh Likewise the expressions for the consistent nodal loads for pressure loads on faces 2, 3 and 4, respectively may be found as [rorreesas [ro (wir 2 }) |, ane Lmer (wr 2 J) [preva for(or 2)| e-dmo(or 2) r ‘ r{ Jn = Ws rf dn frrorefro(ord EDI mrbwolo BD, For more details see section 6.8 in Cook et al. (2002). For vertical, respectively horizontal edges, the components Jz; and J,2 will be zero. For near-rectangular elements, with surface loads on horizontal or vertical faces, fairly good approximations to consistent nodal loads may be obtained simply by using the expressions in Chapter 5. ‘Volume loads may be evaluated using La [iter av= [faim wpa aga YE wi en") (Ul) 12) Aa 8.3 Flow diagram for Gauss quadrature In order to calculate the isoparamteric element stiffness matrix Ln et ie) =f, /eele |i) d& an = YY Ww, wy; 1B)" CIB) [I @.13) att a flow diagram may look like 54 DAY 8, THE ISOPARAMETRIC FORMULATION Define Gauss points and weightings Calculate [C] Set [&*] = (0 Fori=1,..., np For j= Tye. Mp Calculate[Z;, (J), |[7]| and [F) (in present Gauss point) Setup [f'] Setup [A Calculate (B] = [£] [i [8] [ke] = [ke] + We Wj (B)TCILB) [I End loop End loop 8.4, EXERCISES 55 8.4 Exercises First make a backup of your old program. Todays exercise mainly consists in substituting the plane42rect.£90 module that used analytical integration with a new plane42.f90 module that uses numerical integration. You may use the old plane42rect.£90 module as a skeleton for the new module, Exercise 8.1 Implement the isoparametric formulation (with two by two Gauss points) and check the im- plementation by resolving some of the problems from chapter 5. Remember also to change the [B]-matrix in the stress calculations (evaluated for only one Gauss point). Hint: Calculate shape function matrix, strain-displacement matrix, Jacobian matrix and the determinant of the Jacobian matrix for a specific (Gauss) point in a separate subroutine called "shape" (separate routine in the new plane42 module) with the arguments, shape(xe,xi,eta,n,bmat,jac,detjac) Compare the results with previous examples. Also check the program by moving one of the center-nodes and by degenerating two quad elements into triangles as shown in Figure 8.1. The discretization at the right should be tested both for the center-nodes having equal coordinates and by removing one of them. Note that the strain field should be exactly the same as before. m \ F-0.005 F-0.005 \ / ron |G FOOL 7 Figure 8.1; Modified 6-clement cantilever beams If you have implemented consistent nodal loads for the isoparametric elements (c.f. section. 8.2.1), you may check this implementation by also moving the right most center node in the vertical direction. Again, the strain values should stay uniform. Exercise 8.2 Use ANSYS (sce separate handout) to generate an input file for solving the problem sketched in Figure 8.2 and solve the problem using your own code. If you do not know ANSYS or do not have time to go through the tutorial you may download an output file from ANSYS on DTU, Learn. Compare the von Mises stress along the edge of the hole with the analytical solution 6(8) = (6 +63) — (6; — 62)2c0s(26), 14) where 6; and 63 are the applied (far field) stresses, The analytical solution can for example be found in Pedersen's book on elasticity, anisotropy and laminates, p. 93 (can be downloaded at http://www. topopt mek. dtu.dk/f ies). 56 DAY 8, THE ISOPARAMETRIC FORMULATION 0.02, B=200GPa 10 Figure 82: Plate with circular hole. *Exercise 8.3 Implement variable numbers of Gauss points. Check that the solution does not improve when using more than two Gauss point for rectangular elements. How does the solution depend on the number of Gauss points for non-rectangular elements? 8.5 Appendix on converting ANSYS Models to FEM Models ‘We have demonstrated the systematic assembly and solution of mechanics problems by the finite element method. The construction of the finite mesh is the most tedious task in the finite element process. Until now, you have been limited to simple finite elements meshes that you construct by hand or with the assistance of FIExtract, Commercial finite element packages incorporate sophisticated pre-processors and post-processors that allow the user to construct complex meshes and to view the results, Our finite element program is compatible with ANSYS which means that you can use the ANSYS pre-processor to generate an input file to your code, In order to clean up the ANSYS input-file you need to run the ANS2FEM extraction program and you may also want to run it through the bandwidth minimizer subroutine BANDFEM (both downloadable from the course web-site). An extra handout will demonstrate how to built the "plate with a hole example" in ANSYS. Day 9 Eigenvalue analysis In this chapter we calculate the eigenfrequencies of a mechanical structure. The chapter should be read in conjunction with Chapter 11-L1.5 and appendix C in Cook et al. (2002) 9.1 VWP Adding the virtual work of dynamic forces to the Virtual Work Principle we get sey" sa (ria f {ay (@rav — f ofamyTtarav — f xfba™ fey {o}av [uy {F)as [130 @}av fotouy {wav [xteuy ony where {ii} and {1} are pointwise acceleration and velocity vectors, respectively, and p and « ate specific density and viscous damping coefficients, respectively. Discretizing and rewriting the VWP in terms of nodal displacements we get Tipit _ rivitirvas= [ 18d} IN to yav — [ea (B|" {o}aV [say IN|" {F}as. [reas INIT {@}av [oteayt wit N] (hav [, K{8d}" [NIT (N{d}aV. 0.2) Vv y Using that the VWP should hold for any virtual displacements results in K|{D} + [Ca]{D} + [M|{B} = {F} (9.3) where [Cy] and [M] are the global damping and mass matrices, respectively, which are assembled from the local (element) damping and mass matrices (e = [swt dV and [mt = [ew TINe|av 4) 9.2 Eigenvalue problem Assuming zero damping and no external forces the FE-equation (9.3) simplifies to K]{D} + [o}() = (0) 0) Now we assume that the time-dependent displacement solution can be written in the form {D} = sin(o2){D}, 9.6) 37 58 DAY 9. EIGENVALUE ANALYSIS where {D} is a time-independent amplitude vector. Inserting this in (9.5) we then get the generalized eigenvalue problem with the eigenvalue 2 = ((K| - XM) {D} = {0} on In order to find non-trivial solutions, we need to determine eigenvalues that satisfy det ({K] — NiM]) =0. 8) ‘The solutions to the eigenvalue problem come in pairs (2, {D}:) ‘To sum up, We used separation of variables and transformed the initial value problem (9.3) to an eigenvalue problem (9.7). In general this requires the governing equations to be: 1) linear, 2) unforced, 3) with no explicit space or time dependence. This is the case for equation (9.5). 9.3 Inverse iteration ‘The simple equations for inverse iteration are [K){X}p = (MUEXSp—1 Xp : 0.9) p= —Ve_, (CRIB MIR}? where p is the iteration number. After convergence, the eigenvalue is found as the Rayleigh quotient — POBIKIOOy XY}, A flow diagram for efficient computing of the inverse iteration procedure may look like a 9.10) Build stiffness matrix [K] and factorize (remember boundary conditions) Initial guess for eigenvector {X}o Compute {¥ Jo = (M|{X }o (do the multiplication on element basis) For iteration-step p= 1,2,.1 Pmar Solve [K]{X}p = {¥}p~1 (remember boundary conditions) Compute {Y} = [M]{X}p (multiplication on element basis) Compute rp = POR p Compute {¥} p= {V}p/tp if (\{X}p— (X}p-all/I{Xp} || <0 then break End iteration ‘Compute the eigenvector {D} = {X}p/rp Compute the eigenvalue 2= {X}(¥}p-1/73 Here, the convergence criterion must be very strict (e.g. «= 107 9.4, STURM SEQUENCE CHECK 59) Caleulation of multiple eigenvalues For the computation of multiple eigenvalues we may use inverse iteration with orthogonaliza- tion, For this case, the simple algorithm is extended to IKI(X}p = [MUX}o1 c= (RpIMI(A}) for f= ty... i (Xhp= (Kho— YoylAhi OM) A {X), (y= 2 _, (RIM) where is the eigenvalue number being calculated. It is easy to see that for i= 1, this algorithm corresponds exactly to the one in (9.9). ‘A flowchart for the computation of the neig lowest eigenvalues may be Build stiffness matrix [K] and factorize (remember boundary conditions) For i= Ineig Initial guess for eigenvector {X}o Calculate {¥ }o = [M){X }o (on element basis) Forj= Lil ‘Compute {Z}, = [M]{D}; (on element basis) End For iteration-step p= 1,2, Par Solve [K|{X}» = {¥}p-1 (remember boundary conditions) For j= 1-1 Compute ¢; = {X}5{Z}) Orthogonalize {X}p = (X}p—cj{D}y End ‘Compute {Y}» = [M]{X}p (on element basis) Compute rp = / O05 (Mp Compute {¥}p= (Y}p/rp if (\|{X}p— {X}p-al|/||{Xp}|| < © then break End iteration Compute the eigenvector {D}: = {X}p/rp Compute the eigenvalue A; = {X}2(¥ }p-1/73 End 9.4 Sturm sequence check To check that the inverse iteration approach works properly, one may perform a Sturm-sequence check to sce that the correct eigenvalues have been found. A simple way to perform a Sturm- Sequence check is to factorize the matrix [A] = [K] — A4{M] and count the number of negative diagonal elements of the factorized matrix. If the number of negative diagonal elements equals, , all eigenvalues have been found, Otherwise, the convergence criteria should be tightened. 60 DAY 9. EIGENVALUE ANALYSIS 9.5 Shift If one is interested in finding eigenvalues around a certain critical excitation frequency 2o, one may introduce shift to save computational time. ‘The eigenvalue problem (9.7) may be rewritten as ([K] ~ (Qo + Ad)[M)) {B} = {0} (9.12) because 2. = Ro +Ad. This equation may be rewritten to ((K] ~ Ao[M)) {3} = Ad{M {5} (9.13) Only change in the algorithm is that the first update rule in (9.9) is exchanged with ({K]—2o[M]){X}p = [M]{X}pa (9.14) and that 2 in (9.10) is exchanged with AA. After convergence, the actual eigenvalue is found as 2. = ho + Ad, Note however, that the linear system (9.13) is now no longer positive definite and hence can not be solved by e.g. Cholesky factorization, 9.6 Exercises In order to organize your program you may make use of the ‘antype’ command. If you in the bottom of an input file write FINISH /SOLU antype, static FINISH then the analysis type will be saved in the variable ‘antype’. Possible values of ’antype’ are STATIC, STATIC_NL, MODAL and ANGLE. Today you may use the MODAL analysis type. For your final project you may want to define new analysis types in the processor module. Exercise 9.1 Change your program such that you can find the first natural frequency of an elastic structure using the inverse iteration method. Test the program on longitudinal vibrations of a simple beam as sketched in Figure 9.1 (use a fine discretization for the modelling). Compare your results with the theoretical eigenvalues for longitudinal vibrations in a long slender beam (9.15) where n is the mode number. Discuss and demonstrate what happens if you remove the restrictions that prevent transverse vibrations? Hints: Start by calculating the element mass matrix. This should be done in the "plane42_ke" subroutine, The [V}-matrix is already defined in your subroutine "shape". The multiplication, of the mass matrix and the eigenvector may advantageously be done on an element basis in a separate subroutine "mmul(invector,outvector)’ (put it in the fea-module). As a skeleton for the 9.6, EXERCISES 61 Figure 9.1: Beam restricted to longitudinal vibrations. Z= 20, f= 1, v= 0, p = | and thickness ¢ = 1. Remark that to get accurate results for longitudinal vibrations the left edge (all nodes) must be supported in the horizontal direction and the horizontal centerline (all nodes) supported in the y-direction *mmul’ subroutine you may use the "buildstiff” subroutine. The inverse iteration loop may be performed in a separate subroutine called eigen’ in the "fea" module (use "displ" as a skeleton). ‘You should be able to display animations of the vibration modes by calling the "plot" sub- routine with the syntax call plotmatlabeigititle,freq,evec,time) For example, test the plotting by using the "Continuum!" structure with call plotmatlabeig("Eigenmode - test’,10,0d0,5.040*4,{1.040,0.010d0}) where * js the displacement vector. Exercise 9.2 Extend the program such that it can find multiple eigenvalues and vectors, test it on longitudinal vibrations of the beam in Figure 9.1 and compare with the analytical solutions. “Exercise 9.3 Implement the shift method to calculate higher eigenvalues and demonstrate and discuss its use on an illustrative example. “Exercise 9.4 Check that you found all the lowest eigenvalues by performing a Sturm-sequence check. Try to {find an example where you do not. Also use the Sturm-sequence check to number the eigenvalue that you found in Exercise 9.2. “Exercise 9.5 Calculate the lowest eigenvalues for a structure of your choice generated by the ANSYS pre- processor and discuss the results.

You might also like