Está en la página 1de 13

CH AP

TER

11

Boundary-Value Problems
for Ordinary
Differential Equations
Introduction
A common problem in civil engineering concerns the deection of a beam of rectangular
cross section subject to uniform loading while the ends of the beam are supported so that
they undergo no deection.

S
0

w(x)

Suppose that l, q, E, S, and I represent, respectively, the length of the beam, the
intensity
of the uniform load, the modulus of elasticity, the stress at the endpoints, and the
central moment of inertia. The differential equation approximating the physical
situation is of the form 2
d w
S
qx
dx2

(x) =

EI

w(x) +

2EI

(x l),

where w(x) is the deection a distance x from the left end of the beam. Since no deection
occurs at the ends of the beam, there are two boundary conditions
w(0) = 0 and w(l) = 0.
When the beam is of uniform thickness, the product EI is
constant. In this case the exact solution is easily obtained.
When the thickness is not uniform, the moment of inertia I
is a function of x, and approximation techniques are
required. Problems of this type are considered in Exercises
7 of Section 11.3 and 6 of Section 11.4.
The differential equations in Chapter 5 are of rst order and
have one initial condition to satisfy. Later in the chapter we
saw that the techniques could be extended to systems of
equations and then to higher-order equations, but all the
specied conditions are on the same endpoint. These are
initial-value problems. In this chapter we show how to
approximate the solution to boundary-value problems,
differential equations with conditions imposed at different
points. For rst-order differential equations, only one
condition is specied, so there is no distinction between
671
initial-value and boundary-value problems. We will be
considering second-order equations with two boundary
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
values.
it.

672

CHAPTER

11

Boundary-Value Problems for Ordinary Differential


Equations

The two-point boundary-value problems in this chapter involve a second-order differential


equation of the form
y = f (x, y, y),

for a x b,

together with the boundary


conditions
y(a) = and y(b) = .

(11.1)

(11.2)

11.1 The Linear Shooting Method


The following theorem gives general conditions that ensure the solution to a second-order
boundary value problem exists and is unique. The proof of this theorem can be found in
[Keller, H].
Theorem 11.1

Suppose the function f in the boundary-value problem


y = f (x, y, y),

for a x b, with y(a) = and y(b) = ,

is continuous on the set


D = { (x, y, y) | for a x b, with < y < and < y < },
and that the partial derivatives fy and fy are also continuous on D. If
(i) fy (x, y, y) > 0, for all (x, y, y) D, and
(ii) a constant M exists, with
fy (x, y, y) M , for all (x, y, y) D,

then the boundary-value problem has a unique solution.


Example 1

Use Theorem 11.1 to show that the boundary-value problem


y + exy + sin y = 0, for 1 x 2, with y(1) = y(2) = 0,

has a unique solution.


Solution We have
f (x, y, y) = exy sin y.

and for all x in [1, 2],


fy (x, y, y) = xexy > 0 and

fy (x, y, y) =| cos y| 1.

So the problem has a unique solution.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

11.1 The Linear Shooting Method

673

Linear Boundary-Value Problems


The differential equation
y = f (x, y, y)
A linear equation involves only
linear powers of y and its
derivatives.

Corollary 11.2

is linear when functions p(x), q(x), and r(x) exist with


f (x, y, y) = p(x)y + q(x)y + r(x).
Problems of this type frequently occur, and in this situation, Theorem 11.1 can be
simplied.
Suppose the linear boundary-value problem
y = p(x)y + q(x)y + r(x),

for a x b, with y(a) = and y(b) = ,

satises
(i) p(x), q(x), and r(x) are continuous on [a, b],
(ii) q(x) > 0 on [a, b].
Then the boundary-value problem has a unique solution.
To approximate the unique solution to this linear problem, we rst consider the
initialvalue problems
y = p(x)y + q(x)y + r(x), with a x b, y(a) = , and y(a) = 0,
(11.3)
and
y = p(x)y + q(x)y, with a x b,

y(a) = 0, and y(a) = 1.

(11.4)

Theorem 5.17 in Section 5.9 (see page 329) ensures that under the hypotheses in
Corollary 11.2, both problems have a unique solution.
Let y1 (x) denote the solution to (11.3), and let y2 (x) denote the solution to (11.4). Assume
that y2 (b) = 0. (That y2 (b) = 0 is in conict with the hypotheses of Corollary 11.2 is
considered in Exercise 8.) Dene
y1 (b)

