0% found this document useful (0 votes)
29 views8 pages

Class Lecture and Tutorial-14 (Boundary Value Shooting Method) - 2

Class lecture and tutorial-14(Boundary value Shooting method)_2Class lecture and tutorial-14(Boundary value Shooting method)_2

Uploaded by

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

Class Lecture and Tutorial-14 (Boundary Value Shooting Method) - 2

Class lecture and tutorial-14(Boundary value Shooting method)_2Class lecture and tutorial-14(Boundary value Shooting method)_2

Uploaded by

aawasif036
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CHAPTER

11 Boundary-Value Problems for Ordinary


Differential Equations

Introduction
A common problem in civil engineering concerns the deflection of a beam of rectangular
cross section subject to uniform loading while the ends of the beam are supported so that
they undergo no deflection.

S S
0 l x
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
d2w S qx
(x) = w(x) + (x − l),
dx 2 EI 2EI
where w(x) is the deflection a distance x from the left end of the beam. Since no deflection
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 first 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 specified 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 first-order differential equations, only one condition is specified,
so there is no distinction between initial-value and boundary-value problems. We will be
considering second-order equations with two boundary values.
Physical problems that are position-dependent rather than time-dependent are often
described in terms of differential equations with conditions imposed at more than one point.

671

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.
672 C H A P T E R 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, (11.1)

together with the boundary conditions

y(a) = α and y(b) = β. (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 + e−xy + sin y = 0, for 1 ≤ x ≤ 2, with y(1) = y(2) = 0,

has a unique solution.

Solution We have

f (x, y, y ) = −e−xy − sin y .

and for all x in [1, 2],


 
fy (x, y, y ) = xe−xy > 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


is linear when functions p(x), q(x), and r(x) exist with
linear powers of y and its
f (x, y, y ) = p(x)y + q(x)y + r(x).
derivatives.
Problems of this type frequently occur, and in this situation, Theorem 11.1 can be simplified.

Corollary 11.2 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) = β,
satisfies
(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 first consider the initial-
value 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 conflict with the hypotheses of Corollary 11.2
is considered in Exercise 8.) Define
β − y1 (b)
y(x) = y1 (x) + y2 (x). (11.5)
y2 (b)
Then y(x) is the solution to the linear boundary problem (11.3). To see this, first note that
β − y1 (b) 
y (x) = y1 (x) + y (x)
y2 (b) 2
and
β − y1 (b) 
y (x) = y1 (x) + y (x).
y2 (b) 2
Substituting for y1 (x) and y2 (x) in this equation gives
β − y1 (b)  
y = p(x)y1 + q(x)y1 + r(x) + p(x)y2 + q(x)y2
y2 (b)
   
 β − y1 (b)  β − y1 (b)
= p(x) y1 + y + q(x) y1 + y2 + r(x)
y2 (b) 2 y2 (b)
= 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 C H A P T E R 11 Boundary-Value Problems for Ordinary Differential Equations

Moreover,
β − y1 (b) β − y1 (b)
y(a) = y1 (a) + y2 (a) = α + ·0=α
y2 (b) y2 (b)
and
β − y1 (b)
y(b) = y1 (b) + y2 (b) = y1 (b) + β − y1 (b) = β.
y2 (b)

Linear Shooting
This “shooting” hits the target The Shooting method for linear equations is based on the replacement of the linear boundary-
after one trial shot. In the next value problem by the two initial-value problems (11.3) and (11.4). Numerous methods are
section we see that nonlinear available from Chapter 5 for approximating the solutions y1 (x) and y2 (x), and once these
problems require multiple shots. 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
y 2(x)
β
β  y1(b)
y(x)  y1(x)  y 2(x)
y 2(b)

α y 1(x)

a b x

Algorithm 11.1 uses the fourth-order Runge-Kutta technique to find the approximations
to y1 (x) and y2 (x), but other techniques for approximating the solutions to initial-value
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 verified; it will work for many problems that do not satisfy these
hypotheses. One such example can be found in Exercise 4.

ALGORITHM Linear Shooting


11.1
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 first-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 + 21 k1,2 ;
  
k2,2 = h p(x + h/2) u2,i + 21 k1,2
  
+q(x + h/2) u1,i + 21 k1,1 + r(x + h/2) ;
 
k3,1 = h u2,i + 21 k2,2 ;
  
k3,2 = h p(x + h/2) u2,i + 21 k2,2

+q(x + h/2)(u1,i + 21 k2,1 ) + 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) ;
 
u1,i+1 = u1,i + 16 k1,1 + 2k2,1 + 2k3,1 + k4,1 ;
 
u2,i+1 = u2,i + 16 k1,2 + 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 + 21 k1,2 ;

  
  

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

 1 

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

  
  

k3,2 = h p(x + h/2) v2,i + 21 k2,2 + q(x + h/2) v1,i + 21 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 );
    

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

v2,i+1 = v2,i + 6 k1,2 + 2k2,2 + 2k3,2 + k4,2 .
1

Step 5 Set w1,0 = α;


β − u1,N
w2,0 = ;
v1,N
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.
676 C H A P T E R 11 Boundary-Value Problems for Ordinary Differential Equations

Example 2 Apply the Linear Shooting technique with N = 10 to the boundary-value problem
2 2 sin(ln x)
y = − y + 2 y + , for 1 ≤ x ≤ 2, with y(1) = 1 and y(2) = 2,
x x x2
and compare the results to those of the exact solution
c2 3 1
y = c1 x + 2
− sin(ln x) − cos(ln x),
x 10 10
where
1
c2 = [8 − 12 sin(ln 2) − 4 cos(ln 2)] ≈ −0.03920701320
70
and
11
c1 = − c2 ≈ 1.1392070132.
10

