You are on page 1of 9

August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

289

A NEW COLLOCATION METHOD FOR A BVP

F. A. COSTABILE∗ and E. LONGO∗∗


Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com

Dipartimento di Matematica,
Università degli Studi della Calabria, Italy
∗ E-mail: costabil@unical.it
∗∗ E-mail:longo@mat.unical.it
by MONASH UNIVERSITY on 02/27/16. For personal use only.

A type collocation method for the global solution of the general non linear
second order boundary value problem
 00
 y (x) = f (x, y(x), y 0 (x)) x ∈ [a, b]
y(a) = ya

y(b) = yb

is proposed. An analysis of the global error and an algorithm for the numerical
calculation are given. Finally, numerical examples and comparisons with other
methods are presented.

Keywords: boundary value problem; collocation method; interpolation.

1. Introduction
In Ref. 3, after a discussion on the class of methods for numerical integration
of the following non linear two-point boundary value problem:
 00 0
 y (x) = f (x, y(x), y (x)) x ∈ [a, b]
y(a) = ya (1)

y(b) = yb

a spectral method is proposed which is a collocation method on the zeros


of Chebyshev polynomials of the second kind. In particular, the following
theorem is proven:

Theorem 1.1 (3 ). Let Tk (x) be the Chebyshev polynomial of the first kind
of degree k and
πi
xi = cos , i = 1, ..., n (2)
n+1
August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

290

the zeros of the Chebyshev polynomials of the second kind of degree n, by