y(x) = y1 (x) +

y2(b)

(11.5)

y2 (x).

Then y(x) is the solution to the linear boundary problem (11.3). To see this, rst note that
y1 (b)
y(x) = y1(x) +

y2 ( b)

y2 (x)

and
y(x) = y1 (x) +

y1 (b)
y2 ( b)

y
2 (x).

Substituting for y
1 (x) and y2 (x) in this equation gives

y1 (b)

y = p(x)y +1 q(x)y1 + r(x) +

= p(x)

y1+

y1 (b)
y2 ( b)

y2 ( b)

y2

p(x)y 2+ q(x)y2

+ q(x)
y1 +

y1 (b)
y2 (b)

y2 + r(x)

= p(x)y(x) + q(x)y(x) + r(x).

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

674

CHAPTER

11

Boundary-Value Problems for Ordinary Differential


Equations

Moreover,
y(a) = y1 (a) +

y1 (b)

y2(b)

y2 (a) = +

y1 (b)

y2(b)

0=

and
y(b) = y1 (b) +

y1 (b)

y2(b)

y2 (b) = y1 (b) + y1 (b) = .

Linear Shooting
This shooting hits the target
after one trial shot. In the next
section we see that nonlinear
problems require multiple shots.

The Shooting method for linear equations is based on the replacement of the linear
boundary- value problem by the two initial-value problems (11.3) and (11.4). Numerous
methods are available from Chapter 5 for approximating the solutions y1 (x) and y2 (x), and
once these
approximations are available, the solution to the boundary-value problem is approximated
using Eq. (11.5). Graphically, the method has the appearance shown in Figure 11.1.

Figure
11.1

y
y2(x)

y1(b)
y2(x)
y(x) y1(x)
y (b)

y1(x)

Algorithm 11.1 uses the fourth-order Runge-Kutta technique to nd the


approximations
to y1 (x) and y2 (x), but other techniques for approximating the solutions to initialvalue problems can be substituted into Step 4.
The algorithm has the additional feature of obtaining approximations for the
derivative of the solution to the boundary-value problem as well as to the solution of
the problem itself. The use of the algorithm is not restricted to those problems for
which the hypotheses of Corollary 11.2 can be veried; it will work for many
problems that do not satisfy these hypotheses. One such example can be found in
Exercise 4.
ALGORITH
M

11.1

Linear Shooting
To approximate the solution of the boundary-value problem
y + p(x)y + q(x)y + r(x) = 0,

for a x b, with y(a) = and y(b) = ,

(Note: Equations (11.3) and (11.4) are written as rst-order systems and solved.)
INPUT endpoints a, b; boundary conditions , ; number of subintervals N .
OUTPUT approximations w1,i to y(xi ); w2,i to y(xi ) for each i = 0, 1, ... , N .
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

11.1 The Linear Shooting Method

675
Step 1 Set h = (b a)/N ;
u1,0 = ; u2,0 = 0; v1,0 = 0; v2,0 = 1.
Step 2 For i = 0, ... , N 1 do Steps 3 and 4.
(The Runge-Kutta method for systems is used in Steps 3 and 4.)
Step 3

Set x = a + ih.

Step 4

Set k1,1 = hu2,i ;

k1,2 = h p(x)u2,i + q(x)u1,i + r(x) ;


k2,1 = h u2,i + 1 1,2
2k

k2,2 = h p(x + h/2) u2,i + 1 k1,22


+q(x + h/2) u1,i + 1 k1,12 + r(x + h/2) ;
k3,1 = h u2,i + 1

2,2
2k

k3,2 = h p(x + h/2) u2,i + 1 k2,22


+q(x + h/2)(u1,i + 1 k2,12 ) + r(x + h/2) ;
k4,1 = h u2,i + k3,2 ;
k4,2 = h p(x + h)(u2,i + k3,2 ) + q(x + h)(u1,i + k3,1 ) + r(x + h) ;
1

u1,i+1 = u1,i + 6 k1,1


+ 2k2,1 + 2k3,1 + k4,1 ;
u2,i+1 = u2,i + 6 k1,2 1+ 2k2,2 + 2k3,2 + k4,2 ;

