# Spline solutions for nonlinear two point boundary value problems

17

Loading.... (view fulltext now)

Loading....

Loading....

Loading....

Loading....

## Full text

(1)

3

### A. USMANI

Department of Applied Mathematics The University of Manitoba

Winnipeg, Manitoba R3T 2N2 Canada

(Received April 27, 1979)

ABSTRACT. Necessary formulas are developed for obtaining cubic, quartic,

quintic, and sextic spline solutions of nonlinear boundary value problems.

These methods enable us to approximate the solution of the boundary value problems, as well as their successive derivatives smoothly. Numerical

evidence is included to demonstrate the relative performance of these four

techniques.

Point

Relations.

### 65L10

1. PRELIMINARIES

(2)

152 R.A. USMANI

insertion of N Knots {x defined by x a

nh, h (b

i),

n n

n 0(1)N

### +

i, and let s(x) be a spline function of degree m on

### [a,b].

Thus,

in each subinterval

i,

### Xi+l],

s(x) is a polynomial of degree at most m and

### cm-i

s (x) e [a,b]. We shall designate this polynomial by

j=m

j

P.(x)

(x- x

### i)

i 0(1)N, x e ixi,

### Xi+l].

(i.i)

l

j=0

In this paper we shall present some methods for the continuous approximation of the solution of the two point real nonlinear boundary value problem

y (x) f(x, y(x)), a < x

### -<

b

y(a) A y(b) B 0 (1.2)

by the use of spline functions of orders up to six. The function f(x, y(x)) is

a continuous function of two variables with f continuous and nonnegative in

Y

the strip S defined by S: a < x < b, < y < It is well-known that the

boundary value problem

### (1.2)

with these conditions has a unique solution (Henrici ill,

### .

347).

2. CUBIC SPLINE SOLUTION

### (m

3)

The possiblities of using spline functions for obtaining smooth approximations

of the solution of boundary value problems were first briefly discussed by

Ahlberg et al. . Following this,Bickley  and Albasiny et al. 

have demonstrated the use of cubic spline function for obtaining an approximate

solution of (1.2) when

f(x, y(x))

q(x) y(x)

### r(x).

The authors of the latter have,in particular,established via different

notations than ours,the recurrence relation

(3)

A

B 0, i I(1)N,

where

### Yi

denotes spline approximation to y(x

### i)

y(x) being the exact solution of the system (1.2). The unknowns

### Yi’

i I(1)N are first obtained by solving

the tridiagonal system of nonlinear algebraic equations (1.3),

### Mi,

i 0(1)N +i are subsequently computed by M

i

### Yi

where we designate

e ixi,

### Xi+l].

Finally the coefficients of (i.I) are determined from the relations

I

### Yi

(1.4)

We can also show that

i 0(1)N

M

i N

### +

i.

N

The approximate values of y(x) and its derivative at the points other than knots are obtained by evaluating or differentiating the corresponding cubic

spline polynomial.

3. SOLUTION OF NONLINEAR

### EQUATIONS

(i.3)

The method which we shall use to obtain the solution of the system (1.3)

is a generalization of

### Newton’s

method which we summarize very briefly for

the sake of completeness (Henrici [I], p.355). Let the nonlinear equations

(1.3) in N unknown

### Yi

be written in the form

0, i I(1)N

(4)

154 R.A. USHANI

(3.2)

where

## --

Y

### (yl)

are N dimensional vectors. Let M(Y)

### (mlj)

denote the matrix with elements

i, j

Then the

### Newton’s

method for the solution of

### (3.1)

is written in the form

(p 0,i, ).

(3.3)

(3.4)

In our case

elements

### mij

are given as follows:

2

i

-1

i

1

0

where

). The vector

### (Y)

is usually referred to as residual vector. The criterion for stopping the iterations defined by

### (3.4)

is that the residual vector

be such that

<

### ,

(p 0,, ), (3.6)

where e is a preassigned small positive quantity.

Also, the system of nonlinear equations (3.2) has a unique solution Y, to which the successive approxtions

### Y(P)

defined by (3.4) convergeprovided

0 < o orS"( < 0.5, (3.7)

(5)

(3.8)

i

j

### (3.10)

(Note for a vector v

### ]lv[[

max i

and for a matrlx M

max

### [mljl

We can verify that

### (3.7)

will be satisfied for the system

if

### h2G

< 6 with G max f and (x,y) y

64(b-

### +

R]H < i/2, (3.11)

where the function Q(x) providing the initial approximation is such that

max

R max

f(x,

and

x x

y) (x,y)

### fyy’

In deriving (3.11),we use the theory of monotone matrices as given by

Henrici

p.

### 360).

If the initial approximation vector

### (Q(xi))

be such that the quantity R is small, then it follows from

### (3.11)

that

the solution of the system

obtained by

### Newton’s

method will converge

to the solution of (1.2) for all sufficiently small values of h.

4.

### QUARTIC

SPLINE SOLUTION

We now consider (i.i) for m 4. With the analogy of section 2

on cubic spline, we can determine the five coefficients of (i.i) in terms

of

and D

(6)

156 R.A. USMANI

D x [x

i, ].

i 3

### Xi+l

A simple calculation gives

1

3

I

### Yi’

i 0(1)N.

Continuity of the first and third derivative at x x

i gives the relations

[that is

and

i-I

f

i, 4

ai

0

1 2 1,3 ,3

1

### ai,

1

which on using (4.1) reduce to

(4.2)

and

D

i

1 2(yi

h(Mi

### Mi-l)/12"

(4.4) We equate the expressions on the right side of the equality sign in (4.3) and

### (4.4)

respectively and obtain

### Mi-1)/i2

which collapses,on simplification,to the recurrence relation

### (4.5)

which is the same as the well-known

### Noumerov’s

formula. As before, we first

determine the unknowns

(7)

algebraic equations by

### Newton’s

iterative method explained in the previous section and then compute

i l(1)N+l, using

### (4.3)

in conjunction with (Usmani, [5

h2

f(x0,

### (h2/12)g0

]. (4.6)

And now the knowledge of

### Mi’

i 0(1)N+I enables us to produce the

coefficients of quartlc spline as given by

### (4.1).

An approximation of the

third derivative at knots is given by

l, i

0

3

2

i N+I.

5.

### QUINTIC

SPLINE SOLUTION We now consider (I.i) for m=5.

iv

Set

e [xi,

### Xi+l].

As before, we can compute the coefficients

of (i.i) in terms of

### Si’ Si+l

in the form (Spath,

0

(5.1)

/ (6h)

3

h

1

1

### Yi’

i 0(1)N,

From the continuity of first and third derivatives at x x

i, we have

i

4M.

/h

2

360

y

4 (5 2)

i

i-i

1

4Si

1

1

(8)

158 R.A. USMANI

S

i

2yi

4

1

18Mi

i

### (5.4)

On substituting the values of S., j i-l, i, i+l either in

or in

### (5.3),

we readily derive the desired relation

1

i

### (5.5)

This recurrence relation only gives (N-2) equations in the N unknowns

### Yi"

In an analogous manner we derive two more relations, namely

M

(ii)

### (5.6)

Now the determination of N unknowns

### Yi

can be effected by solving the nonlinear

algebraic equations

and

The knowledge of

### Yi’

i 0(1)N+I, enables us

to compute M

i, i

### 0(1)N+I

and finally Si, i

using

The

quantities S

O and

### SN+

1 can be computed from the formulas

(i)

(ii)

1 0.I[

2

1

5yN

1

) 21SN

1

In fact we use

### (5.7)

for N 3 and for N>3 we can use more accurate formulas obtained from

268

### +

Si+2

which is easily derived on eliminating

from (5.2) and

### (5.3).

Finally, the knowledge of

i

### 0(1)N+I

enables us to write down the coefficients of (i.i) as given by

We also have

(9)

i

1

i N

i, and

i

h

S

6, +/- N+.

### 6.

SEXTIC SPLINE SOLUTION

We finally consider (i.i) for m 6. With the analogy of the previous sections, we compute the coefficients of (i.i) in terms of

I,

and

1 in the form

/

2

1

1

1

4

5

6

### Yi,i

O(1)N.

Continuity of the first, third, and fifth derivatives at x x

i givesthe relations

D

(10)

160 R.A. USMANI

(6.3)

9S

i

(6.4)

From

(6.3) and (6.2),

### (6.4),we

derive the following relations h2

h

(6.5)

h2 4M

i

1

1ISi

/6 h4 (6.6)

From

and

we deduce

20

2h

z 2

28M.

(6.7)

1

z

### )/360.

(6.8)

From (6.5)and (6.7) [Note we can also use (6.6) and

### (6.7)],we

obtain on

eliminating S

i s the recurrence relation

1

i

### 2(1)N-I,

which gives (N-2) nonlinear algebraic equations in the N unknowns

### Yi"

We develop two more equations similar to those given by (5.6) in the form

(i) 10y

0 19yI

8y2

### M3]’

(6 .i0)

(11)

We first solve (6.9) and (6.10) and determine

### Yn’

n I(1)N; M

i are then determined as before. The knowledge of

### Yl

and Mi enables us to compute

i

### I(1)N

using (6.7). As in section 5, S

O and

### SN+

1 are computed from

or

### (5.8)

depending according as N 3 or N > 3. Having determined

### Mi’

S

i, i 0(1)N+I, we evaluate the coefficients of (i.i) as given by (6.1).

The first derivatives at the knots are computed recursively from the formula

### (6.2)

using the starting value for the first derivative as given below

(see Usmani

eqn. 3.6 (i)):

[-

### (6.11)

This formula is suitable for N -3.

### However,

for N > 3, a

more accurate formula, namely

D

O 5 5y0

9yI 4 5y2

S

n=0

i

where

### 33600

(937, 18240, 5990, 140, -135, 28), could be used

Usmani,

### ,

eqn. 3.7(i)).

Finally,the third and fifth derivatives are given by the following formulas:

3 i

(6.13)

I

1 i O(1)N

(5)

1

5

1

3

N+I

(6.14)

I

7. CONVERGENCE

(12)

162 R.A. USMANI

e

i y(x

y+/-and E (e

T (t

### n)

are N-dimensional vectors; then the error equation

in any of the four methods is obtained in a standard manner in the form

where M is a tridlagonal matrix for cubic and quartic spline functions and

M is a five band matrix for quintic and sextlc spllne solutions of the boundary

value problem (1.2). It is easily seen that the truncation error associated with (i.3) is 0(h

and

(b

### a)2/(8h2)

where the elements of M are given by (3.5). Thus we easily deduce that for a cubic spline solution of (1.2)

(Henrici, [i])

from

### this,

it follows that as h / 0 (i.e. N / ) the cubic spline solution

/

### Y(Xi)"

Thus cubic spline solution based on (1.3) is a second order convergent process. We can similarly prove that the quartlc spllne solution

based on (4.5) is a fourth order convergent process.

In order to prove the convergence of the quintic solution based on

### (5.5)

and (5.6), we observe that the truncation error is given by

<

<

t

i

i

<

<

### XN+l

We can establish that

<

M

6 max

### [y(6)(x)l

x

(7.3)

(7.4)

The elements of the corresponding matrix M are given below

(13)

i

7

i=j =i, N

6

i j 2(1)N-I

2

i

### li-j[

=2

0, otherwise.

The error analysis depends on the properties of the matrix M and M where M is a five band matrix obtained from M by setting each

so that M

and.

7, (7.6)

6, i j, i

### O,

otherwise.

From the theory of monotone matrices (Henrici,

### [i]),it

follows that both M

and are monotone matrices if

### 13h2G

< 20. Also,it is easily seen that

M PQ,

where P

### ),

Q are tridiagonal matrices with

2,

i,

1;

4,

1,

1.

<

(14)

164 R.A. USMANI

<

_< [(b

### 1/2]/6.

This follows from Fischer and Usmani . Now from (7.1),

and

it ollows that

<

0(h

### 0(h4).

(7.10)

Following a similar t.echniqu%we can establish that for m sextic spline

solution

<

### 6.

8. NUMERICAL ILLUSTRATIONS

We solve two nonlinear boundary value problems of the form (1.2).

0 5(x

y

1)3 y(0) y() 0,

with y(x)

### 2/(2

x) x- i. The function Q(x) is chosen to satisfy the

system

0.5(x

1)

### Q(0)

Q(1) 0 so that Q(x) [(i

5 31x

y(0) y(1) 0,

with y(x) n(2)

2 n[C

1.3360557.

### (8.2)

Here Q(x) [sinh x

sinh (i

### x)]/sinh

1 i. The numerical calculations

are made using double precision arithmetic in order to keep the rounding

errors to a minimum. The numerical results are briefly summarized in

Tables i- 3.

9. CONCLUDING REMARKS

Our numerical results on test problems indicate that results based on

quintic and sextic spline are only marginally better than those obtained by

quartic spline solution.

### Moreover,

in order to obtain nonlinear equations

equal to the number of unknowns in quintic and sextic spline solution,an

ad hoc procedure is used near the boundaries of the interval. Also, the

(15)

quartic spline solution the bandwidth of the matrices that arise is three, which makes them slightly simpler to implement. Since formulas (1.3) and

### (4.5)

satisfy the conditions of Theorem 7.4 (Henrici

### [I]),

Richardson’s

h2 extrapolation method can be used to push the accuracy of these formulas

to 0(h

and 0(h

### 6)

respectively, whereas in case of quintic and sextic spline solut ions we can only use h-extrapolation technique to improve the numerical

solution. The latter techniques also suffer from a disadvantage that they

require approximate formulas for S

O and

### SN+

I [see (5.7)]. Similarly,in sextic spline solution, in order to compute

### Di,

i I(1)N+I, we must provide

D

O [see

### (6.11)].

Finally,in the opinion of this

### author,

one should rely on quartic spline

solution for a smooth approximation of the solution and its successive

derivates for the nonlinear boundary value problem of the type (1.2).

Table I

Observed max. error

for (s.x) in

### Yi

based on

N h cubic quart ic quintic sextic spllne

i

### 1/2

0.212-1 0.287-2

3 1/4 0.480-2 0.248-3 0.205-3 0.208-3

7 i/8 0.ii7-2 0.164-4 0.648-5 0. 780-5

0.i05-5 0.216-6 0.204-6

-i

(16)

166 R.A. USMANI

Table II

h

### 1/8,

observations based on quintic spline solution

Problem

### (8.2)

number of iterations

### ’c)11

0.703-1

0.578-3 0.349-7 0.167-15

0.545-3

0.106-7

0.555-11

0.648-5

0.493-7

Table

Problem

### (8.2),

h 0.25, observed max. errors based on sextic spline solution

### Yi

0.0 0.0 0.407-5 0.851-8 0.459-2

0.25 0.340-5 0.333-4 0.313-5 0. 511-2

### O.

50 O. 288-5 O. 387-4 O. 257-5 O.620-2

O. 75 O. 340-5

### O.

442-4 O. 313-5 O.725-2

(17)

REFERENCES

[i] Henrici, P. Discrete variable methods in ordinary differential

equations, John Wiley, New York, 1961.

 Ahlberg, J.H., Nilson, E.N., Walsh, J.L. The Theory of Splines and

their applications, Academic Press, New York, 1967.

[ 3] Bickley, W.G. Piecewise cubic interpolation and two point boundary

value problems, Computer Journal, Vol. ii (1968) pp. 202-208.  Albasiny, E.L., Hoskins, W.D. Cubic Spline Solutions to Two

Point Boundary Value Problems, Computer Journal, Vol. 12,

### (1969)

pp. 151-153.

 Usmani, R.A. A note on the numerical integration of nonlinear equations with mixed boundary conditions, Utilitas Mathematica, Vol. 9,

### (1976)

pp. 181-192.

 Spth, H. Spline algorithms for curves and surfaces (translation

from German by W. D. Hoskins and H. W.

### Sager),

Utultas Mathema=ica Publishing Inc., Winnipeg, Canada, 1974.

 Usmani, R.A. Discrete variable methods for a boundary value problem

with engineering applications, Mathematics of Computation, Vol. 32,

### (1978)

No. 144, pp. 1087-1096.

 Fischer, C.F. and Usmani, R.A. Properties of some tridiagonal matrices

and their applications to boundary value problems, SlAM J. Numer. Anal.,

Updating...

Updating...