the automatic solution to systems of ordinary differential ... · of ordinary differential...

14
@ PERGAMON An Ifltemational Journal computers & mathematics with q:pll¢~lone Computers and Mathematics with Applications 38 (1999) 197-210 www.elsevier.nl/locate/camwa The Automatic Solution to Systems of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN Department of Mathematics City University of Hong Kong 83 Tat Chee Avenue, Kowloon, Hong Kong Abstract--Ortiz and Samara's operational approach to the Tau Method is extended to the nu- merical solution of systems of linearand nonlinear ordinary differential equations (ODEs), together with initial or boundary conditions. They lead to accurate resultsthrough the use of simple algo- rithms, A Tau software calledTAUSYS3 for mixed-order systems of ODEs was written based on this approach. In this paper we give a brief descriptionsof the Tau Method, the structure of the Tan program, and the testingof the TAUSYS3. We consider severalexamples and report resultsof high accuracy. These include linearand nonlinear, stiff and singular perturbation problems for ordinary and systems of ordinary differential equations in which the solution may not be unique. (~) 1999 Elsevier Science Ltd. All rightsreserved. Keywords--Segmented Tau Method, Operational approach, Singular perturbation, Stiff system, Multiple solutions. 1. INTRODUCTION In 1981, Ortiz and Samara [1} proposed an operational technique for the numerical solution of a single nonlinear ordinary differential equation with some supplementary conditions based on the Tau Method [2]. During the last fifteen years considerable work has been done both in the development of the technique, its theoretical analysis and numerical applications. The same technique has been described in a series of papers [3-7] for the case of linear ordinary differential eigenvalue problems and in [8-12] for the case of partial differential equations and their related eigenvalue problems. The object of this paper is to present developments of the operational approach to the Tau Method for the numerical solution of mixed-order systems of linear ordinary differential equations with polynomial or rational polynomial coefficients, together with initial or boundary conditions. A FORTRAN Tau software called TAUSYS3 for mixed-order systems of ordinary differential equations was written based on this approach. We note in particular that TAUSYS3 does not require the mixed-order system to be put into the first-order system of ordinary differential equations. The user need only provide parameters to describe the problem, everything else is done automatically by TAUSYS3. For a complete description of the TAUSYS3, see Liu and Pan [13] and in further references given therein. If the differential equations are nonlinear the user has first to linearize them and then form the Tau problem. In this case the 0898-1221/99/$ - see front matter: (~) 1999 Elsevier Science Ltd. All rightsreserved. Typeset by .A~-TEX PII: S0898-1221(99)00275-8

Upload: others

Post on 19-May-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

@ PERGAMON

An Ifltemational Journal

computers & mathematics with q:pll¢~lone

Computers and Mathematics with Applications 38 (1999) 197-210 www.elsevier.nl/locate/camwa

The Automat ic Solution to Systems of Ordinary Differential Equations

by the Tau Method

K. M. LIu AND C. K. PAN Department of Mathematics

City University of Hong Kong 83 Tat Chee Avenue, Kowloon, Hong Kong

Abstract--Ortiz and Samara's operational approach to the Tau Method is extended to the nu- merical solution of systems of linear and nonlinear ordinary differential equations (ODEs), together with initial or boundary conditions. They lead to accurate results through the use of simple algo- rithms, A Tau software called TAUSYS3 for mixed-order systems of ODEs was written based on this approach. In this paper we give a brief descriptions of the Tau Method, the structure of the Tan program, and the testing of the TAUSYS3. We consider several examples and report results of high accuracy. These include linear and nonlinear, stiff and singular perturbation problems for ordinary and systems of ordinary differential equations in which the solution may not be unique. (~) 1999 Elsevier Science Ltd. All rights reserved.

Keywords--Segmented Tau Method, Operational approach, Singular perturbation, Stiff system, Multiple solutions.

1. I N T R O D U C T I O N

In 1981, Ortiz and Samara [1} proposed an operational technique for the numerical solution of a single nonlinear ordinary differential equation with some supplementary conditions based on the Tau Method [2]. During the last fifteen years considerable work has been done both in the development of the technique, its theoretical analysis and numerical applications. The same technique has been described in a series of papers [3-7] for the case of linear ordinary differential eigenvalue problems and in [8-12] for the case of partial differential equations and their related eigenvalue problems. The object of this paper is to present developments of the operational approach to the Tau Method for the numerical solution of mixed-order systems of linear ordinary differential equations with polynomial or rational polynomial coefficients, together with initial or boundary conditions. A FORTRAN Tau software called TAUSYS3 for mixed-order systems of ordinary differential equations was written based on this approach. We note in particular that TAUSYS3 does not require the mixed-order system to be put into the first-order system of ordinary differential equations. The user need only provide parameters to describe the problem, everything else is done automatically by TAUSYS3. For a complete description of the TAUSYS3, see Liu and Pan [13] and in further references given therein. If the differential equations are nonlinear the user has first to linearize them and then form the Tau problem. In this case the