k1,1 = hv2,i ;
k1,2 = h p(x)v2,i + q(x)v1,i ;
k2,1 = h v2,i + 2 k1,2 1;

1
k2,2 = h p(x + h/2) v2,i + 2 k1,2 + q(x
+ h/2) v1,i + 2 k1,1 ;

k3,1 = h v2,i + 2 k2,2 1;

1
k3,2 = h p(x + h/2) v2,i + 2 k2,2 + q(x
+ h/2) v1,i + 2 k2,1 ;

k4,1 = h v2,i + k3,2 ;

k4,2 = h p(x + h)(v2,i + k3,2 ) + q(x


+ h)(v1,i + k3,1 ) ;

2k2,2 +

v1,i+1 = v1,i + 6 k1,1 1+ 2k2,1 + 2k3,1 + k4,1 ;


1

v2,i+1 = v2,i + 6 k1,2 +


Step 5 Set w1,0 = ;
w2,0 =

u1,N

v 1,N

2k3,2 + k4,2 .

OUTPUT (a, w1,0 , w2,0 ).

Step 6 For i = 1, ... , N


set W 1 = u1,i + w2,0 v1,i ; W 2 = u2,i + w2,0 v2,i ;
x = a + ih;
OUTPUT (x, W 1, W 2). (Output is xi , w1,i , w2,i .)
Step 7

STOP. (The process is complete.)

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

Apply the Linear Shooting technique with N = 10 to the boundary-value problem


2
2
sin(ln x)
, for 1 x 2, with y(1) = 1 and y(2) = 2,
y = y +
x2
x
y+
x2 results to those of the exact solution
and compare the
y = c1 x +

x2

c2

10

3
sin(ln x)

10

cos(ln x),

where
1
c2 =

70

[8 12 sin(ln 2) 4 cos(ln 2)] 0.03920701320

and
11
c1 =

10

c2 1.1392070132.

Solution Applying Algorithm 11.1 to this problem requires approximating the solutions to

the initial-value problems


2
2
y1 = y1 + 2 y1 +

sin(ln x)
x2

, for 1 x 2, with y1 (1) = 1 and y1 (1) = 0,

and
2
2
y2 = y2 + 2 y2 , for 1 x 2, with y2 (1) = 0 and y2 (1) = 1.

The results of the calculations, using Algorithm 11.1 with N = 10 and h = 0.1, are
given in Table 11.1. The value listed as u1,i approximates y1 (xi ), the value v1,i
approximates
y2 (xi ), and wi approximates
y(xi ) = y1 (xi ) + 2 y1 (2)

y2(2)

Table
11.1

xi

1.0
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2.0

u1,i y1 (xi )

v1,i y2 (xi )

1.00000000
1.00896058
1.03245472
1.06674375
1.10928795
1.15830000
1.21248372
1.27087454
1.33273851
1.39750618
1.46472815

0.00000000
0.09117986
0.16851175
0.23608704
0.29659067
0.35184379
0.40311695
0.45131840
0.49711137
0.54098928
0.58332538

wi y(xi )

1.00000000
1.09262917
1.18708471
1.28338227
1.38144589
1.48115939
1.58239245
1.68501396
1.78889854
1.89392951
2.00000000

y2 (xi ).

y(xi )

1.00000000
1.09262930
1.18708484
1.28338236
1.38144595
1.48115942
1.58239246
1.68501396
1.78889853
1.89392951
2.00000000

|y(xi ) wi |
1.43 107

1.34 107
9.78 108
6.02 108
3.06 108
1.08 108
5.43 1010
5.05 109
4.41 109

The accurate results in this example are due to the fact that the fourth-order RungeKutta method gives O(h4 ) approximations to the solutions of the initial-value
problems. Unfortunately, because of roundoff errors, there can be problems hidden in
this technique.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

11.1 The Linear Shooting Method

677

Reducing Round-Off Error


Round-off problems can occur if y1 (x) rapidly increases as x goes from a to b. In this case
u1,N y1 (b) will be large and if is small in magnitude compared to u1,N , the term w2,0 =
( u1,N )/v1,N will be approximately u1,N /v1,N . The computations in Step 6 then become
u1,N
W 1 = u1,i + w2,0 v1,i u1,i