putting
" n #
1 πi X Gk (x) kπi ¡ 2 ¢ πi
βn,i (x) = sin sin + x − 1 sin ,
n+1 n+1 k n+1 n+1
k=2
(3)
where
(
2x
Tk+1 (x) Tk−1 (x) 2 even k
Gk (x) = − + k 2−1 ,
k+1 k−1 k −1 odd k
2
Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com

then the polynomial of degree n + 1 implicitly defined by


Xn
yb + ya yb − ya
yn (x) = + x+ βn,i (x)f (xi , yn (xi ), yn0 (xi )), n > 1, (4)
by MONASH UNIVERSITY on 02/27/16. For personal use only.

2 2 i=1

satisfies the relations



 yn (−1) = ya
y (1) = yb (5)
 n00
yn (xi ) = f (xi , yn (xi ), yn0 (xi )) i = 1, ..., n.
i.e., it is a collocation polynomial for the BVP on the set of nodes xi .

Moreover, in Ref. 3 an efficient algorithm for numerical calculation and


the estimation error are, also given.
In this note we will prove that the collocation polynomials for (1) in
the form (4) are possible for any set of distinct nodes xi ∈ ]−1, 1[. This is
based on an interpolation problem which will be examined in Ref. 4, while
now in section 2 we report the relevant results. The rest of the paper is
organized as follows: in section 3 we provide the general method and an a
priori estimation error; in Section 4 we propose a numerical algorithm for
the calculation and, finally, present certain numerical examples to compare
the method proposed with the Matlab build-in function bvp4c.

2. The general linear interpolation problem


In Ref. 4 there is the following main theorem:
Theorem 2.1 (4 ). Let Pn be the space of polynomials of degree ≤ n and
x1 , ..., xn−1 n − 1 distinct points in ]−1, 1[. Let li (x) be the fundamental
polynomials of Lagrange calculated on the n − 1 nodes xi and
Z 1
pn,i (x) = G(x, t)li (t)dt, i = 1, ..., n − 1 (6)
−1
August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

291

where
(
(t+1)(x−1)
2 t≤x
G(x, t) = (x+1)(t−1) (7)
2 x≤t
Let ω0 , ω1 , ..., ωn−1 , ωn ∈ R, then the polynomial
X n−1
ωn + ω0 ωn − ω0
yn (x) = + x+ pn,i (x)ωi (8)
2 2 i=1

is the unique element of Pn that satisfies the interpolation conditions


Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com

 00
 yn (xi ) = ωi , i = 1, ..., n − 1,
y (−1) = ω0, (9)
 n
yn (1) = ωn .
by MONASH UNIVERSITY on 02/27/16. For personal use only.

An alternative representation of the polynomial basis is, also possible;


in fact, the following theorem holds:

Theorem 2.2 (4 ). With the notations already introduced we have


¯ ¯
¯ 1 x1 x2 x3 ... xn ¯
¯ ¯
¯ 1 −1 1 −1 ... (−1) n ¯
¯ ¯
¯1 1 1 1 ... 1 ¯
¯ ¯
¯ 0 0 2 6x ... n(n − 1) (x )n−2 ¯
¯ 1 1 ¯
(−1)i ¯¯ .. .. ¯
¯
pn,i (x) = ¯. . ¯, i = 1, ..., n−1
G ¯ n−2 ¯
¯ 0 0 2 6xi−1 ... n(n − 1) (xi−1 ) ¯
¯ ¯
¯ 0 0 2 6xi+1 ... n(n − 1) (xi+1 )n−2 ¯
¯ ¯
¯ .. .. ¯
¯. . ¯
¯ ¯
¯ 0 0 2 6x ... n(n − 1) (x )
n−2 ¯
n−1 n−1
(10)
with
n−1
Y
G = 2 ∗ n!(n − 1)! (xi − xj ), (11)
i>j

3. The method
Let us consider the boundary value problem
 00 0
 y (x) = f (x, y(x), y (x)) x ∈ [−1, 1] , −∞ < y, y 0 < ∞
y(−1) = ya (12)

y(1) = yb
August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

292

We assume that f (x, z1 , z2 ) is a real function defined and continuous on the


strip S = [−1, 1] × R2 where it has continuous derivatives which satisfy, for
some positive constant M ,
¯ ¯
∂f ¯ ∂f ¯
> 0, ¯ ¯ ¯ ≤ M.
∂z1 ∂z2 ¯
Moreover, we assume that f satisfies a uniform Lipschit condition in z1 e z2 ,
which means that there exist two nonnegative constants L and K such that,
whenever (x, y1 , y2 ) and (x, y 1 , y 2 ) are in the domain of f , the inequality
Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com

|f (x, y1 , y2 ) − f (x, y 1 , y 2 )| ≤ L |y1 − y 1 | + K |y2 − y 2 | .


holds. Under this hypotheses the BVP has a unique solution y(x).
With the notation already introduced the following theorem holds:
by MONASH UNIVERSITY on 02/27/16. For personal use only.

Theorem 3.1. For n > 1, the polynomial of degree n, implicitly defined by


X n−1
yb + ya yb − ya
yn (x) = + x+ pn,i (x)f (xi , yn (xi ), yn0 (xi )) (13)
2 2 i=1

satisfies the relations


 00 0
 yn (xi ) = f (xi , yn (xi ), yn (xi )), i = 1, ..., n − 1,
y (−1) = ya , (14)
 n
yn (1) = yb ,
i.e., it is a collocation polynomial for the problem (12) on the set of nodes
x1 , ..., xn−1 .

Proof. Follows from theorem 2.1 setting


 0
 ωi = f (xi , yn (xi ), yn (xi )), i = 1, ..., n − 1,
ω = ya ,
 0
ωn = yb .

4. Global error
For the estimation of the global error
y (s) (x) − yn(s) (x), s = 0, 1, 2,
by putting
n−1
X
Λn = max |li (x)| (15)
−1≤x≤1
i=1
August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

293

and
¯ (n+1) ¯
¯y (ξx )(x − x1 ) · · · (x − xn−1 ) ¯¯
R = max ¯ ¯ (16)
−1≤x,ξx ≤1 (n − 1)! ¯

we have the following theorem:

Theorem 4.1 (3 ). If y ∈ C n+3 ([−1, 1]), L and K are the Lipschitz con-
stants of function f such that 1 − 2Λn K > 0 and 1 − Λn (2K + L) > 0,
then
Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com

° ° cR
° (s) °
°y (x) − yn(s) (x)° ≤ , s = 0, 1, 2, (17)
∞ 1 − Λn (2K + L)

where
by MONASH UNIVERSITY on 02/27/16. For personal use only.

½
1 if s = 0, 2
c= (18)
2 if s = 1.

Remark 4.1 (3 ). If f does not depend on y 0 (x), then


° ° cR
° (s) °
°y (x) − yn(s) (x)° ≤ . (19)
∞ 1 − Λn L

5. The numerical algorithm and numerical comparison


In order to calculate the approximate solution of problem (1) by (13) at
x ∈ [−1, 1], we need the values yi = yn (xi ), i = 1, ..., n − 1. To do this, we
can solve the following system:

 yb + ya yb − ya P
n−1

 yi = + xi + pn,k (xi )f (xk , yk , yk0 ) i = 1, ..., n − 1
2 2 k=1

 yb − ya n−1 P 0
 yi0 = + pn,k (xi )f (xk , yk , yk0 ) i = 1, ..., n − 1
2 k=1
(20)
Let us set
 
pn,1 (x1 ) · · · pn,n−1 (x1 ) 0 ··· 0
 .. .. .. .. 
 . . . . 
 
 
 pn,1 (xn−1 ) · · · pn,n−1 (xn−1 ) 0 ··· 0 
A= ,
 0 ··· 0 p0n,1 (x1 ) · · · p0n,n−1 (x1 ) 
 
 .. .. .. .. 
 . . . . 
0 0
0 ··· 0 pn,1 (xn−1 ) · · · pn,n−1 (xn−1 )
August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

294

fk = f (xk , yk , yk0 ),F (Yn ) = (f1 , ..., fn−1 , f1 , ..., fn−1 )T ,


ya − yb ya + yb
Yn = (y1 , ..., yn−1 , y10 , ..., yn−1
0
)T , ai = xi − ,
2 2
ya − yb
bi = , Cn = (a1 , ..., an−1 , b1 , ..., bn−1 )T ,
2
the previous system can be written in the form
AF (Yn ) − Yn = Cn ,
or equivalently
Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com

Yn = G(Yn )
where
by MONASH UNIVERSITY on 02/27/16. For personal use only.

G(Z) = AF (Z) − Cn .
For the existence and uniqueness of the solution we provide the following
theorem:
Theorem 5.1 (3 ). If kAk L < 1, then the previous system has a unique
solution that can be calculated with the iterative method
Yn(0) arbitrary,
Yn(ν+1) = G(Yn(ν) ), ν = 1, ...

Now we report certain numerical results for classical test problems and
compare the error committed applying our method, with n = 7, on different
sets of nodes, in particular between Chebyshev nodes of the second kind
(already examined in Ref. 3) with equidistant, Chebyshev of the first kind
and Legendre nodes. We also compare these results with the ones obtained
by applying the Matlab ODE solver bvp4c.

Problem 5.1. Let us consider the problem


 00 x
 y = y + 2e
y(−1) = 0 with the solution y(x) = (x + 1)ex .

y(1) = 2e
The error in the approximation of the solution is plotted in Figure 1.
In the case of bvp4c (dashed line) 100 function evaluations are needed
for this problem on a mesh of 13 points; our method applied on Chebyshev
second kind nodes (dotted line) or on one of the other three set of nodes
considered (solid line) requires only 36 function evaluations to obtain an
error less than or equal to the requested tolerance ² = 10−5 .
August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

295

(a) Equidistant nodes (b) Legendre nodes (c) Cheb I kind nodes
Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com

Fig. 1: Error functions of problem 5.1.

Problem 5.2. Let be


by MONASH UNIVERSITY on 02/27/16. For personal use only.

 00 02 4
 y = yy − 2(2x − 1)
y(−1) = 1 with the solution y(x) = x2 .

y(1) = 1

(a) Equidistant nodes (b) Legendre nodes (c) Cheb I kind nodes

Fig. 2: Error functions of problem 5.2.

For this problem our method applied on Chebyshev second kind nodes
(dotted line) or on one of the other three set of nodes considered (solid
line) requires only 102 function evaluations to obtain an error less than
or equal to the requested tolerance ² = 10−7 . To obtain an error of the
same order (10−7 ) bvp4c (dashed line) requires 337 function evaluations on
a mesh of 19 points.
August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

296

Problem 5.3. Let us consider the problem


 00 0
 y = 2yy 1
1
y(−1) = 3 with the solution y(x) = .
 2−x
y(1) = 1
Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com
by MONASH UNIVERSITY on 02/27/16. For personal use only.

(a) Equidistant nodes (b) Legendre nodes (c) Cheb I kind nodes

Fig. 3: Error functions of problem 5.3.

In the case of bvp4c (dashed line) 201 function evaluations are needed
for this problem on a mesh of 13 points; our method applied on Chebyshev
second kind nodes (dotted line) or on one of the other three set of nodes
considered (solid line) requires only 132 function evaluations to obtain an
error less than or equal to the requested tolerance ² = 10−4 .

Problem 5.4.
Let us consider the problem
 00 2 3
 y = −(1 + 0.01y )y + 0.01 cos x
y(−1) = cos(−1) with the solution y(x) = cos(x).

y(1) = cos(1)
In this case bvp4c (dashed line) requires 60 function evaluations on a
mesh of 13 points; our method applied on Chebyshev second kind nodes
(dotted line) or on one of the other three set of nodes considered (solid
line) requires only 7 function evaluations to obtain an error less than or
equal to the requested tolerance ² = 10−6 .
August 17, 2009 18:38 WSPC - Proceedings Trim Size: 9in x 6in costabile

297

(a) Equidistant nodes (b) Legendre nodes (c) Cheb I kind nodes
Applied and Industrial Mathematics in Italy III Downloaded from www.worldscientific.com

Fig. 4: Error functions of problem 5.4.

References
by MONASH UNIVERSITY on 02/27/16. For personal use only.

1. U. M. Asher, R. M. M. Mattheij and R. D. Russell, Numerical Solution


of Boundary Value Problems for Ordinary Differential Equations, (SIAM,
Philadelphia, 1988).
2. J. P. Boyd, Chebyshev and Fourier Spectral Methods, (Dover Publications, Inc.,
New York, 2000).
3. F. Costabile and A. Napoli, A method for polynomial approximation of the
solution of general second order BVPs, Far East J. Appl. Math., 25, 3 (2006),
pp. 289–305.
4. F. Costabile and E. Longo, A Birkhoff type interpolation problem and appli-
cations, in preparation.
5. P. J. Davis, Interpolation & Approximation, (Dover Publication, Inc. New
York, 1975).
6. L. Fox, The Numerical Solution of Two-point Boundary Value Problems in
Ordinary Differential Equations, (Oxford University Press, 1957).
7. H. B. Keller, Numerical Methods For Two-point Boundary-Value Problems,
(Dover Publications, New York, 1992).
8. J. Kierzenka and L. F. Shampine, A BVP solver based on residual control and
the MATLAB PSE, ACM TOMS, 27, 3 (2001), pp. 299–316.
9. L. F. Shampine, Solving ODEs and DDEs with residual control, Appl. Num.
Math., 52, 1 (2005), pp. 113–127.

You might also like