Heath - Scientific Computing (523150), страница 85
Текст из файла (страница 85)
BOUNDARY VALUE PROBLEMS FOR ODESwhich has the solutionx0 = 0,x1 = −0.5,x2 = 1.5.Thus, the approximate solution function isy(t) ≈ u(t) = −0.5t + 1.5t2 .At the collocation point, t = 0.5, where we forced the function u to satisfy the ODE exactly,we have the approximate solution valuey(0.5) ≈ u(0.5) = (−0.5)(0.5) + (1.5)(0.25) = 0.125,which agrees with the solution value at t = 0.5 that we obtained previously by both theshooting method (Example 10.1) and the finite difference method (Example 10.2).In general, these three methods would not produce exactly the same results, but theydo so here because of the particular nature of the problem.
The analytical solution is easilyseen to be y(t) = t3 , so that the value y(0.5) = (0.5)3 = 0.125 is in fact exact. We note thatthe quadratic polynomial produced by the collocation method agrees with the true solutionat the three points t0 = 0, t1 = 0.5, and t2 = 1 but does not agree exactly with the truesolution at any other points (why?). The approximate and exact solutions are plotted inFig.
10.3.1.00.50.0............................. .............. ............ ....................................................................................................................................................................................................
......... ....... .......0.51.0Figure 10.3: True solution (solid line) and approximate solution (dashed line) obtained by collocation.Example 10.4 Galerkin Method. We further illustrate the concepts involved in thefinite element method by again solving the two-point boundary value problem of Example 10.1,y 00 = 6t, 0 ≤ t ≤ 1,with boundary conditionsy(0) = 0and y(1) = 1,this time using the Galerkin method with piecewise linear polynomials. We again use thesame three mesh points, but now they become the knots in the piecewise linear polynomialapproximation. A convenient basis is given by the “hat” functions shown in Fig.
10.4.Thus, we seek an approximate solution of the formy(t) ≈ u(t) = x1 φ1 (t) + x2 φ2 (t) + x3 φ3 (t).10.5. FINITE ELEMENT METHOD1.0 ... ....3171.0......0.0......φ1.........0.5...1.0......0.0........................φ20.51.0............φ3............1.00.0...0.5.....................1.0Figure 10.4: The “hat” function basis for piecewise linear polynomials.From the boundary conditions, we must have x1 = 0 and x3 = 1. To determine the remaining parameter x2 , we impose the Galerkin condition. Recall that the Galerkin conditionrequires that the residual be orthogonal to the space spanned by the basis functions andhence to each basis function individually.
Recall further (see Section 7.2.4) that the innerproduct on a function space, and hence the notion of orthogonality, is defined by the integral of the product of the functions. Imposing the Galerkin condition on the interior basisfunction φ2 , we therefore obtainZ 1Z 1Z 10000(u (t) − 6t)φ2 (t) dt =u (t)φ2 (t) dt − 6tφ2 (t) dt = 0.000We can evaluate the first of these integrals by parts:Z 1Z0001u (t)φ2 (t) dt = u (t)φ2 (t)|0 −01u0 (t)φ02 (t) dt.0For the first term, since φ2 (0) = φ2 (1) = 0, we have u0 (t)φ2 (t)|10 = 0. Computing theintegral in the second term,!Z 1Z 1 XZ 133X0000φ0i (t)φ02 (t) dtxi φi (t) φ2 (t) dt =xiu (t)φ2 (t) dt =00i=1i=10= x1 (−1/h) + x2 (2/h) + x3 (−1/h),where h = 12 is the spacing between mesh points.
Finally, straightforward evaluation of theR1other integral gives 6 0 tφ2 (t) dt = 32 . Hence, the Galerkin condition gives us the equation3−2x1 + 4x2 − 2x3 = − .2Substituting the known values for x1 and x3 then gives x2 = 18 for the remaining unknownparameter. Thus, the piecewise linear approximate solution isy(t) ≈ u(t) = 0.125φ2 (t) + φ3 (t),which is plotted in Fig. 10.5 along with the exact solution. We note that u(0.5) = 0.125,which again is exact for this particular problem.318CHAPTER 10. BOUNDARY VALUE PROBLEMS FOR ODESIn a more realistic problem, there would be many more interior mesh points and basisfunctions and correspondingly many parameters to be determined. The resulting system ofequations would be much larger, but it would still be sparse, and therefore relatively easyto solve as long as basis functions with localized support, such as the “hat” functions, areused. The resulting approximate solution function would become more accurate as moremesh points are used.1.00.50.0......
....................... ............ .......... ........... ........... ............ ............. .......... ...... .......... ............................................... .............................. .........................................................................0.51.0Figure 10.5: True solution (solid line) and approximate solution (dashed line) obtained by Galerkinmethod.10.6Eigenvalue ProblemsA standard eigenvalue problem for a second-order ODE has the formy 00 = λf (t, y, y 0 ),a ≤ t ≤ b,with boundary conditionsy(a) = α,y(b) = β,and we seek not only the solution y but also λ as well. The (possibly complex) scalar λ iscalled an eigenvalue and the solution y an eigenfunction for this two-point boundary valueproblem.
More general eigenvalue problems may involve higher-order systems, implicitequations, more general boundary conditions, or nonlinear dependence on λ.Discretization of an eigenvalue problem for an ODE results in an algebraic eigenvalueproblem whose solution approximates that of the original problem. For example, considerthe linear two-point boundary value problemy 00 = λg(t)y,a ≤ t ≤ b,with boundary conditionsy(a) = 0,y(b) = 0.If we introduce discrete mesh points ti in the interval [a, b], with mesh spacing h, and usea standard finite difference approximation for the second derivative, then we obtain analgebraic systemyi+1 − 2yi + yi−1= λgi yi , i = 1, . .
. , n,h210.7. SOFTWARE FOR ODE BOUNDARY VALUE PROBLEMS319where yi = y(ti ) and gi = g(ti ), and from the boundary conditions, y0 = 0 and yn+1 = 0.If gi 6= 0, so that we can divide equation i by gi for i = 1, . . . , n, then we obtain a standardalgebraic eigenvalue problem Ay = λy, where A has the tridiagonal form−2/g1 1/g10···0.... 1/g2 −2/g2.1/g2.1 ...,A= 2 0......0h ... ...1/gn−1 −2/gn−1 1/gn−1 0···01/gn−2/gnwhich can be solved by the methods discussed in Chapter 4.10.7Software for ODE Boundary Value ProblemsTable 10.1 is a list of some of the software available for numerical solution of boundaryvalue problems for ordinary differential equations.
For a survey of software available fortwo-point boundary value problems, see [39].SourceIMSLHSLNAGnetlibNRNUMALSLATECTOMS10.8Table 10.1: Software for ODE boundary value problemsShootingSuperposition Finite difference Collocationbvpmsbvpfddd02d02hafd02gafd02jafmusl/musntwpbvpcolnewshootsolvdeGalerkinfemlagbvsupcolsys(#569)Historical Notes and Further ReadingClassic references on the numerical solution of two-point boundary problems for ODEsare [86, 146]. For an overview of finite difference methods, see the survey [201], and forshooting methods, see [215]. A comprehensive treatment of methods for two-point boundaryvalue problems can be found in [10].
Most books on the finite element method are concernedprimarily with partial differential equations, but many of them discuss two-point boundaryvalue problems for ODEs as an introductory illustration; for example, see [17, 20, 140, 247].Review Questions10.1 What specific feature distinguishes aboundary value problem from an initial valueproblem for a system of ordinary differentialequations?10.2 Explain how a one-dimensional zerofinder can be used to solve a two-point bound-320CHAPTER 10.
BOUNDARY VALUE PROBLEMS FOR ODESary value problem for a second-order scalarordinary differential equation y 00 = f (t, y, y 0 )with boundary conditions y(a) = α and y(b) =β.10.3 For each type of method listed for solving two-point boundary problems for ODEs,state whether methods of this type convert theboundary problem to one or more initial valueproblems or to a system of algebraic equations:(a) Finite difference(b) Shooting(c) Finite element(d ) Superposition10.4 List two disadvantages of the superposition method for solving two-point boundaryvalue problems for second-order ODEs.10.5 For solving a two-point boundary valueproblem for a nonlinear second-order ODE,both the finite difference method and theshooting method are iterative. One of theseapproximately satisfies the ODE at each iteration, but satisfies the boundary conditionsonly upon convergence, whereas the other satisfies the boundary conditions at each iteration, but approximately satisfies the ODE onlyupon convergence.
Which is which?10.6 (a) In solving two-point boundary valueproblems for second-order ODEs, for whattype of problem is the multiple shootingmethod likely to be more effective than theordinary shooting method?(b) What disadvantage does the multipleshooting method have, compared with the ordinary shooting method?10.7 When a finite difference method is usedto convert a boundary value problem for a differential equation into a system of algebraicequations, what property determines whetherthe algebraic system will be linear or nonlinear?10.8 Finite difference and finite elementmethods for solving boundary value problemsconvert the original differential equation into asystem of algebraic equations.
Why does theresulting linear system usually require far lesswork to solve than the usual O(n3 ) that mightbe expected?10.9 Finite difference and finite elementmethods for solving boundary value problemsboth require the solution of a system of algebraic equations, but the solutions to the respective algebraic systems differ in their meanings and how they are used.(a) How do the quantities being solved for differ between the two types of methods?(b) How do the resulting approximate solutions to the boundary value problem differ innature?10.10 Why is it advantageous if the basisfunctions used the finite element method arelocalized (i.e., each basis function is nonzero ononly a small portion of the problem domain)?10.11 In solving a boundary value problemby a finite element method, what requirementdoes the collocation method impose on the approximate solution?10.12 Suppose you are solving a two-pointboundary value problem for a linear secondorder ODE using the standard second-ordercentered finite-difference approximations tothe derivatives.