v 1,N
u1,N

W 2 = u2,i + w2,0 v2,i u2,i

v 1,N

v1,i ,
v2,i ,

which allows a possibility of a loss of signicant digits due to cancelation. However,


because
u1,i is an approximation to y1 (xi ), the behavior of y1 can easily be monitored, and if u1,i
increases rapidly from a to b, the shooting technique can be employed backward from x0 =
b to xN = a. This changes the initial-value problems that need to be solved to
y =p(x)y + q(x)y + r(x),
and

y =p(x)y + q(x)y,

for a x b, with y(b) = and y(b) = 0,

for a x b, with y(b) = 0 and y(b) = 1.

If this reverse shooting technique still gives cancellation of signicant digits and if
increased precision does not yield greater accuracy, other techniques must be
used. Some of these are presented later in this chapter. In general, however, if u1,i
O(hn ) approximations
to y1 (xi ) and
and yv21,i(xare
for each i = 0, 1, ... , N , then w1,i will be an O(hn )
i ), respectively,
approximation to y(xi ). In particular,

|w1,i y(xi )| Khn 1 +

v1,i
v1,N

for some constant K (see [IK], p. 426).

EXERCISE SET 11.1


1. The boundary-value problem
y = 4(y x),

0 x 1,

y(0) = 0,

y(1) = 2,

has the solution y(x) = e (e 1)1 (e e2x ) + x. Use the Linear Shooting
the solution, and compare the results to the actual method
solution.to approximate
2

a.

2.

With h = 1 ;

b.

2x

With h = 1 .

The boundary-value problem


y = y + 2y + cos x,

0 x ,

y(0) = 0.3, 2 y

= 0.1

has the solution y(x) = 10 (sin x + 3 cos x). Use the Linear Shooting method to approximate the

solution, and compare the results to the actual solution.


a.

3.

With h = ;

b.

With h = .

Use the Linear Shooting method to approximate the solution to the following boundary-value
problems.
a. y = 3y + 2y + 2x + 3, 0 x 1, y(0) = 2, y(1) = 1; use h = 0.1.
1
b. y = 4x1 y 2x2 y + 2x2 ln x, 1 x 2, y(1) = , y(2)
= ln 2; use h = 0.05.
2

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

678

CHAPTER
Equations

11

Boundary-Value Problems for Ordinary Differential


c.
d.

4.

y = (x + 1)y + 2y + (1 x2 )ex ,

y = x1y + 3x2 y + x1 ln x 1,

0 x 1, y(0) = 1, y(1) = 0; use h = 0.1.


1 x 2, y(1) = y(2) = 0; use h = 0.1.

Although q(x) < 0 in the following boundary-value problems, unique solutions exist and are given.
Use the Linear Shooting Algorithm to approximate the solutions to the following problems, and
compare the results to the actual solutions.
a.
b.

y + y = 0, 0 x

cos x + (
2 1) sin x.
y + 4y = cos x,

= 1, y( ) 4= 1; use h =

,
y(0)
4

0 x 4 , y(0) = 0, y( 4 ) = 0; use h =

20

;
actual solution
y(x) =
20

; actual solution y(x) =

2
2x + 3 cos x.1
13 cos 2x sin
6

c.

y = 4x1 y 2x2 y + 2x2 ln x, 1 x 2, y(1) = 1 , y(2) = ln 2;2 use h = 0.05; actual


solution y(x) = 4x1 2x2 + ln x 3/2.

d.

y = 2y y + xex x,

0 x 2, y(0) = 0, y(2) = 4; use h = 0.2; actual solution

x
y(x) = 1 x3 ex 6 5 xex + 2e
x 2.
3

5.

6.
7.

Use the Linear Shooting Algorithm to approximate the solution y = e10x to the boundary-value
problem
y = 100y, 0 x 1, y(0) = 1, y(1) = e10 . Use h = 0.1 and 0.05.
Write the second-order initial-value problems (11.3) and (11.4) as rst-order systems, and derive
the
equations necessary to solve the systems using the fourth-order Runge-Kutta method for systems.
Let u represent the electrostatic potential between two concentric metal spheres of radii R1 and R2
(R1 < R2 ). The potential of the inner sphere is kept constant at V1 volts, and the potential of the

