21 writing the ode as a rst order system let us also

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ODE as a rst-order system, let us also consider the related IVP 0 y1 = y2 y1(a ) = A 0 y2 = f ( x y 1 y 2 ) y2(a ) = : (6.2.2a) (6.2.2b) In what follows, we'll need to emphasize the dependence of the solution on the parameter appearing in the initial conditions, so we'll write the solution of (6.2.2) as yk (x ), k = 1 2. Solutions of (6.2.2) satisfy the original di erential equation and the initial condition at x = a but fail to satisfy the terminal condition at x = b. Thus, shooting consists of repeatedly solving (6.2.2) for di erent choices of until the terminal condition y1(b ) = B (6.2.3) is also satis ed. Regarding (6.2.3) as a (nonlinear) function of , convergence to the solution of the BVP can be enhanced by using an iterative strategy for nonlinear algebraic equations. Secant and Newton iteration are two possible procedures. Let us illustrate the simpler secant method rst. 1. Solve the IVP (6.2.2) for two choices of , say 0 and 1. The corresponding solutions, y1(x 0 ) and y1(x 1 ), may appear as illustrated in Figure 6.2.1. The 0 various choices of alter the initial slope y1(a ) = y2(a ). Regarding the solution y1(x ) as the trajectory of a projectile red from a cannon at x = a, y1(a ) = A, the problem is to alter the initial angle of the cannon so that the projectile hits a target at at x = b, y1(a ) = B hence, the name shooting. 2. Assuming that y1(b ) is locally a linear function of , we use the two values y1(b 0) and y1(b 1) to compute the next value 2 in the sequence thus, 2 is the 7 y1 y1 (b; α 1 ) B y1 (b; α 0 ) α0 α1 A a b Figure 6.2.1: Solutions y1(x 0 ) and y1(x 1 x ) of the IVP (6.2.2). y1 (b; α) y1 (b; α 1 ) B y1 (b; α 0 ) α0 α1 α2 Figure 6.2.2: Secant method of using two guesses such that y1(b 2 ) B . 0 and x 1 to select another guess solution of (Figure 6.2.2) y1(b 1 Solving for 2 ) ; B = y1(b ; 1 2 1 ) ; y 1 (b 1 ; 0 0 ): yields 2 = 1 y B 1 ; ( 1 ; 0) y (b 1(b ) ;)y;(b ) : 1 1 1 0 8 2 This can be repeated to yield the general relation +1 = ; ( ; ;1) y (b y1(b ; y) ; B ) ) 1(b ;1 1 = 1 2 ::: : (6.2.4) The iteration may be terminated when, e.g., );B y1(b B for a prescribed value of . (Other termination criteria should be used when B = 0.) Remark 1. If the ODE is linear then y1 (b ) is a linear function of and y1 (x 2 ) is the exact solution (neglecting round o errors) of the BVP (6.2.1). The nonlinear equation (6.2.3) can also be solved by Newton's method. If, for example, is a (su ciently close) guess to the solution of (6.2.3) then the next guess may be generated as +1 An expression for @y1 (b respect to to obtain = ; y1(b (b ) ; B : @y ) 1 @ (6.2.5) )=@ may be obtained by di erentiating the IVP (6.2.2) with ( @y1 )0 = @y2 @ @ @y1 (a ) = 0 @ (6.2.6a) y y ( @y2 )0 = @f (x@y 1 y2) @y1 + @f (x@y 1 y2) @y2 @ @ @ 1 2 @y2 (a ) = 1: (6.2.6b) @ These equations are linear in the partial derivatives @y1 =@ and @y2 =@ . An algorithm for performing shooting with Newton's method is shown in Figure 6.2.3. In order to simplify the notation, let z1 = @y1 z2 = @y2 : (6.2.7) @ @ In order to solve the IVP, functions to evaluate @f=@y1 and @f=@y2 must be available In contrast, the secant method only requires knowledge of f . In fact, the secant method (6.2.4) can be viewed as an approximation of Newton's method (6.2.5) with backward 9 procedure newton begin Select an initial guess := 0 0 repeat Solve the IVP for x 2 (a b] 0 y1 = y2, y1(a ) = A, 0 y2 = f (x y1 y2), y2(a ) = , 0 z1 = z2 , z1 (a ) = 0, z2 = fy1 (x y1 y2)z1 + fy2 (x y1 y2)z2, z2 (a if not converged then )=1 begin := ; y1z(1b(b );B ) := + 1 +1 end until converged end Figure 6.2.3: The shooting method for solving (6.2.1) with Newton iteration. di erences replacing @y1 (b )=@ . For second-order BVPs, Newton's method requires the solution of a four-dimensional IVP while the secant method only requires a twodimensional IVP. Convergence of Newton's method is generally second-order (quadratic), i.e., j +1 ; 1j C j ; 1j2 !1 where 1 is the value of that satis es the terminal condition (6.2.3). Convergence of the secant method is slightly slower, typically j +1 ; 1j C j ; 1j1:5 !1 Thus, the secant method would generally be preferred to Newton's method. This, however, may not be the case with higher-dimensional BVPs. Example 6.2.1. Consider the solution of the clamped elastica problem 00 + P sin = 0 (0) = (1=2) = 0: by shooting methods using Newton iteration. (Symmetry considerations have been used to cut the domain of the problem illustrated in Figure 6.1.1 in half.) 10 Letting y2 = 0 y1 = we introduce the IVP 0 y1 = y 2 y1(0 ) = 0 0 y2 = ;P sin y1 y2(0 ) = : Di erentiating this system with respect to yields 0 z1 = z2 z1 (0 ) = 0 0 z2 = ;Pz1 cos y1 z2(0 ) = 1 where zk , k = 1 2, satis es (6.2.7). Iterates are computed by the relation +1 Using a convergence test of = (1=2 ) ; y1(1=2 ) : z 1 jy1(1=2 )j 10;9 we found that Newton's method converged in ve iterations when P = 40 and 0 = 0:1. 6.3 Introduction to Finite Di erence Methods We'll again use the second-order scalar nonlinear two-poi...
View Full Document

This document was uploaded on 03/16/2014 for the course CSCI 6820 at Rensselaer Polytechnic Institute.

Ask a homework question - tutors are online