12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

460 chapter 17where U a = U(x a ). We substitute U(x) − U a φ 0 (x) into the weak form to obtain(N +1)simultaneous equations, still of the form Ay = b but now with⎛⎞ ⎛⎞A 0,0 ··· A 0,N−1 0b 0 − A 0,0 U a. ... A =, b ′ ..=. (17.52)⎜⎝A N−1,0 ··· A N−1,N−1 0⎟⎜⎠ ⎝b N−1 − A N−1,0 U⎟a ⎠0 0 ··· 1This is equivalent to adding a new element and changing the load vector:b ′ i = b i − A i,0 U a , i=1,...,N− 1, b ′ N = U a . (17.53)To impose the boundary condition at x = b, we again add a term and substituteinto the weak form to obtainb ′ i = b i − A i,N−1 U b , i=1,...,N− 1 b ′ N = U b . (17.54)We now solve the linear equations Ay = b ′ . For 1-D problems, 100–1000 equationsare common, while for 3-D problems there may be millions. Because the number ofcalculations varies approximately as N 2 , it is important to employ an efficient andaccurate algorithm because round-off error can easily accumulate after thousandsof steps. We recommend one from a scientific subroutine library (see Chapter 8,“Solving Systems of Equations with Matrices; Data Fitting”).U a17.14 FEM Implementation and ExercisesIn Listing 17.2 we give our program LaplaceFEM.java that determines the FEMsolution, and in Figure 17.11 we show that solution. We see on the left that threeelements do not provide good agreement with the analytic result, whereas N =11elements produces excellent agreement.1. Examine the FEM solution for the choice of parametersa =0, b=1, U a =0, U b =1.2. Generate your own triangulation by assigning explicit x values at the nodesover the interval [0, 1].3. Start with N =3and solve the equations for N values up to 1000.4. Examine the stiffness matrix A and ensure that it is triangular.5. Verify that the integrations used to compute the load vector b are accurate.6. Verify that the solution of the linear equation Ay = b is correct.7. Plot the numerical solution for U(x) for N = 10, 100, and 1000 and comparewith the analytic solution.−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 460

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!