outer sphere is 0 volts. The potential in the region between the two spheres is governed by
Laplaces
equation, which, in this particular application, reduces to
d2 u
dr2

2 du
r dr

= 0,

R1 r R2 ,

u(R1 ) = V1 ,

u(R2 ) = 0.

Suppose R1 = 2 in., R2 = 4 in., and V1 = 110 volts.

a.
b.

Approximate u(3) using the Linear Shooting Algorithm.


Compare the results of part (a) with the actual potential u(3), where

V1 R1 R2 r

u(r) =

R2 R

.
1

8.

Show that, under the hypothesis of Corollary 11.2, if y2 is the solution to y = p(x)y + q(x)y and
y2 (a) = y2 (b) = 0, then y2 0.

9.

Consider the boundary-value problem


y + y = 0,

10.

0 x b,

y(0) = 0,

y(b) = B.

Find choices for b and B so that the boundaryvalue problem


has one solution
a. No solution
b. Exactly
c. Innitely many solutions.
Attempt to apply Exercise 9 to the boundary-value problem
y y = 0,

0 x b,

y(0) = 0,

y(b) = B.

What happens? How do both problems relate to


Corollary 11.2?

11.2 The Shooting Method for Nonlinear Problems


The shooting technique for the nonlinear second-order boundary-value problem
y = f (x, y, y),

for a x b, with y(a) = and y(b) = ,

(11.6)

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

679

11.2 The Shooting Method for Nonlinear


Problems

is similar to the linear technique, except that the solution to a nonlinear problem cannot be
expressed as a linear combination of the solutions to two initial-value problems. Instead,
we approximate the solution to the boundary-value problem by using the solutions to a
sequence of initial-value problems involving a parameter t. These problems have the form
y = f (x, y, y),

for a x b, with y(a) = and y(a) = t.

(11.7)

We do this by choosing the parameters t = tk in a manner to


ensure that

Shooting methods for nonlinear


problems require iterations to
approach the target.

lim y(b, tk ) = y(b) =where


, y(x, tk ) denotes the solution to the initial-value
problem (11.7) with t = tk , and y(x)
denotes the solution to the boundary-value problem
(11.6).
This technique is called a shooting method by analogy
to the procedure of ring objects at a stationary target.
(See Figure 11.2.) We start with a parameter t0 that

y = f (x, y, y ), fordetermines
a x b, with y(a) = and y(a) = t0 .
the initial elevation at which the object is red from the
point (a, ) and along the curve described by the solution
to the initial-value problem:

Figure
11.2

y
(b, )

y(b, t0)

(b, y(b, t0))

y(x, t0)
Slope t0

(a, )

If y(b, t0 ) is not sufciently close to , we correct our approximation by choosing


elevations t1 , t2 , and so on, until y(b, tk ) is sufciently close to hitting . (See Figure 11.3.)
To determine the parameters tk , suppose a boundary-value problem of the form (11.6)

satises the hypotheses of Theorem 11.1. If y(x, t) denotes the solution to the initialvalue
problem (11.7), we next determine t with
y(b, t) = 0.
(11.8)
This is a nonlinear equation in the variable t. Problems of this type were considered in
Chapter 2, and a number of methods are available.
To use the Secant method to solve the problem, we need to choose initial
approximations
t0 and t1 , and then generate the remaining terms of the sequence by
= tk1

(y(b, tk1 ) tk )(t


k1 tk2 )
y(b, t

k1 )

y(b, tk2 )

k = 2, 3, ... .

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

680

CHAPTER
Equations

11

Boundary-Value Problems for Ordinary Differential

Figure
11.3

y
(b, )

y(b, t2)
y(b, t3)

y(b, t1)

y(x, t2)

y(b, t0)

y(x, t3)

y(x, t1)

y(x, t0)

(a, )
a

Newton Iteration
To use the more powerful Newtons method to generate the sequence {tk }, only one initial
approximation, t0 , is needed. However, the iteration has the form
y(b, tk1 )
tk = tk1
,
(11.9)
dy
dt (b, tk1 )

and it requires the knowledge of (dy/dt)(b, tk1 ). This presents a difculty because an
explicit representation for y(b, t) is not known; we know only the values y(b, t0 ), y(b, t1 ),
... , y(b, tk1 ).