0898-1221/99/$ - see front matter: (~) 1999 Elsevier Science Ltd. All rights reserved. Typeset by .A~-TEX PII: S0898-1221(99)00275-8

Page 2: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

198 K . M . LIu AND C. K. PAN

linearized system of ordinary differential equations do not have a standard form because of the nonlinear terms, and it would be difficult to set them up by a fully automatic program. In this paper we use TAUSYS3 to solve accurately a variety of examples in the context of both, initial and boundary value problems.

2. O P E R A T I O N A L A P P R O A C H T O T H E T A U M E T H O D

F O R S Y S T E M S O F O R D I N A R Y D I F F E R E N T I A L E Q U A T I O N S

The numerical solution of systems of ordinary differential equations with polynomial coefficients has been considered, in the context of the Tan Method, in a series of papers by Freilich and Ortiz [14], Crisci and Russo [15] and El Misiery and Ortiz [16]. These authors used Ortiz' recursive formulation of the Tau Method [17]; although results of remarkable accuracy were reported in those papers, the computer implementation of their algorithms was rather involved. The algorithm and philosophy of the method is discussed in the references cited and will not be repeated here. In this paper, we consider Ortiz and Samara's operational approach to the Tau Method, which leads to algorithms of remarkable simplicity, while retaining the accuracy of earlier results.

The procedure proposed by Ortiz and Samara [1] for the transformation of a given linear ordinary differential equation to a system of linear algebraic equations is based on the use of two simple matrices

0100 ( 00) 0 ) o o ~u= 0 0 1 and r / = 2 0 .. . .

• . . 0 3 0 .-. • . • " . • . " . . " . .

Let

with an

n

= ' = a n

i----0

= (ao, ax, a s , . . . , an, O, 0 , . . . ) and x = (1, x, x 2 , . . . , x n , . . . )r . Then

?%

x a n ( z ) = =

i = O

and d n .

dx an(X) = E iaix*-X = anrlx" i-----1

We recall the following result from Ortiz and Samara [1].

THEOREM 1. Let an(X) = an • x • C(~)[a, b], the space o£ v-times continuously differentiable functions defined on [a,b] and D := )-~i=0 ~ ~j=0a~ pijx j dd--r~,,q 1), the class of linear differential operators of order v with polynomial coefficients. Then

Dan (x) = an rl x ,

where II := ~ = o ~ £ o P~in~ ~ is a matrix uniquely associated with D in the x-basis.

Let us define the matrix 7 (ij) as .),(ij) := p~ff/~/~j.

Page 3: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

Automatic Solution 199

These matrices have the following simple structure:

(1)

where O (ij) is an i x j zero matrix and K (ij) is a diagonal matrix with diagonal elements gk(~ ) = ((i + k - 1 ) ! / ( k - 1)!)pis, k s N = {1 ,2 ,3 , . . .} .

Thus, H is a banded matrix which gives the coefficients of Dan(x) in terms of those of an(x). And H is constructed in the Tau software program as a result of the superposition of a suitable number of matrices of type (1).

Let us consider the mixed-order system of linear ordinary differential equations

m

E DijuS(x) = f~(x), i = l(1)m, a < x < b, (2) 5=1

with the supplementary conditions

m

j = l

v~j dk Dij := Z pijk(x) ~ =

k=O

vii < vii

r = l ( 1 ) w , (3)

u~ f~jk dk E E PiSklXt dxk k-0 l=O

for j # i, i=l(1)m,

where

fi(x) is an algebraic polynomial in x and lrj is a u 5 (x) and its derivatives.

The Tau Method associates with problem (2),(3)

m

Dis sn(x) = f , (x) + Hin( ), j = l

(4)

linear point evaluation functional acting on

the Tau problem

i = l(1)m, a < x < b, (5)

with the conditions m

Z (l j, sn) = = (6) 5_---, 1

where Hin(x) is usually chosen to be a linear combination of the shifted Chebyshev or Legendre

polynomials with free parameters, r ~ ) , j = l(1)vii which are to be determined in such a way that Tau approximants ujn(x) is the exact polynomial solution of problem (5),(6). The free parameters

r~ ) are chosen to adjust the approximate polynomial solution to the given w supplementary conditions and to satisfy some conditions imposed by the Tau Method (see [17] for further details).