Solution Applying Algorithm 11.1 to this problem requires approximating the solutions to
the initial-value problems
2 2 sin(ln x)
y1 = − y1 + 2 y1 + , for 1 ≤ x ≤ 2, with y1 (1) = 1 and y1 (1) = 0,
x x x2
and
2 2
y2 = − y2 + 2 y2 , for 1 ≤ x ≤ 2, with y2 (1) = 0 and y2 (1) = 1.
x x
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
2 − y1 (2)
y(xi ) = y1 (xi ) + y2 (xi ).
y2 (2)

Table 11.1 xi u1,i ≈ y1 (xi ) v1,i ≈ y2 (xi ) wi ≈ y(xi ) y(xi ) |y(xi ) − wi |


1.0 1.00000000 0.00000000 1.00000000 1.00000000
1.1 1.00896058 0.09117986 1.09262917 1.09262930 1.43 × 10−7
1.2 1.03245472 0.16851175 1.18708471 1.18708484 1.34 × 10−7
1.3 1.06674375 0.23608704 1.28338227 1.28338236 9.78 × 10−8
1.4 1.10928795 0.29659067 1.38144589 1.38144595 6.02 × 10−8
1.5 1.15830000 0.35184379 1.48115939 1.48115942 3.06 × 10−8
1.6 1.21248372 0.40311695 1.58239245 1.58239246 1.08 × 10−8
1.7 1.27087454 0.45131840 1.68501396 1.68501396 5.43 × 10−10
1.8 1.33273851 0.49711137 1.78889854 1.78889853 5.05 × 10−9
1.9 1.39750618 0.54098928 1.89392951 1.89392951 4.41 × 10−9
2.0 1.46472815 0.58332538 2.00000000 2.00000000

The accurate results in this example are due to the fact that the fourth-order Runge-
Kutta 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 − v1,i ,
v1,N
 
u1,N
W 2 = u2,i + w2,0 v2,i ≈ u2,i − v2,i ,
v1,N
which allows a possibility of a loss of significant 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), for a ≤ x ≤ b, with y(b) = α and y (b) = 0,

and

y =p(x)y + q(x)y, for a ≤ x ≤ b, with y(b) = 0 and y (b) = 1.

If this reverse shooting technique still gives cancellation of significant 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 and v1,i are O(hn ) approximations
to y1 (xi ) and y2 (xi ), respectively, for each i = 0, 1, . . . , N, then w1,i will be an O(hn )
approximation to y(xi ). In particular,
 

n v1,i 
|w1,i − y(xi )| ≤ Kh 1 + ,
v1,N 
for some constant K (see [IK], p. 426).

E X E R C I S E S E T 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) = e2 (e4 − 1)−1 (e2x − e−2x ) + x. Use the Linear Shooting method to approximate
the solution, and compare the results to the actual solution.
a. With h = 21 ; b. With h = 41 .
2. The boundary-value problem
π 
y = y + 2y + cos x, 0≤x≤ π
2
, y(0) = −0.3, y 2
= −0.1

has the solution y(x) = − 101 (sin x + 3 cos x). Use the Linear Shooting method to approximate the
solution, and compare the results to the actual solution.
a. With h = π4 ; b. With h = π8 .
3. 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.
b. y = −4x −1 y − 2x −2 y + 2x −2 ln x, 1 ≤ x ≤ 2, y(1) = − 21 , y(2) = ln 2; use h = 0.05.

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 C H A P T E R 11 Boundary-Value Problems for Ordinary Differential Equations

c. y = −(x + 1)y + 2y + (1 − x 2 )e−x , 0 ≤ x ≤ 1, y(0) = −1, y(1) = 0; use h = 0.1.


d. y = x−1y + 3x −2 y + x −1 ln x − 1, 1 ≤ x ≤ 2, y(1) = y(2) = 0; use h = 0.1.
4. 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. y + y = 0, 0 ≤ x ≤ π4 , y(0) = 1, y( π4 ) = 1; use h = 20 π
; actual solution y(x) =

cos x + ( 2 − 1) sin x.
b. y + 4y = cos x, 0 ≤ x ≤ π4 , y(0) = 0, y( π4 ) = 0; use h = 20
π
; actual solution y(x) =

− 13 cos 2x − 62 sin 2x + 13 cos x.
c. y = −4x −1 y − 2x −2 y + 2x −2 ln x, 1 ≤ x ≤ 2, y(1) = 21 , y(2) = ln 2; use h = 0.05; actual
solution y(x) = 4x −1 − 2x −2 + 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
y(x) = 16 x 3 ex − 53 xex + 2ex − x − 2.
5. Use the Linear Shooting Algorithm to approximate the solution y = e−10x to the boundary-value
problem

y = 100y, 0 ≤ x ≤ 1, y(0) = 1, y(1) = e−10 .

Use h = 0.1 and 0.05.


6. Write the second-order initial-value problems (11.3) and (11.4) as first-order systems, and derive the
equations necessary to solve the systems using the fourth-order Runge-Kutta method for systems.
7. 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 Laplace’s
equation, which, in this particular application, reduces to
d 2 u 2 du
+ = 0, R1 ≤ r ≤ R2 , u(R1 ) = V1 , u(R2 ) = 0.
dr 2 r dr
Suppose R1 = 2 in., R2 = 4 in., and V1 = 110 volts.
a. Approximate u(3) using the Linear Shooting Algorithm.
b. Compare the results of part (a) with the actual potential u(3), where
 
V1 R1 R2 − r
u(r) = .
r R2 − R1
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, 0 ≤ x ≤ b, y(0) = 0, y(b) = B.

Find choices for b and B so that the boundary-value problem has


a. No solution b. Exactly one solution c. Infinitely many solutions.
10. 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.

You might also like