Suppose we rewrite the initial-value problem (11.7), emphasizing that the solution
depends on both x and the parameter t:
y(x, t) = f (x, y(x, t), y(x, t)), for a x b, with y(a, t) = and y(a, t) = t. (11.10)
We have retained the prime notation to indicate differentiation with respect to x. We need
to determine (dy/dt)(b, t) when t = tk1 , so we rst take the partial derivative of (11.10)
with respect to t. This implies that

f
y(x, t), y(x, t))
yt (x, t) = (x,
t
f
x

x
+

(x, y(x, t), y (x, t))

f
y

(x, y(x, t), y (x, t))

(x, y(x, t), y (x, t))

(x, t)

(x, t).
t y

Since x and t are independent,we have x/ t = 0 and the equation simplies to

f
y
f
y(x, t), y(x, t)) (x, t) + (x, y(x, t), y(x, t))
yt (x, t) = (x,
y
t

y
for a x b. The initial conditions give
y
(a, t) = 0
t

and

(x,yt),
t

(11.11)

y t (a, t) = 1.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

681

11.2 The Shooting Method for Nonlinear


Problems

If we simplify the notation by using z(x, t) to denote ( y/ t)(x, t) and assume that
the order of differentiation of x and t can be reversed, (11.11) with the initial
conditions becomes the initial-value problem
f
f
(x, y, y)z(x, t) + (x, y, y)z(x, t), for a x b,
y

y
with z(a, t) = 0 and z(a, t) = 1.
Newtons method therefore requires that two initial-value problems, (11.10) and
(11.12), be solved for each iteration. Then from Eq. (11.9), we have
z(x, t) =

y(b, tk1 )

tk = tk1

z(b, tk1 )

(11.12)

(11.13)

Of course, none of these initial-value problems is solved exactly; the solutions are
approximated by one of the methods discussed in Chapter 5. Algorithm 11.2 uses the RungeKutta method of order four to approximate both solutions required by Newtons method.
A similar procedure for the Secant method is considered in Exercise 5.

ALGORITH
M

11.2

Nonlinear Shooting with Newtons Method


To approximate the solution of the nonlinear boundary-value problem
y = f (x, y, y),

for a x b, with y(a) = and y(b) = :

(Note: Equations (11.10) and (11.12) are written as rst-order systems and
solved.)
INPUT endpoints a, b; boundary conditions , ; number of subintervals
N 2; toler- ance TOL; maximum number of iterations M .
OUTPUT approximations w1,i to y(xi ); w2,i to y(xi ) for each i = 0, 1, ... , N
or a message that the maximum number of iterations was exceeded.
Step 1 Set h = (b a)/N ;
kTK
= 1;
= ( )/(b a).
(Note: TK could also be input.)
Step 2

While (k M ) do Steps 310.

Step 3

Set w1,0 = ; w2,0 = TK ; u1 = 0;

u2 = 1.

Step 4 For i = 1, ... , N do Steps 5 and 6.


(The Runge-Kutta method for systems is used in Steps 5 and 6.)
Step 5

Set x = a + (i 1)h.

Step 6

Set k1,1 = hw2,i1 ;


k1,2 = hf (x, w1,i1 w2,i1 );
k2,1 = h w2,i1 + 2 k1,2 ;
1
1
k2,2 = hf x + h/2, w1,i1 + 2 k1,1 , w2,i1
+ 2 k1,2 ;

k3,1 = h w2,i1 + 2 k2,2 ;1

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

682

CHAPTER
Equations

11

Boundary-Value Problems for Ordinary Differential


1
k3,2 = hf x + h/2, w1,i1 + 2 k2,1 , w2,i1
+ 2 k2,2 ;

k4,1 = h(w2,i1 + k3,2 );


k4,2 = hf (x + h, w1,i1 + k3,1 , w2,i1 + k3,2 );
w1,i = w1,i1 + (k1,1 + 2k2,1 + 2k3,1 + k4,1 )/6;
w2,i = w2,i1 + (k1,2 + 2k2,2 + 2k3,2 + k4,2 )/6;

k1,1 = hu2 ;
1,2
k = h[fy (x, w1,i1 , w2,i1 )u1
+fy (x, w1,i1 , w2,i1 )u2 ];
k2,1 = h u2 + 2 k1,2 1;

k2,2 = h fy (x + h/2, w1,i1 , w2,i1 ) u1 + 2 k1,1


+fy (x + h/2, w1,i1 , w2,i1 ) u2 + 2 k1,2 ;

k3,1 = h u2 + 2 k2,2 1;

k3,2 = h fy (x + h/2, w1,i1 , w2,i1 ) u1 + 2 k2,1

1
2 2,2

+fy (x + h/2, w1,i1 , w2,i1 ) u2 + k


k4,1 = h(u2 + k3,2 );

k4,2 = h fy (x + h, w1,i1 , w2,i1 ) u1 + k3,1


+fy (x + h, w1,i1 , w2,i1 ) u2 + k
u1 = u1 +

[k

u2 = u2 +

[k

+ 1,1 + 2,1 +
+ k
+ 2k + 2k2,2
6 1,2
2k

2k

];3,1

4,1

].3,2

4,2

3,2

Step 7 If |w1,N | TOL then do Steps 8 and 9.

Step 8 For i = 0, 1, ... , N set x = a + ih; OUTPUT


(x, w1,i , w2,i ).
Step 9

(The procedure is complete.) STOP.

w1,N

Set TK = TK

Step 10

;
u1
(Newtons method is used to compute TK.)
k = k + 1.
Step 11 OUTPUT (Maximum number of
iterations exceeded); (The procedure was
unsuccessful.)
STOP.

The value t0 = TK selected in Step 1 is the slope of the straight line through (a, )
and (b, ). If the problem satises the hypotheses of Theorem 11.1, any choice of t0 will
give convergence, but a good choice of t0 will improve convergence, and the procedure will

Example 1

even work for many problems that do not satisfy these hypotheses. One such example
can
be found in Exercise 3(d).
Apply the Shooting method with Newtons Method to the boundary-value problem
1

y = (32 + 2x yy ), for 1 x 3, with y(1) = 17 and y(3) = .


8
3

43

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

683

11.2 The Shooting Method for Nonlinear


Problems
Use N = 20, M = 10, and TOL = 105 , and compare the results with the exact solution

y(x) = x2 + 16/x.
Solution We need approximate solutions to the initial-value problems

y = (32 + 2x yy ), for 1 x 3, with y(1) = 17 and y (1) = tk ,


8

and
f
f
1
z + z = (yz + yz), for 1 x 3, with z(1) = 0 and z(1) = 1,
y

8
y
at each step in the iteration. If the stopping technique in Algorithm 11.2 requires
z =

|w1,N (tk ) y(3)| 105 ,


then we need four iterations and t4 = 14.000203. The results obtained for this value of t
are shown in Table 11.2.

Table
11.2

xi

w1,i

y(xi )

1.0
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9

17.000000
15.755495
14.773389
13.997752
13.388629
12.916719
12.560046
12.301805
12.128923
12.031081
12.000023
12.029066
12.112741
12.246532
12.426673
12.650004
12.913847
13.215924
13.554282
13.927236

17.000000
15.755455
14.773333
13.997692
13.388571
12.916667
12.560000
12.301765
12.128889
12.031053
12.000000
12.029048
12.112727
12.246522
12.426667
12.650000
12.913845
13.215926
13.554286
13.927241

3.0

14.333327

14.333333

|w1,i y(xi )|
4.06 105

5.60 105
5.94 105
5.71 105
5.23 105
4.64 105
4.02 105
3.14 105
2.84 105
2.32 105
1.84 105
1.40 105
1.01 105
6.68 106
3.61 106
9.17 107
1.43 106
3.46 106
5.21 106
6.69 106

Although Newtons method used with the shooting technique requires the solution of
an additional initial-value problem, it will generally give faster convergence than the
Secant method. However both methods are only locally convergent because they
require good initial approximations.
For a general discussion of the convergence of the shooting techniques for nonlinear
problems, the reader is referred to the excellent book by Keller [Keller, H]. In that
reference, more general boundary conditions are discussed. It is also noted that the
shooting technique for nonlinear problems is sensitive to roundoff errors, especially if
the solution y(x) and
z(x, t) are rapidly increasing functions of x on [a, b].
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require
it.

También podría gustarte