Let Z = V Z V -1 be the conjugate of Z under the similarity transformation defined by V. If an(x) is expressed in terms of an orthogonal polynomial basis (Chebyshev or Legendre poly- nomial basis)

v := {vk(x)} -- Vx , k = 0 , 1 , 2 , . . . ,

where V is a lower triangular nonsingular matrix, then

a n ( x ) = a,~ . x = 5 , , , . v ,

Page 4: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

200 K . M . LIu AND C. K. PAN

where &n = (ao, a l , a2 . . . . , (~n, 0, 0 , . . . ) = ~ n V - 1 .

Let us consider the Tan approximants

ujn(x) := 5jr~" w = &jr~ -v, j = l(1)m,

where &in = (Oljo,oljl,O~j2 . . . . ,Ol jn ,O,O, . . . ) and ctjn = (ajo,ajl,aj2,...,ajn,O,O,... ). Let H4j, i , j = l(1)m, be the matrices associated by Theorem 1 with Dij,i , j = l(1)m, as defined by (4). Then we have

We assume that

m m ~r~

Z Doujn(x)= Z ajnl-Iijx-- Z &j~II41 v, i= l(1)m. (7) j-~l j=l j=l

m i

f~(~) = ~ / ~ j ~ j ( ~ ) = ]4 . . j=O

with ]4 -- (fio, f i l , . . - , f im , ,O ,O , . . . ) . ujn (x) we find that

If the linear point evaluation functional lrj is applied to

t~

(lrj,ujn)= Z aj~(l~J 'xk) =ajn.bj , . , r= l(1)w. k=O

We set

t b := (bj, I b~ I " " I b~,), c j := v B~

and 0 : = (01, 0 2 , . . . , 0w). Therefore, we can write for equation (6) as

r tg

j=l

Let &M := (&In, &2n, . . . , &ran) 6 RM, M = m(n + 1), where &in, j = l(1)m is the coefficient vector of ujn(x) in the basis v. The problem of the determination of the vector &M, can then be formulated as the system of linear algebraic equations

&MG ---- SM, (8)

where C1 Qll Q21 "" Q.~I ) C2 Q12 Q22 "" Q-~2

7

Qij :-- [l:I4j]n(n-v,) for the restriction of l:I4j to its first n + 1 rows and n - vii + 1 columns,

] w , for the restriction of ]i to its first n - vii + 1 (_> mi + 1) components• The linear system (8) define implicitly the coefficients of the unknown functions ujn(x), contained in the long vector &M E R M. A Gaussian elimination routine with complete pivoting was used to solve the resulting system.

Page 5: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

Automatic Solution 201

3. C O M P U T A T I O N OF THE E R R O R F U N C T I O N S

Let us call esn(X ) := u j ( x ) - USn(X ), j = l(1)m the error functions of the Tau approximants uSn(x ) to us(x), since us(x), j = l(1)m is the solution of problem (2),(3), whereas uSn(x), j = l(1)m, is the solution of the Tau problem (5),(6). Therefore, the error functions eSn(x ) satisfy the problem

m

DiseSn(x) = -H~n(x) , i = 1(1)m, a < x < b (9) j = l

with the homogeneous conditions

m

(Its, es . ) = 0, r = 1(1)~. (10) j=l

The perturbation terms Hin(x) can be obtained by substituting the computed solution ujn(x) into the equations

m

gi,~(x) = - f i ( x ) + ~ D~jujn(x), i = l(1)m. j : l

We proceed to find an approximation ejn,w(x) to the error functions ejn(x) in the same way as we did before for the solution of problem (2),(3).

With problem (9),(10) we associate the Tau problem

• Dijejn,N(X) = -H~n(x) + HiN(X), j = l

i = l ( 1 ) m , a < x < b

m with the conditions ~ j = l (/rj, ejn,N) = 0, r = l(1)w, implicitly defines ejn,N(X), j ---- l(1)m. It should be noted that in order to construct the Tau approximant ejn ,g(x) to ejn(X), only the

right-hand side of system (8) needs to be recomputed; the structure of the coefficient matrix G remains the same.

4. S E G M E N T E D PIECEWISE TAU A P P R O X I M A N T S W I T H IMPLICIT M A T C H I N G

In [18], the details of segmented Tau Method is discussed and the implicit matching technique of Tau approximants is also introduced in [3,19]. We shall consider some numerical examples on the use of segmented Tau Method for the numerical solution of differential equations and apply it to the concrete case of singular perturbation problems. Let us assume that the differential equation (2) is defined on the interval [a, b]. Let P be a partition of that interval defined by the points {x,}, i = 0(1)t,

P := {a = xo < x l < . . . < xi < xi+l < . . . < x t_ l < xt = b}.

