Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Solving a Hard BVP with bvp4c

L.F. Shampine Mathematics Department Southern Methodist University Dallas, TX 75275, U.S.A. lshampin@mail.smu.edu June 30, 2004

Introduction

In a paper [1] prepared for the proceedings of a meeting in Tempe, a hard BVP was solved using some new software. To make the point that standard software was not suitable for this problem with singularities at both ends of the interval, an attempt was made to solve the problem with bvp4c. Not surprisingly, it failed. However, we show in this note that if the program is applied skillfully following the guidance of the text [2] for handling the singularities, it is possible to solve the BVP with bvp4c.

The BVP
(z ( )z ( )) m z ( )

The ODE

1 z( ) + z ( ) = 0 1

is to be solved on [0, ) subject to z (0) = 0, z() = 0

The solution should be positive for all 0. The parameters , must satisfy > 0, + 1. The quantity m = 1/2 /(2 2) > 0. An example studied at length in [1] has = 0.1, = 2. The numerical computations reported here were done with these values of the parameters.

Analytical Approximations
ln(1) 1

It is noted in [1] that there is a constant solution of the ODE, namely zconst = e 1

Using the symmetry boundary condition, we approximate the solution near the origin by the constant z(0). In the numerical computations we represent this unknown value as a parameter p1 . At the other end of the interval, we look for an asymptotic solution of the form z( ) p2 / for a positive constant and a parameter p2 . Substituting this form into the ODE and balancing the dominant terms shows that there is a family of solutions with = 1/m.

Numerical Approximation

As exemplied in the text [2], the bvp4c program can be used to solve problems with singularities if they are properly prepared. The idea is to use analytical approximations near the singular points, often involving unknown parameters, that are connected by continuity to a numerical solution on an interval [a, b] where the equations are not singular. For the problem at hand we solve the ODE on an interval with a = 0.001 and b = 70. This interval allows us to compare the solution to Fig. 2 of [1]. To solve the BVP with bvp4c we have to write the second order ODE as a rst order system. This can be done in more than one way. We have let y1 ( ) = z( ) and y2 ( ) = z ( )z ( ). This leads to the system dy1 d dy2 d = y2 y1 y2 1 + 1 y1 y1 y1

= m

The associated boundary conditions are that the numerical solution be continuous with the analytical approximations at the end points: = p1 = 0 p2 y1 (b) = b1/m p1+ 2 y2 (b) = mb1+(1+)/m There are, of course, four boundary conditions because there are two unknown parameters in addition to the two equations. It is reasonable to guess that p1 zconst . A guess for p2 was obtained by computing the value that makes the asymptotic approximation equal to 0.3 at = 10. A guess for the solution on [a, b] was composed of a quadratic polynomial Q( ) on [a, 10] and the asymptotic approximation on [10, b]. The quadratic was dened by Q(0) = p1 , Q (0) = 0, Q(10) = 0.3, the last condition making the overall guess continuous at = 10. With this preparation it was straightforward to solve the BVP with bvp4c using default tolerances. The result displayed in the gure looks like Fig. 2 of [1]. The value of 1.0265 for z(0) is in good agreement with the value computed by other means in the paper. 2 y1 (a) y2 (a)

z() when = 0.1 and = 2. Computed z(0) 1.0265. 1.4

1.2

0.8

0.6

0.4

0.2

10

20

30 40 50 Solved on 0.001 <= <= 70.

60

70

References
[1] C. Budd, O. Koch, and E. Weinmller, From nonlinear PDEs to singular u ODEs, private communication. [2] L.F. Shampine, I. Gladwell, and S. Thompson, Solving ODEs with Matlab, Cambridge Univ. Press, New York, 2003.

You might also like