We shall solve problem (2),(3) on [a, b] as a sequence of Tau problems defined the approximants ujn(x, k) on the subintervals [xk-1, xk], coupled by the extra continuity conditions

f o r j = l ( 1 ) m , r = 0 ( 1 ) u j j - 1 ,

k = l (1) t ,

where vii is the order of the j th differential equation in (2), r stands for r th derivative of the function with respect to x.

Page 6: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

202 K . M . Lxu AND C. K. PAN

5. S T R U C T U R E O F T H E T A U P R O G R A M - - T A U S Y S 3

In [20], a program TAUSYS2 for solving mixed-order system of linear ordinary differential equations with the use of the operational approach to the Tan Method was introduced. The computer program TAUSYS2 described there has been in use at the Department of Mathematics, City University of Hong Kong since 1992 (see [21,22]). However, many practical problems involve both large scale processes and highly localized phenomena that are often critical to the overall behavior of the problems. As a result, in order to obtain better results, we have to use Tau approximant of higher degree, but due to the limitation of the power of the computer such an idea is impractical. On the other hand, we can partition the interval into several subintervals and then solve the problem on these subintervals with Tau approximants of lower degree. In this paper, the program TAUSYS2 is upgraded to TAUSYS3 [13] in which segmentation technique is also available. This technique allows the use of small subintervals in regions of the computational domain where the solution exhibits large gradient or where the solution needs to have higher accuracy. It is justified that such technique is efficient in the numerical treatment of problems with rapid functional variations, stiff and singularly perturbed problems, and problems defined over a long interval.

The program is composed of one main program and eight subroutines. The following is a description of the program.

Main program: TAUSYS3 which uses input data supplied by the user to construct the Tau approximants Ujn(X) and to estimate the error functions ejn(x) of a given mixed-order system of linear ordinary differential equations with polynomial coefficients of the type of equations (2).

Subroutines called by the main program TAUSYS3 are as follows.

EXACTSOL - name of subroutine for evaluating exact solution. It should be of the following form: SUBROUTINE EXACTSOL (X, N, UEXACT) REAL*8 X, UEXACT(N) UEXACT(1) = the analytical solution, Ul(X) UEXACT(2) = the analytical solution, u2(x)

RETURN END

TMAT

TINMAT

PMAT PINMAT

MATMUL SEGMT GAUSS

- construct the matrix of coefficients of the shifted Chebyshev polynomial basis.

- construct the inverse of the matrix of coefficients of the shifted Chebyshev polynomial basis.

- construct the matrix of coefficients of the shifted Legendre polynomial basis. - construct the inverse of the matrix of coefficients of the shifted Legendre

polynomial basis. - performs the matrix multiplication A B = C.

- defines a partition of the interval [a, b] for segmentation. - solves the final system of linear algebraic equations (8) using the Gaussian

elimination method with complete pivoting.

Input data required for the main program is of the order of the matrix of coefficients V; specified the polynomial basis (Chebyshev or Legendre) to be used; the end points of the interval [a, b] in which the numerical solution is required; number of differential equations in the system; the differential equations (2); the supplementary conditions (3); specified the exact solution provided or not; degree of the Tau approximants ujn(x); Tau degree of the error functions ejn(X); node points for a uniform/or nonuniform segmentation being used.

Page 7: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

A u t o m a t i c Solut ion 203

The use of TAUSYS3 is then illustrated by examples demonstrating its effectiveness and ca- pabilities. TAUSYS3 is used to solve a variety of system of ordinary differential equations with initial or boundary conditions. The computations were carried out on the SUN SPARC 10 ma- chine at the City University of Hong Kong using double precision.

6. N U M E R I C A L E X A M P L E S

In this section, we present the result of some computational experiments by using our TAUSYS3 to various numerical examples. These include linear and nonlinear, stiff and singular perturbation problems for ordinary and system of ordinary differential equations in which the solution may not be unique. We have considered two examples to demonstrate the effectiveness of segmentation.

EXAMPLE 1. A singular two-point boundary value problem

u " + 2 u ' - 2 ( 3 - { - 2 x 2 ) u=O, 0 < x < l , x

with u'(0) = 0 and u(1) = e.

The analytical solution of this problem is u(x) = e x2.

EXAMPLE 2. Consider the system of first-order ordinary differential equations

x 2 z3u'l + -~ ul - 2u2 = O,

x 2 1 xu~ -~- ~- Ul -{- ~ u2 = 0 , l < x < 2

with the initial conditions ul(1) = 1 and u2(1) = 0.5.

The analytical solution of this problem is

U l ( X ) = X - 3 / 2 ( 1 + 2 log~ x),

u2(x) = xl/2 ( 2 -1og~x ) •

In Tables 1 and 2, we report the maximum absolute errors between the analytical solution and the numerical solution obtained by the Tau Method with a Chebyshev and a Legendre polynomial basis for Examples 1 and 2.

Table 1. Exac t m a x i m u m absolu te error.

T y p e of Basis T au Degree, n m a x len(x)l o < x < l

Chebyshev 10 6.0 × 10 - s

Legendre 10 4.0 × 10 - s

C hebyshev 15 5.7 x 10 -13

Legendre 15 4.0 x 10 -13

Table 2. Exact maximum absolute error.

max lej~(~)l T y p e of Basis T au Degree, n 1<x<2

j= l ,2

C hebyshev 12 5.6 x 10 - 9

Legendre 12 3.7 × 10 - 9

C hebyshev 14 1.7 x 10 - 1 °

Legendre 14 1.7 X 10 -1°

Page 8: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

204 K.M. LIu AND C. K. PAN

EXAMPLE 3. Consider a singular per turbat ion problem

e u " ' - u' + x u = O, 0 < x < 1

with 0 < e << 1 and with the boundary conditions

u(0) -- u '(0) ----- u(1) = 1.

Take e = 0.01, 0.001.

The analyt ical solution of this problem is not known, hence we obtained an error es t imate for

the Tau approximant un(x) using the technique described in Section 3. Table 3 displays est imates

of the max imum absolute value of the error function en(x) in [0;1] obtained with the es t imator

en,N(X) for n = 15, 20, 23, and different values of N.

Table 3. Error estimations.

0.01

0.001

Type of Basis Tau Degree, n, N 0~'~lle-,N(x)l Chebyshev 15,19 1.1 x 10 -s

Legendre 15,19 6.5 x 10 -9

Chebyshev 20, 24 7.5 x 10 -14

Legendre 20, 24 4.9 x 10 -14

Chebyshev 20, 24 4.6 x 10 -6

Legendre 20, 24 2.6 × 10 -6

Chebyshev 23, 27 1.7 × 10 -6

Legendre 23, 27 9.2 x 10 -7

Rober ts considered this problem and produced numerical solution by using a boundary value

me thod described in his paper [23]. Table 4 displays our Tau solution as well as t ha t of Rober t s '

solution. We have also included in Table 4 the asymptot ic solution of Bender and Orszag [24].

The numerical results compare favorably.

EXAMPLE 4. Consider a stiff system of differential equations

u~ - 42.2Ul - 50.1u2 + 42.1u3 = 0,

u~ + 66.1Ul + 58u2 - 58.1u3 --- 0,

u~ - 26.1Ul - 42.1u2 -t- 34u3 = 0, 0 < x < 1 . 5

with ut(0) = 1, us(0) = 0, and u3(0) = 2.

The analytical solution of this problem is

Uy (x) = e °'ix sin 8x + e -5°x,

u2(x) = e °'ix cos 8x - e -5°x,

u3(x) = e°'tX(cos 8x + sin 8x) + e -5°x.

The choice of Tau degree n determines the precision of the Tau solution obtained. If too small

a value is taken, the Tau solution will be insufficiently accurate, and if n is too large, the errors in the computed solution are caused by the accumulat ion of rounding errors. We have cons t ruc ted for this problem a global Tau approximant ujn (x) of degree n = 19(1)21 defined over [0,1.5], then a segmented piecewise Tau approximant ujn (x, k) of degree n = 10(1)12 defined over fifteen equal length subintervals [xk-1, xk] of [0,1.5]. In Figure 1, we show graphically the max imum absolute errors of a global Tau approximant ujn(x) defined over [0,1.5] and the max imum absolute error

Page 9: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

0.01

0.001

Automatic Solution

Table 4. Tau solution of Example 3, for • -- 0.01, 0.001.

X

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0,9

Our Tau Solution

with Tau Degree n

n = 1 5 n = 20

1.06874935 1.06874934

1.10885676 1.10885677

1.14603736 1.14603736

1.18996254 1,18996255

1.24382595 1.24382594

1.30651486 1.30651486

1.36978279 1.36978278

1.40771771 1.40771771

1.34830996 1.34830995

n = 20 n = 23

0.1 1.035455 1.035455

0.2 1.052448 1.052447

0.3 1.079226 1.079228

0.4 1.117797 1.117796

0.5 1.169415 1.169416

0.6 1.235759 1.235759

0.7 1.318993 1.318991

0.8 1.420791 1.420793

0.9 1.517637 1.517638 1.537 1.51758

Roberts ' Bender and

Solution [ 2 3 ] Orszag's

(to 3D) Solution [24]

1.063 1.06874

1.079 1.10894

1.107 1.14611

1.146 1.18987

1.199 1.24339

1.267 1.30555

1.352 1.36816

1.457 1.40551

1.334 1.34621

1.030 1.03547

1.046 1.05247

1.072 1.07925

i . i i i 1,11781

1.162 1,16942

1.227 1,23576

1.310 1.31898

1.412 1.42076

205

i ,

0

-2

¢D

E=_ 6 a_ x m E

_~ + : Error for global Tau approximants with Chebyshav basis

-10 * : Error for global Tau approximants with Legendro basis

o : Error for segmented Tau approximants with Chabyshev basis

-12 x : Error for segmented Tau approximants with Legendre basis

110 1=5 2=0 215 Tau degree, n

Figure 1. Log of the max imum absolute error of Tau approximants of Example 4.

of our Tau solution when segmentation is used. We remark tha t for this problem (a stiff system) the segmented Tau approximation is more accurate than that of the global Tau approximation.

EXAMPLE 5. Consider a second-order ordinary differential equation

z"(x) + z(x) = 0.001 (cos x + i sin x),

defined on a long interval, 0 < x < 10~r, with the initial conditions z(0) = 1 and z~(0) = 0.9995i.

Page 10: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

206 K . M . LIU AND C. K. PAN

T h e analyt ical solution is z(x) = cos x + 0.0005x sin x + i(sin x - 0.0005x cos x). We convert this p rob lem in the following form:

u (x) +

ui(x) -u2(x) l(X) -u5(x) u (x) -u4(x) u3(x)

+us(x)

with the initial condit ions u l (0) = 1, u2(0) --

and us(0) = 0. T h e analyt ical solution of this sys tem is

= 0,

---- 0~

---- 0~

~- 0,

---- 0~

= 0, 0 < x < 10~r

0, U3(0 ) = 0 , U4(0 ) = 0.9995, Us(0) = 0.001,

Ul(X) = cos x + 0.0005x sin x,

u2 (x) = -0 .9995 sin x + 0.0005x cos x,

u3 (x) = sin x - 0.0005x cos x,

ua(x) = 0.9995 cos x + 0.0005x sin x,

u5 (x) = 0.001 cos x,

us(x) = 0.001 sin x.

We have cons t ruc ted for this p rob lem a global Tau approx iman t ujn(x) of degree n = 19(1)21 defined over [0, 101r]. We have also compu ted for this p rob lem a segmented piecewise Tau approx-

iman t ujn(x, k) of degree n = 6, 7 defined over ten equal length subintervals [xk-1, xk] of [0, 10r].

In Table 5 we repor t the error [z(x) - zn(x)[, at x = 10~r, wi th z(x) = ul(x) + iu3(x), and

zn(x) = uln(x) + iu3n(x) its Tau approx imat ion of degree n. In Table 6 we repor t the error of our Tau approx imat ion when segmenta t ion is used.

Table 5. Error for global T au approx ima t ion to z(x) at x = 10g.

T y p e of Basis T au Degree n Iz(10~) - z,(10~)l

C hebyshev 19 5.3 x 10 - 2

Legendre 19 2.8 x 10 - 2

C hebyshev 20 1.5 x 10 - 2

Legendre 20 7.5 x 10 - 3

C hebyshev 21 3.0 x 10 - 3

Legendre 21 2.8 x 10 - 3

Table 6. Error for segmented Tau approx imat ion to z(x) at x = 101r.

T y p e of Basis T au Degree n Iz(10~r) - zn(10tr)l

Chebyshev 6 3.6 x 10 - 5

Legendre 6 4.1 x 10 - 6

C hebyshev 7 4.3 x 10 - 6

Legendre 7 1.0 x 10 - 7

Lhnczos [25] remarked t h a t Tau approx imat ions genera ted wi th a Legendre basis give be t t e r end point approx imat ions t h a n those genera ted with a Chebyshev basis. Th is feature is used to cons t ruc t the segmented Tau Method in which the error of the Tau approx imat ions is minimised a t the end points of each subintervals defined by the par t i t ion of the interval [a, b]. Prac t ica l and

Page 11: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

A u t o m a t i c Solut ion 207

theoretical results in this direction have been reported by Ortiz [18], Onumanyi and Ortiz [19] and Namasivayam and Ortiz [26]. We give here further support to this view in Tables 5 and 6.

EXAMPLE 6. We shall see below that for a nonlinear boundary value problem, multiple solutions exist. Diffusion with an autocatalytic reaction (Brusselator model) may be described by the system of two nonlinear differential equations (see [27])

D1 ,I u2u2 (B 1)Ul -A, L-- ~ ul + - + = (11) D2 u~

L-- ~ + B u l - u2u2 = O, 0 < x < 1

with the following boundary conditions:

B Ul(0) = ul(1) = A, u2(0) = u2(1) = A" (12)

Here the problem of existence and uniqueness may be analysed a posteriori. Trivially, ul (x) = A and u2(x) = B / A for 0 <_ x <_ 1 is one of the solutions of the problem. We can linearise the nonlinear differential equations (11) first and then solved by iteration with the Tau Method (see [1,28]). We used the linear iterative scheme with the program TAUSYS3 to compute the multiple solutions of problem (11),(12).

Linear iterative scheme

D1 u" 2 - ( B + l ) u l , r + l -A, L--~ 1 , r÷ l "~- Ul,rU2,r+l (13)

D 2 up~ 2 5"-7 2 , r + l "{- BUl,r-F1 -- Ul,rU2,r~-I ~- O, 0 ~ X ~ 1

with the boundary conditions

B u l , r+ l (0 )=Ul ,~+l (1)=A, U2,r+l(0)=u2,~+l(1)=A, f o r r = 0 , 1 , 2 , . . . (14)

2.35

2.3

2.2. ~

2.;

~ 2.15

2.1

2.05

2

1.95

1.9 0

U2

ul

I I

o12 o , o18 o18 1 X

Figure 2. Tau approximants of degree 8 for t he first solut ion of E x a m p l e 6.

Page 12: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

208 K.M. LIU AND C. K. PAN

With an initial guess ul,o(x),u2,o(x) (usually satisfies the boundary conditions), we substi- tute it into equation (13) for r = 0 and then solve it with TAUSYS3 to get Ul,l(x),u2,1(x). In the same way, we substitute Ul,l(X),U2,1(x) back into equation (13) for r = 1 and get Ul,2(x), u2,2(x). Continuing this process with r = 2, 3, 4 , . . . , we obtain a sequence of Tau ap- proximants {Ul,r(X),U2,r(x)} which hopefully will converge uniformly to an exact solution of problem (11),(12) (see [28]). As a special case, we take A = 2, B = 4.6, L = 0.1, D1 = 0.0016, and D2 = 0.008. A posteriori error analysis was used to establish the existence of (at least) three different solutions of problem (11),(12). In Figure 2-4 we have plotted the three different solutions.

2.8

2.6 u2

2.2

x

1.8

1.6

1.4

1.2

' ' '. '.8 ' 10 0.2 0.4 0 6 0 1 X

Figure 3. Tau approximants of degree 8 for the second solution of Example 6.

:l

4 A X

3

ul

U

o o12 oi, o:s o18 X

Figure 4. T~u approxiraants of degree 8 for the third solution of Example 6.

Page 13: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

Automatic Solution 209

7. C O N C L U S I O N S

From the examples we discussed in Section 6, we can conclude t ha t the Tau Method wi th

segmenta t ion is very effective in t r ea t ing stiff and s ingular ly pe r tu rbed problems and problems

defined over a long interval. Compared wi th no interval par t i t ioning, with the use of segmenta t ion

more accura te results can be ob ta ined with lower degree of Tau approximant . However, it is

obvious t h a t segmenta t ion is not necessary when accurate approx imant can be ob ta ined wi thou t

segmenta t ion .

R E F E R E N C E S 1. E.L. Ortiz and H. Samara, An opertional approach to the Tan Method for the numerical solution of nonlinear

differential equations, Computing 27, 15-25, (1981). 2. C. L~nczos, Trigonometric interpolation of empirical and analytical functions, J. Math. Phys. 17, 123-199,

(1938). 3. K.M. Liu and E.L. Ortiz, Eigenvalue problems for singularly perturbed differential equations, In Proceedings

of the BAIL H Conference, (Edited by J.J.H. Miller), pp. 324-329, Boole Press, Dublin, (1982). 4. K.M. Liu and E.L. Ortiz, Approximation of eigenvalues defined by ordinary differential quations with the

Tau Method, In Matrix Pencils, (Edited by B. KagstrSm and A. Ruhe), pp. 90-102, Springer-Verlag, Berlin, (1983).

5. K.M. Liu and E.L. Ortiz, Tau Method approximation of differential eigenvalue problems where the spectral parameter enters nonlinearly, J. of Comput. Phys. 72, 299-310, (1987).

6. K.M. Liu and E.L. Ortiz, Numerical solution of ordinary and partial functional-differential eigenvalue prob- lems with the Tau Method, Computing (Wien) 41,205-217, (1989).

7. E.L. Ortiz and H. Samara, Numerical solution of differential eigenvalue problems with an operational approach to the Tau Method, Computing 31, 95-103, (1983).

8. K.M. Liu and E.L. Ortiz, Numerical solution of eigenvalue problems for partial differential equations with the Tau-Lines Method, Computers Math. Applic. 12B (5/6), 1153-1168, (1986).

9. K.M. Liu, E.L. Ortiz and K.S. Pun, Numerical solution of Steklov's partial differential equation eigenvalue problem, In Computational and Asymptotic Methods for Boundary and Interior Layers (III), (Edited by J.J.H. Miller), pp. 244-249, Boole Press, Dublin, (1984).

10. E.L. Ortiz and K.S. Pun, Numerical solution of nonlinear partial differential equations with the Tau Method, J. Comp. and Appl. Math. 12/13, 511-516, (1985).

11. E.L. Ortiz and K.S. Pun, A bi-dimensional Tau-Elements Method for the numerical solution of nonlinear partial differential equations with an application to Burgers' equation, Computers Math. Applic. 12B (5/6), 1225-1240, (1986).

12. E.L. Ortiz and H. Samara, Numerical solution of partial differential equations with variable coefficients with an operational approach to the Tau Method, Computers Math. Applic. 10 (1), 5-13, (1984).

13. K.M. Liu and C.K. Pan, TAUSYS3: A modified Tau program for systems of ordinary differential equations, Research Report, City University of Hong Kong, (1994).

14. J.H. Freilich and E.L. Ortiz, Numerical solution of systems of ordinary differential equations with the Tau Method: An error analysis, Maths. Comput. 39, 467-479, (1982).

15. M.R. Crisci and E. Russe, An extension of Ortiz' recursive formulation of the Tau Method to certain linear systems of ordinary differential equations, Maths. Comput. 41, 27-42, (1983).

16. A.E.M. El Misiery and E.L. Ortiz, Tau-Lines: A new hybrid approach to the numerical treatment of crack problems based on the Tau Method, Comp. Meth. in Appl. Mech. and Engng. 56, 265-282, (1986),

17. E.L. Ortiz, The Tan Method, SIAM J. Numer. Analysis 6, 480-492, (1969). 18. E.L. Ortiz, Step by step Tau Method: Piecewise polynomial approximations, Computers Math. Applie. 1

(3/4), 381-392, (1975). 19. P. Onumanyi and E.L. Ortiz, Numerical solution of stiff and singularly perturbed boundary value problems

with a segmented-adaptive formulation of the Tau Method, Maths. Comput. 43, 189-203, (1984). 20. K.M. Liu, TAUSYS2: A Tau program for mixed-order system of linear ordinary differential equation with

polynomial coefficients, CPHK Research Report MA-92-02, (1992). 21. K.M. Lee, Numerical methods for solving elliptic partial differential equations containing boundary singu-

larities with the application to fracture mechanics, M.Phil. Thesis, City University of Hong Kong, (June 1994).

22. K.M. Liu, Numerical tests of the TAUSYS2 software for systems of ordinary differential equations, In Pro- ceedings of the Cornelius Ldnczos International Centenary Conference, (Edited by J.D. Brown, M.T. Chu, D.C. Ellison and R.J. Plemmons), pp. 344-346, SIAM, (1993).

23. S.M. Roberts, Further examples of the boundary value technique in singular perturbation problems, J. of Math. Anal. Appl. 133, 411-436, (1988).

24. C.M. Bender and S.A. Orszag, Advanced Mathematical Methods for Scientists and Engineers, McGraw-Hill, New York, (1987).

Page 14: The Automatic Solution to Systems of Ordinary Differential ... · of Ordinary Differential Equations by the Tau Method K. M. LIu AND C. K. PAN ... stiff and singular perturbation

210 K.M. LIv AND C. K. PAN

25. C. L~nczos, Legendre vs. Chebyshev polynomials, In Topics in Numerical Analysis, (Edited by J.J.H. Miller), pp. 191-201, Academic Press, New York, (1973).

26. S. Namasivayarn and E.L. Ortiz, Error analysis of the Tau Method: Dependence of the approximation error on the choice of perturbation term, Computers Math. Apphc. 25 (1), 89-104, (1993).

27. M. Kubi~ek and V. Hiav~i~ek, Numerical Solution of Nonlinear Boundary Value Problems with Applications, Prentice-Hall, Englewood Cliffs, N J, (1983).

28. E.L. Ortiz and A.P.N. Dinh, On the convergence of the Tau Method for nonlinear differential equations of Riccati's type, Nonlinear Analysis, Theory, Methods and Applications 9, 53-60, (1985).