Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

103
The NOTICE qualiiy of this microform is heavily dependent upon the quality of the original thesis submitted for microfilming. Every effort has been made t~ ensuw the highest quality of reproduction possible. If pages are missing, contact the university which granted the degree. Some pages may have indistinct print especially if the original pages were typed with a poor typewriter ribbon or if the university sent us an inferior photocopy. Reproduction in full or in part of this microform is governed by the Canadian Copyriqht - Act, R.S.C. 1970, c. C-30, and subsequent amendments. La qualit6 de cette microforme depend grandement de la qualite be la th&e sournise SPU microfilmage. Nous avons tout fait pour assurer m e qualit6 supbrieure de reproduction. S'il manque des pages, veuillez communiquer avec IYuniversit6 qui a confer@ le grade. La qualit6 d'irnpression de certaines pages peut laisser a desirer, surtout si les pages originales opt et6 dactylographi6es a I'aide d'un ruban last5 ou si i'universiti! nous a fait parvenir une photocopie de qualite infbrieure. La reproduction, m6me partielle, ae cetk microforme est soumise & la Loi canadienne sur le droit d'auteur, SRC 1970, c. C-30, et ses amendernents subsequents.

Transcript of Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Page 1: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

The

NOTICE

qualiiy of this microform is heavily dependent upon the quality of the original thesis submitted for microfilming. Every effort has been made t~ ensuw the highest quality of reproduction possible.

If pages are missing, contact the university which granted the degree.

Some pages may have indistinct print especially if the original pages were typed with a poor typewriter ribbon or if the university sent us an inferior photocopy.

Reproduction in full or in part of this microform is governed by the Canadian Copyriqht - Act, R.S.C. 1970, c. C-30, and subsequent amendments.

La qualit6 de cette microforme depend grandement de la qualite be la th&e sournise SPU

microfilmage. Nous avons tout fait pour assurer m e qualit6 supbrieure de reproduction.

S'il manque des pages, veuillez communiquer avec IYuniversit6 qui a confer@ le grade.

La qualit6 d'irnpression de certaines pages peut laisser a desirer, surtout si les pages originales opt et6 dactylographi6es a I'aide d'un ruban last5 ou si i'universiti! nous a fait parvenir une photocopie de qualite infbrieure.

La reproduction, m6me partielle, ae cetk microforme est soumise & la Loi canadienne sur le droit d'auteur, SRC 1970, c. C-30, et ses amendernents subsequents.

Page 2: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

THE PSEUDOSPECTRAL CHEBYSHEV METHOD FOR TWO-POINT BOUNDARY VALUE PROBLEMS

Yunyun Liu

B .Sc. Shanghai University of Science and Technology 1982

A THESIS SGBMITTED Ih' PARTIAL FULFILLMENT

OF THE REQUIREMENTS FOR THE DEGREE OF

MASTER OF SCIENCE

in the Department of Mathematics and Statistics

of

Simon Fraser University

@ h n y u n Liu 1992

SIMON FRASER UNIVERSITY

April, 1992

All rights resewed. This work may not be reproduced in whoIe or in part, by photocopy

or other means, without the permission of the author.

Page 3: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

National Library 1+1 of Canada Bibfiotheque nationate uu Canada

Acquisitions and Direction des acquisitions et Bibliographic Sewices Branch des services bibliographiques

395 Wellington Street 395, rue Wellington Oltawa, Ontario Ottawa {Ontario) KiAON4 KIA ON4

The author has granted an irrevocable non-exclusive licence allowing the National Library sf Canada t@ reproduce, toan, distribute or sell copies of his/her thesis by any means and in any form or format, making this thesis available t,r interested persons.

k'auteur a accorde m e licence irr6vocable et non exclusive permenant a la Bibliothltque nationale du Canada de reproduire, prater, distribuer ou vendre des copies de sa these de quelque manihre et sous quelque forme que ce soit pour rnettre des exemplaires de cette thbse a la disposition des personnes interessbes.

The author retains ownership of L'auteur conserve la propribte du the copyright in his/her thesis. droit d'auteur qui protege se Neither the thesis nor substantial these. Ni la thhse ni des extraits extracts from it may be printed or substantiefs de celle-ci ne otherwise reproduced without doivent &re imprimes ou his/her permission. autrement reproduits sans son -

autorisation.

Page 4: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

APPROVAL

Yunyiin Liu

Master of Science Degree:

THE PSEUDOSPECTRAL CHEBYSHEV METHOD T i t l e of thesis:

FOR TWO-POINT BOUNDARY VALUE PROBLEMS

Examining Committee: Dr. G. A. C. Graham

Chairman

Dr. Manfred Trummer, Senior Supervisor

Dr. Robert D. Russell

Dr. < ~ e a r ~ e Bojadziev

Dr. Tax> Tang, External Examiner

April 2, 1992 Date Approved:

Page 5: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

my thes is , p r o j e c t o r extended e s s a y ( t h e t i 1 lc o f which is shown bclL)w)

to users of t h o Simon Frasor U n i v e r s i t y L i b r ~ r y , and lo makc p a r t i s ]

singto copies o n l y for such use rs or i n response t u a raquest from tho

l i brary of any o t h e r un i vers i ty , or o f h e r e d u c a t i ona l i n s l i tu t i orr, on

i t s own behai f o r for one o f i i s users. I f u r thc r a g r m 1 ha 1 permi sr, ion

f o r muitipie copying o f t h i s work fo r s c h o l a r l y pu r -poses may bc gr-anlcd

by me or the Doan o f Graduate Studies. It i s undcrs-tood Ihs l. copy ing

o r pub1 l ca t i on of this work fo r f i n a n c i a l ga in sha l l not bc dllowed

without my w r i t t e n permission.

T i t l e of Thesis/-x-+ended E.ssay .

(date)

Page 6: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Abstract

Althougb spectral methods have attracted much of the attention in current research of

numerical methods for solving differential equations, little experience is available in applying

spectral methods to solve (two - point) boundary vdue problems. In this thesis, two spectral

methods (the pseudospectral Chebyshev method and the method of transformation to the

circle) have been studied to solve second order boundary value problems (BVPs).

Emphasis is given t o singzarly perturbed BVPs that are controlled by a singularity

parameter E . Three kinds of singularities are investigated: mild ( E = stiff ( E =

and very stiff ( E = and problems with interior or boundary layers are considered.

Numerical performances of the above mentioned two spectral methods are judged by

condition numbers, average errors and cpu times. It has been found that the pseudospec-

tral Chebyshev method is more suitable t o solve non-stiff problems than to stiff problems;

that the method of transformation to the circle can decrease the condition numbers of the

relevant matrices when applied to solve non-stiff problems. However, for stiff problems,

it is nevertheless seldom successful. A brief comparison of the above two methods to the

Chebyshev collocation method is also presented in this thesis. It is found that once sufficient

resdntioo is achieved, ouaericd solutims are accurate despite the large condition mmbers.

Page 7: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Acknowledgements

First of all, I want to thank my senior supervisor, Dr. Manfred ft. Trummer for his guidance,

encouragement and patience during the preparation of this thesis.

My thanks also go t o Dr. Robert D. Russell, Dr. Margorzata Dubiel and Dr. Kathy

Heinrich for their support.

Finally, I want t o thank Graduate Secretary Mrs. Sylvia Holmes and other departrncnt,

staff. It was their kindness and help that made my stay at SFU comfortable.

A special thank is to the Department of Mathematics and Statistics of Simon F'raser

University for its financial support.

Page 8: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Dedication

To My Parents

To the Memory of My Grandparents

To Great Chen

Page 9: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Contents

Abstract

Acknowledgements

Dedication

Contents

List of Tables vii

List of Figures vii

1 Introduction 1

1.1 Pseudospectral Chebyshev Methods . . . . . . . . . . . . . . . . . . . . . . . I

1.2 Collocation Method . . . . . , . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.3 Thesis Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 A Pseudospectral Chebyshev Method 9

2.1 Introduction . . . . . . . . . . , , . . . . . . . . . . . . . . . . . . . . . .. . . . 9

2.2 Chebyshev Polynomial Expansions , . . . . .. . . . . . . . . . . . . . . . . . . 10

2.3 A Pseudospectral Chebyshev Method . . . . . . . . . . . . + . . . . . . . . . . 12

2.4 Linear System Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a I 5

Page 10: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

PreIiminary Transform To The Circle 39

3.2 The Method of Transformation to the Circle . . . . . . . . . . . . . . . . . . . 40

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Iterative Methods 44

3.3.1 CGXR (The Conjugate Gradient Iteration Applied to the Normal

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Equations) 44

. . . . . . . . . . . . . . . . . 3.3.2 CGS (The Conjugate Gradient Squared) 45

4 Chebyshev Collocation Met hod

4.1 Chebyshev CoJfocation Method . . . . . . . . . . . . . . . . . . . . . . . . . . 63

4.2 3umerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

5 Discussion 74

Bibliography

Page 11: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

List of Tables

2.1 Example f . pseudospectral Chebyshev method. c = loM2 . . . . . . . . . . . . 25

2.2 Example 1. pseudospectral Chebyshev method. E = 1 0 - . . . . . . . . . . . . 25

2.3 Example 1. pseudospectral Chebyshev method. c = . . . . . . . . . . . . 25

2.4 Example 2. pseudospectral Chebyshev method. c = low2 . . . . . . . . . . . . 30

2.5 Example 2. pseudospectral Chebyshev method. E = 10- . . . . . . . . . . . . 30

2.6 Example 2. pseudospectral Chebyshev method. E = law6 . . . . . . . . . . . . 31

2.7 Example 3. pseudospectral Chebyshev method. c = 10- . . . . . . . . . . . . 35

2.8 Example 3. pseudospectral Chebyshev method. t = low4 . . . . . . . . . . . . 35

2.9 Example 3. pseudospectral Chebyshev method. E = . . . . . . . . . . . . 35

3.1 Example 1, transformation to the circle method. E = . . . . . . . . . . . 54

3.2 Example 1, transformation to the circle method. c = . . . . . . . . . . . 55

3.3 Example 1. transformation to the circle method? c = . . . . . . . . . . . 55

3.4 Example 2; transformation to the circle method. c = 10. . . . . . . . . . . . 60

3-5 Example 2. transformation to the circle method. E = . . . . . . . . . . . 60

3.6 Example 2. transformation to the circie method. c = 10-" . . . . . . . . . . 60

4.1 Example 2. Chebyshev collocation method. E = . . . . . . . . . . . . . . 66

4.2 Example 2. Chebyshev collocation method. E = lV4 . . . . . . . . . . . . . . . 66

4.3 Example 2. Chebyshev collocation method. E = . . . . . . . . . . . . . . . 66

Page 12: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

. 5 f Example 1. the condition number for two methods. E = . . . . . . . . . . 79

5.2 Example 1: the condition number for two methods. E = . . . . . . . . . . 79

5.3 Example 1. the condition number for two methods. E = lod6 . . . . . . . . . . 79

5.4 Example 2. the condition number for two methods. E = . . . . . . . . . . 79

5.5 Example 2. the condition number for two methods. E = . . . . . . . . . . 80

5-6 Example 2: the condition number for two methods. E = . . . . . . . . . . 80

Page 13: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

List of Figures

Cubic B-spline functions . . . . . . . . . .

. . . . . . . . . . . . . . Distribution of Chebyshw collocation points. iV = 32 13

Example pseudospectral Chebyshev method. r = lo-'. LV -- 32 . . . . . . . 19

Example 1: pseudospectral Chebyshev method. r = N = 64 . . . . . . . 20

Example 1. pseudospectral Chebyshev method. E -= lo-?? -1; = 96 . . . . . . . 'LO

Example 1: pseudospectral Chebyshev method. t- = lo-'. N -- 32 . . . . . . . 21

Example 1. pseudospectral Chebyshev method. r = 1 o - ~ . N = 64 . . . . . . . 21

3') Example 1. pseudospectral Chebyshev method. 6 = lo-". 2%- :li 96 . . . . . . . . .

Example 1: pseurlospectral Chebyshev method. r = 10-\ N N 125 . . . . . . 22

Example 1. pseudospectral Chebyshev method. E = 10-5 ,N = 32 . . . . . . . 23

2.10 Example 1. pseudospectral Chebyshev method. r = 3-7 N = 64 . . . . . . . 23

2.11 Example 1: pseudospectral Ghebyshev method. c = 18-7 N i\l' 96 . . . . . . . 24

2.12 Example 1: pseudospectral Chebyshev method. t- = I Q - ~ ? N = 128 . . . . . . 2.1

. . . . . . . 2.13 Example 2. pseudospectral Chebyshev method. c = N = 32 27

2.14 Example 2. pseudospectral Chebyshev method. r = 1W2. N = 64 . . . . . . . 27

. . . . . . 2.15 Example 2: pseudospectrd Chebyshev method. r = AT = 128 28

2.16 E~aiiipk 2. pswdospeetra! ChebysEw ii~etbod~ r = f 0-4. N = 256 . . . . . . 28

. . . . . . 2.17 Example 2. pseudospectral Chebyshev method. r = N = 512 29

2.18 Example 2. pseudospectral Chebyshev method. r = 10-5 N N 1128 . . . . . . 29

Page 14: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

2.19 Exampie 2; psendospectrat Chebyshev method. E = N = 256 . . . . . . 30

2.20 Example 3: pse3ldospec:ra.l Chebyshev method. E = N = 32 . . . . . . . 32

2-23 Example 3; pseudospectral Chebyshev method. E = lov2. hi = 64 . . . . . . . 32

2.22 Example 3? pseudospectral Chebyshev method. E = N = 128 . . . . . . 33

2.23 Example 3: pseudospectral Chebyshev method. E = lov4. hT = 256 . . . . . . 33

2.24 Example 3. pseudospectral Chebyshev method. E = N = 256 . . . . . . 34

2.2.5 Example 3. pseudospectral Chebyshev method. E = -i\: = 512 . . . . . . 34

2.26 Example 1. average error (+1012) for E = N = 32.64.96. 128 . . . . . . . 36

2.27 Example f; average error (*lo2) for E = N = 32.64.96. 128 . . . . . . . 36

2.28 Example 1. average error (*lo2) for E = 1\;7 = 32: 64.96. 128 . . . . . . . 37

2.29 Example 2. average error ( w 1 0 3 ) for E = N = 32.64. 96. 128 . . . . . . . 37

2.30 Example 2: average error for E = low4. N = 128.256. 512 . . . . . . . . . . . . 38

2.31 Example 2. averageerror for E = 10-5 N = 128.256.512 . . . . . . . . . . . . 38

3.1 Example 1. transfo~mation to the circle method. E = low2. N = 32 . . . . . . 49

3.2 Sxample 1. transformation to the circle method. E = N = 64 . . . . . .

3.3 Example 1. transformation to the circle method. E = N = 96 . . . . . . 50

3.4 Example It transformatioo :o the circle method. E = lo-*. hT = 32 . . . . . . 50

3.5 Example 1 . transformation to the circle method. E = N = 64 . . . . . . 51

3.6 Example 1. transformation to the circle method. E = N = 96 . . . . . . 51

3.7 Esample 1. transformation t o the circle method. E = N = i28 . . . . . 52

3.8 Example l1 transformation to the circle method. E = .N = 32 . . . . . . 52

3.9 Example 1- transformation t o the circle method. E = N -64 - . . . . . . 53

3-10 Exampie 1. transformation to the circle method. E = N = 96 . . . . . . 53

3.1 I Exampie It transfomatIon to the circle method. E = il; = 128 . . . . . 54

3.12 Esample 2: transformation to the circle method; E = N = 64 . . . . . . 57

3.23 Example 2 . rransfmmation to the circle method. E = lo-*. iY = 128 . . . . . 57

Page 15: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

3.14 Example 2. transformation to the circle method. E = lo-". :V = 256 . . . . . 58

3.15 Example 2. transformation to the circle method. r = 10-5 i17 = 125 . . . . . 58

. . . . . 3.16 Example 2? transformation to the circle method. E = ;Ir = 256 59

3.17 Example 1. the pseudospectral method. ili = 96. c = . . . . . . . . . . .

3.18 Example 1: the pseudospectral method. N = 96: r = 10. . . . . . . . . . . . 61

3.19 Example 1. the circle technique. i'L' = 96. E = 10-< . . . . . . . . . . . . . . 6%

3.20 Example 1: the circle technique. -n/' = 96. E = lo-' . . . . . . . . . . . . . . . 62

4.1 Example 2. Chebyshev collocation method. E = iV = 32 . . . . . . . . . 68

4.2 Example 2. Chebyshev colIocation method. E = = 64 . . . . . . . . . 68

4.3 Example 2; Chebyshev collocation method. E = N = 96 . . . . . . . . . 69

4.4 Example 2. Chebyshev collocation method. E = lom2. -ni = 128 . . . . . . . . 69

4.5 Example 2: Chebyshev collocation method. E = lo-*. N = 256 . . . . . . . . 70

. . . . . . . . 4.6 Example 2. Chebyshev collocation method. E = N = 512 7Q

4.7 Example 2. Chebyshev collocation method. 6 = A7 =rr 96 . . . . . . . . . 71

4.8 Example 2. Cb-ebyshev collocation method. E = N = 128 . . . . . . . . 71

4.9 Example 2. Chebyshev collocation method. 6 = N = 256 . . . . . . . . 72

. . . . . . . . . 4.10 Example 2. Chebyshev collocation method. 6 = hT = 96 72

4.11 Example 2. Chebyshev collocation method. cl = lou6. N = 128 . . . . . . . . 73

. . . . . . . . 4.12 Example 2. Chebyshev collocation method. 6 = lov6. N = 256 73

5.1 Example 1. singular vector (u l ) versus Chebyshev points. c = lo-" N = 96 . 80

3.2 Example 1. singular vector (a2) versus Chebyshev points. E = N = 96 . 81

5.3 Example 1. singular vector (u3) versus Chebyshev points. c = N = 96 . 81

5.4 Example 1. singular vector (ug3) versus Chebyshev points. t = los2. N = 96 . 82

5.5 Example 1. sin,d ar vector (w) versus Chebyshev points. E = lo-" N = 96 . 82

5.6 Example 1. singular vector (ws) versus Chebyshev points. t = N = 96 . 83

5.7 Example 1. singular values E = N = 96 . . . . . . . . . . . . . . . . . . 83

Page 16: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

5.8 Example 1, coefficients {bi) of the equation (5.1) e = N = 96 . . . . . . 84

Page 17: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

apter P

Introduction

Numerical methods for solving ordinary and partial differential equations have always been

important in scientific investigations. With the advent of computers, the use of numerical

methods has been popularized, and more importantly, people are now able to attack those

problems which are fundamental to our understanding of scientific phenomenon, but were

so much more difficult t o study in the past.

There are a large number of numerical methods available for use now, and among them,

spectral metZ.ods have attracted much of the attention in current research on numerical

methods. In this thesis, we plan to study two specific spectral methods for solving boundary

%due problems. In this Chapter, we first introduce the pseudospectral Chebyshev method,

and then briefly mention a quite popular numerical method for solving boundary value

problems, viz., the collocation method.

1.1 Pseudospectral Chebyshev Met hods

Spectrd -!methods are tcday nst zs widely used in the numerical soluticc of (two-point)

boundary value problems (BVPs), even though they are very popular for time-dependent;

PDE's. However, for a mriety of BVPs, they are competitive with the classical finite

Page 18: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

UCT

difference, shooting, and collocation methods (see [15]). In spectral methods, the solution

is assumed to be a fmite linear combination of some set of global analytic basis functions,

for example, Chebyshev polynomials. The differential equation yields then a system of

equations for the coefficients.

These schemes can be very efficient because the rate of convergence or the order of

accuracy as the number of modes increases depends only on the smoothness of the solution.

In particular, for an analytic solution of the differential equation, the error decays ex-

ponentially (see [l5]). By contrast, for example, in finite difference methods, the order of

accuracy is fixed by the scheme.

For the pseudospectral Chebyshev methods, the solution is discretized at the Cheby-

shev collocation points. The approximate solution is forced to satisfy the eqnation only at

the Chebyshev collocation points. This method has the advantage of being able to deal

more easily with nonlinear terms than the spectral method. The basic idea of pseudospec-

tral Chebyshev methods consists of replacing exact derivatives by derivatives of interpo-

lating polynomials at the Chebyshev points. Unfortunately, the pseudospectral Chebyshev

methods lead to very ill-conditioned matrices ([4], [IT]). The condition number of the first

derivative matrix is proportional to N 2 , while the condition number of the second derivative

related matrix increases like N4, where N is the number of collocation points.

In order to overcome the ill-conditioning an efficient preconditioner was suggested by

Orszag [I?]. The resulting condition number is nearly constant with respect to N [8].

Canuto and Quarteroni [6] proposed two classes of preconditioning matrices: one arising

from finite difference, the other from finite elements. Further, Orszag [I?] chose a different

mesh for the preconditioner. An interesting alternative procedure was proposed in [8]: the

preconditioning operator computes the first derivative at the intermediate grid points, then

shifts the value to the original grid points.

Rerrut [4] transfers the problem into an equivalent one on the circle, and then solves

the problem on the circie with the pseudospectral Fourier method so that the matrix has

Page 19: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

condition 0(..V2) for second order ordinary diffsential equations. We will study this "circk

technique" in Chapter 3.

In this section, we will present the pseudospectral Chebyshev method. We considtx a

smooth function n(xj in the domain s E i-1,1]. The Chebyshev collocation points are

which are the extremrt of the Nth order Chebyshev polynomial

TN(x) = cos(N cos-I x ) .

rn he function u(x) is interpolated by a polynomial P(x), (P(x;) = u(z;) = a;), of degree

5 N , N

P(x) = C ujLj(x), j = O

where Lj is the polynomial of degree N with

It cca be shown [14] that

where

The derivative of u(x) at the collocation points xj can be approximated in many different

ways. The most obvious way to compute the derivative is via matrix-vector multiplication

f?]. The eotries of the Chebjjshev derivative matrix l?, are computed by taking the axdytical

derivative of Lj(x) and evaluating it a t the collocation points s k for j, k = 0, . . -, ii, i.e.,

dkj = L3(xk). Then the entries of the matrix are

Page 20: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

and now the derivative of u(x;) becomes

Some researchers have used other methods 1211. Variation of this matrix - vector multiplica-

tion algorithm are described in [21]; the other popular method uses the FFT (Fast Fourier

Transform), and is asymptoticaJly faster (O(N1ogN) operations) than a matrix vector mul-

1.2 Collocation Method

In this section, we will discuss a collocation method which in some sense is equivalent to

the Runge-Kut ta method; for an extensive treatment (see [I]). The important difference

between this method and the pseudospectral method is that it uses basis functions with

local support and limited differentiability.

We are given the linear equation

where y is a given function. Approximating the solution x(t) of (1.2.1) by the method of

collocation consists of finding a function xn;(t) E span{&, . - - , + N ) .

by solving the N x N system of linear equations

Here t l , t2, - - , t~ are N distinct points of the domain a t which aJl the terms of (1.2.2) are

defined. The function xN(t), if it exists, is said to collocate x(t) at the points tl , . - , t ~ .

Page 21: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Any function xN(t) so obtained is referred to as an approximate solution abtained by the

method of collocation.

For example, let us consider the Linear boundary value problem

Lx(t) = x"(t) + p(t)x'(t) 4- q(t)z(t) = f (t), 0 < t 5 1

and we assume that this problem has a unique solution x(t), and that p(t) and q(t) arc

continuous on [ O , l ] . To approximate s(t) by collocation using the cubic B-splines {B;):!:, ,

let n := 0 = to < tl < - - - < t, = 1. Let x , ~ E s p ~ n { B - ~ , Bo,. . - , Using collocation

with these approximating functions, we seek

SN = a-lB-1 (t) + aoBo(t) + - -. + a,+l B,+l(t) (1.2.3)

such that

X N ( ~ ) = 0,

LzN(t;) = f (ti), 0 5 i < n ~ ~ ( 1 ) = 0.

Notice that we are coliocating at n+ 1 knots and we force xN(t) to satisfy the same boundary

data as x(t). However, since we have n -t 3 basis functions, we have the same number sf

unknowns as equations.

To compute xN(t), we first use the linearity of L.

Thus for 0 _< i 5 n, n-tl

LxN(ti) = C ajLBj(ti) = f(ti), (1.2.4) j=-1

where

while

Page 22: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER I . INTRODtrCTIi31"v'

and

Figure 1.1: Cubic B-spline functions

Recalling that B;(t) = Bi(t) = B;"(t) = 0 when t 2 and t 5 for each i, we see

that (1.2.4) reduces to the hear system

where the coefficient matrix Cn is

Page 23: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

and a = (a-l, ao, ax, - - - , an+l)T and b = (0, f (ro), f (XI), . , f(s,), o)*. Cn is almost

tridiagonal, Eliminating a-1 and a,+l leads to an (n + 1) by ( n $1) tridiagonal system. It

is clear that x N ( t ) exists and is unique if and only if Cn is nonsingular.

1.3 Thesis Plan

In this thesis, we will study three numerical methods for solving singularly perturbed two-

point boundary value problems of order 2. The plan of the thesis is as follows. In Chapter

2, we wiU study a spectral method called the pseudospectral Chebyshev rneth~d. The

necessary background about Chebyshev polynomials and expansions in terms of Chebyshev

polynomials is reviewed, then the pseudospectral Chebyshev method is derived and thc

numerical procedure for carrying out this method is explained. This is followed by an

applicaticn of the pseudospectra! Chehyshev methsd to solve three carefully chosen BVPs.

In Chapter 3, we will first study a spectral method with preliminary transformation to

the circle. This method starrts with transforming a problem defined on x E: [-I, I] into an

equivalent problem defined on the unit circle through x = cos 4; then the method proceeds to

apply the Fourier spectral method to solve the transformed problem. Next, we will study two

Page 24: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

iterative methods. The first iterative method is the conjugate gradient iteration applied to

the normal equations, and the second iterative method is the biorthogonalization algorithm

adapted from the biconjugate gradient iteration. We then apply the transformation method

and the iterative methods to solve the three problems studied in Chapter 2.

In Chapter 4, we briefly discuss the Chebyshev collocation method and compare with

the pseudospectral Chebyshev method discussed in Chapter 2.

In Chapter 5, we will discuss the numerical results obtained in the previous three Chap-

ters comp~ehensively, Both merits and shortcomings with each method will be considered,

together with some explanations and a mention of future research.

Emphasis in this thesis has been given to singularly perturbed BVPs controlled by a

singularity parameter E . Three kinds of singularities have been investigated: mild ( E =

stiff ( E = and very stiff ( E = 10-9, and three types of layers in exact solutions have

been considered: one layer at the center of the domain; two layers on the boundaries of the

domain; and one layer on the left boundary of the domain. Numerical performance of the

above mentioned methcds have been judged in terms of condition numbers, average errors

and cpu times. It is shown that numerical solutions are accurate despite the large condition

number.

Page 25: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

A Pseudospectral Chebyshev

Method

2.1 Introduction

There are many different numerical methods for solving differential equations, and spectral

methods are now widely used. However, for boundary value problems (BVPs), the use of

spectral method has not been studied in great detail. In fact, standard textbooks usually do

not cover the spectral method or its variants for BVPs, although in the sixties polynomial

collocation methods had received some attention for BVPs (see for example [23]). Efowever,

spline collocation methods became more popular, and renewed interest in spectral methods

is more recent. In this Chapter, we study a specific variant of spectral methods, namely,

the pseudospectral Chebyshev method.

The basic idea of pseudospectral Chebyshev methods consists of replacing exact deriva-

tives by derivatives of interpolating polynomials at the Chebyshev points in the domain,

Improving cornpilutationd efficiency of spectral methods is one of the main purposes of the

current investigation into these met hods. Discrete Chebyshev differentiation can be rep-

resented by matrices, and in practice, these matrices are severely ill-conditioried and full.

Page 26: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUDOSPECTRAL CHEBYSHEV t47METHOD 10

Thus, it is important to find efficient techniques for solving the algebraic systems. The con-

dition number of the matrix related to the N-point Chebyshev pseadospectral approximation

of the first derivative operator is proportional to N*, while for the matrix related to the

second derivative operator, the condition number increases like N" Iterative methods and

preconditioning techniques have been proposed to solve these spectral algebraic systems by

Orszag 1171, Canuto and Quarteroni [6] and other authors. We will discuss iterative meth-

ods in Chapter 3. In this Chapter, we consider the direct method, namely, the Gaussian

elimination met hod.

2.2 Chebyshev Polynomial Expansions

First, we review several results from approximation theory. The Chebyshev polynomial of

degree k (k = 0,1, - - -) on [- l ,1] is defined by the formula

Clearly, ITk(%)[ 5 1 for x E [-I, 11. The Tk are indeed polynomials in x. For example,

by definition, and using elementary trigonometric identities, we can obtain the recursicn

Let be the space of square integrable functions defined on [- 1, 11. Then the functions

Tk constitute an orthonormal basis with respect to the inner product

in L?-l*,l. The convergence theory of Chebyshev polynomial expansions is very similar to

that of Fourier cosine series. In fact, suppose for f ( x ) E Lf-l,ll, we write formay

Page 27: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEL-DOSFECTRAL CHEBYSHEV A4ETNOD 1 I

the so-called the Chebyshe~ series associated with f(21, where ak is to be deter~nincd, then

G(B) := g(cos 0) is the Fourier cosine series of F(6) := f (cos 0) for O < 0 5 T. '?his

result follows from the definition ~f Tk, because Tk(cos 0) =: cosjkd). G(8) = gjcosB) =

C& ak cos(k8). Thus,

Lr f (cos 0) cos(k8)dQ = f (z)Tk(x)(l - r2)-'i'dr. a k = - 7i Ck

where co = 2, ck = I (k > 0).

It follows from this close relation between Chebyshev series and Fourier cosine series

that if f(x) is piecewise continuous and if f(x) is of bounded total variation for -1 _< x 5 1

theng(x) = f[f(x+)+ f(z-)j for each z (-1 < x < 1) and g ( l ) = j(1-),g(-I) = f ( - I + ) .

Also, if f (p)(z) is continuous for all 1x1 < 1 for p = 0,1, ......, n - 1, and f (^)(r) is integrahlr.

then

a k = OCk-"1. (2 .2 .7 )

Since ITk(x)l 5 1 for 1x1 5 1. it follows that the remainder after k terms of the Chebyshev

series ( 2.2.5) is asymptoticaJly much smaller than k-("-') as k - 30. If f ( r ) is infinitely

differentiable for jzi < 1; the error in the Chebyshev series goes to zero more rapidly than

any finite power of k-' as k - m [Is].

The most important feature of Chebyshev series is that their convergence properties are

not affected by the values of f(x) or its derivatives at the boundaries x = f 1, but only by

the smoothness of f(x) and its deri~atives throughout - 1 < z < 1. In contrast, the Gihbs

phenomenon shows that the rate of convergence of Fourier series depends on the value of

f (z ) and its deriva.tives at the boundafies in addition to the smoothness of f(z) and its

derivative in the interior of the interval. The reason for the absence of a Gibhs phenomenon

for the Chebyshev series of ffx) at z = f l is due to the fact that F ( 0 ) = f (cos Oj satisfies

F&+l(0) = I;ip+lj~) = 0 provided or& that all derivatives of f(x) of order at most 2 p $ I

exist at s = f 1.

An important consequence of the rapid convergence of Cheby shev polynomial expansions

Page 28: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSECDOSPECTRAL CHEBYSHEV METHOD 12

of smooth functions is &;it Chebyshev expansions may normally be differentiated termwise.

Since

uniformly for js/ < 1 I if ak --; 0 faster than any finite power of k-I as k - CC, then (2.2.5)

2.3 A Pseudospectral Chebyshev Method

Ln this section, we consider a pseudospectral Chebyshev method for the linear second order

two-point boundary value problem,

where E is a parameter that controls the sin,darity of the problem. Our discussion will

follow Berrut [4], who formulated the algorithm for E = 1. Suppose that the problem is

well-posed and in particular that it has a unique solution. The Chebyshev interpolation

polynomial can be written as hi

where j7i

zj = cos - ? j = O,l , . - - ,X i3-

N-1 are the interpolating points (also called collocation points), {pj},=, are the unknown

cmff:cients to be and Lljf;z) is the Lagrange inteqdatioa polpomid ass~ciated

Since L j ( z k ) = lijk (6jk is the Kronecker delta), it follows that r ( z j ) = vj.

Page 29: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 2.1: Distribution of Chebyshev colloci~tion jmirrts, AT = 32

Here we analyze the relation between the numbcr of thc collocat,ion points rind t l ~c widt,h

Ofc) of the boundary la.yer.

Since

ax, = 1x1 - xo1 = 1 COS(T/N) - 1 1

= 11 - sin(O)(~/N j - 4 COS(O)(T/N)~ + - - - 11 1 7r2 5 = 2 p = p 9

T az= ~ c o s ( ~ + 5 ) - 0 1 = Fm-

Therefore we can see that the spacing between the colloc;at,ior~ points ncar thc bourrdary

' whilc t,hc is Axl 0 ( & ) and the spacing near the center of the interva.1 is A? -- O ( E ) ,

width of the boundary layer is O(cj. For good resdution of our nurnr:rical sdiitiorlfj at

!east one of the cdocation pokts should tie In the boundary layer (or any transition layclr).

Therefore we need 5/IV2 < c, ie., N > &/&. If the width of the boundary laycr was

exactly t, we should use N x 2200,220 and 22 for c = lowG, l W 4 and 1 W2 rcspr:ct,ivcly.

Page 30: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2, A PSEVDOSPECTRAL CHEBYSHEV ,ME TROD 14

In our numerical computations we never used N larger than 1024, and therefore, were

not able to resolve the boundary layers for E = See [24] for a method which achieves

resolution for smaller values of TJ in the case of small E .

The Chebyshev method substitutes the interpolation polynomial (2.3.11) into (2.3.10),

and then replaces r ( z o ) by Uo and v ( x N ) by UN. Doing this, we have

Using collocation points {zj};"=;', we have collocation equations

Denoting by D, the matrix of the first derivatives L:(xj) (2, j = 0'1, - .., N), and letting - - U1(xj) = Uj ( j = 0 ,1 , - - - ,N) , U(zj) = Oj (j = 0 7 1 r - - - , N ) gives

where

Page 31: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

In view of the fact that the mat rh of the second derivatives Lyjst) is the square of D,.

(see [4]), we obtain the system of linear equations

for the B(si), i = 1 , 2 , - - - , N - 1, with pi := p(x;), q; := q(x,). The largest eigenvalue

modulus of 02 is known to grow with N like 0 ( N 4 ) (see [4]), and in the example we

consider in section 2.5, the numerical value of that modulus grows about that fast.

For simplicity, we write equation (2.3.15) in matrix form

For a fixed integer N, solving system (2.3.16) for U and substituting U , Uo and UN in

t o (2.3.11) will lead to our numerical solution U(x) to the BVP (2.3.10).

The LINPACK [7] subroutines operate on general square nonsymmetric matrices, The

operations performed include the triangular factorization of matrices, the estimation of the

Page 32: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

matrix condition number, the solution of simultaneous linear equations and the calculation

of determinants and inverses. Let A be a real or complex square matrix of order n. There

is an upper triangular matrix U and a matrix L which is the product of elementary lower

triangular and permutation matrices such that A = LU. This factorization can be used to

solve linear equations Ax = b by solving successively L(Ux) = b to compute the inverse of

The condition number k(A) is a quantity which measures the sensitivity of the solution

x to errors in the matrix A and the right hand side b. If the relative error in -4 is of size r ,

then the resulting relative error in x can be as large as ~ ( A ) E . Error in A can arise in many

ways. In particular, the effect of the roundoff error introduced by the subroutines in this

Chapter can usually be assessed by s&ng E to be a small multiple of the rounding unit.

It is possible to efficiently compute a quantity RCOND which is an estimate of the

reciprocal condition, 1/k(A). If exact singularity is detected, RCOND may be set to 0.

If A is badly scaled, then the interpretation of RCOND is more delicate.

We use the double precision, general subroutines DGECO, DGEFA to solve linear system

Az = b. DGECO is usually c d e d first to factor the matrix and estimate its condition. The

actual factorization is done by DGEFA which can be called in place of DGECO if the

condition estimate is not needed. The time required by DGECO is roughly (1 $ 9 / N ) times

the time required by DGEFA. Thus when N = 9, DGECO costs twice as much as DGEFA,

but when N = 90, DGECO costs only 10 percent more.

Roundoff errors in floating point arithmetic operations usually cause the quantities com-

puted by the subroutines in this Chapter to be somewhat inaccurate. The following fairly

vague statements give a general idea of the extent of these inaccuracies.

DGEE4 produces matrices L and U for which the product LIT is almost always within

roundoff error of -4, no matter how close A is to being singular.

DGECO has experimentally been shown to produce an estimate RCOND for which

IIRCOXD is u sudy the same order of magnitude as the actual condition number.

Page 33: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

To make these statements more precise, we introduce the followi~tg ~ i o t i ~ t i ~ i l . Lc6 a , bc

the columns of A. For x E R", define

Then the condition number of A with respect to lI.I1l is

If errors are measured in the usual Euchidean norm,

then the condition number is

Here al(A) and u,(A) are the largest and smallest singular valuc of A. k l j / l ) ; L I I ~ k2(/1) ;Lrc

different, but are usually of the same order of rnagnitudc.

2.5 Numerical Results

The pseudospectral Chebyshev method discussed in section 2.3 was scMonr :~pplic:d to solvc

'i0116: narrow singularly perturbed BVPs. For such problems, wc rlecd to cortsidw two reb.

regions of very fast variation (so-called boundary or interior l qe r s ) , and witlcr rc!giorls of

slow variation. The concept of singularly perturbed H V P relates to th l~ r,c)nccpt of stiff UV I'

in numerical analysis. All the computations in this thesis were done o ~ i a Sparc sl,at,iori. III

our Tables, the average errors are computed by

1 N Average Error = - /u(x,) - u ,,,, l ( x , ) j ,

1v 3=1

Page 34: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUDOSPECTRAL CHEBYSHEV METAOD

where hi is the number of terms used in the Chebyshev series, u(x) is the numerical solution

and ZL,,,~ is an exact solution. The condition number (RCOND) of A is obtained by

LIEPACK [7]

Example 1.

Consider

whose solution is

where

is the error function. For 0 5 c << 1 this solution has a rapid transition layer at x = 0.

COLSYS [I] has no problem for e = to reach error O(IO-~) with mesh points N =

132, but if the problem is run using no mes5 selection, comparable accuracy is not achieved

until N = 1280 [I]. The interior layer gets resolved well, because one of the col4ocation

points is exactly at the location of the layer. Usually interior layers pose more difficulty.

We first tested E = For N = 32, 64 and 96, we plotted our numerical solutions

(the solid-dotted lines) and the exact solution (the dotted line) in Figure 2.1 to Figure 2.3.

As can be seen, our numerical solutions captured all the properties of the exact solution for

N as small as 64. See Table 2.1 for a summary of the related condition numbers, average

errors md cpu tines. It Is interestiog thzt for E = the cm&ticn numbers cf the matrix

are much smaller than the theoretical 0(N4).

Next: we tested E = In this case, the rapid transition of the exact solution at x = 0

showed up moderately. We plotted our numerical solutions in Figare 2.4 to Figure 2.7 for

N = 32, 64, 96 and 128, respectively. The approximation to the exact solution improves as

Page 35: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEtrDOSPECTR4L CHEE YSHEV- METHOD

AT increases. However, even when N = 128, there is noticeable oscillation near z = 0. Table

2.2 contains the relevant numerical summary. Still, the condition numbers are smaller than

o(-w4j.

Finally, we tested E = In this case, the exact solution has a sharp change at x = 0!

and it took N as large as 128 to reach a fairly good numerical solution. For this stiff problem

(i.e. E = 1V6), see Figure 2.8 to Figure 2.11 and Table 2.3.

Figure 2.2: Example 1, pseudospectral Chebyshev method, c = N = 32

Page 36: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUDOSPECTRAL CHEBYSBEV METHOD

Figure 2.3: Example 1, pseudospectral Chebyshev method, E = low2, N = 64

Figure 2.4: Example 1, pseudospectral Che3)yshev method, c = lov2, N = 96

Page 37: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSE'liDOSPECTK4L CHEBYSHEV METHOD

Figure 2.5: Example 1, pseudospectral Chebyshev method, e = N = 32

Figure 2.6: Example 1, pseudospectral Chebyshev method, t. = N = 64

Page 38: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUDOSPECTRAL CHEBYSHEV METHOD

Figure 2.7: Example 1, pseudospectral Chebyshev method, E = AT = 96

Figure 2.8: Example 1, pseudospectral Chebyshev method, E = loe4, N = 128

Page 39: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

(=H,4PTER 2. A PSEUDOSPECTRAL CHEBYSHEV hiE'THOD

Figure 2.9: Example 1, pseudospectral Chebyshev method, E = N = 32

Figure 2.10: Example 1, pseudospectral Chebyshev method, ts = lo-", N = 64

Page 40: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUBOSPECTBAL CHEBYSHEV METHOD

Figure 2.11: Example 1, pseudospectral Chebyshev method, E = low6, N = 96

Figure 2.12: Example 1, pseudospectral Chebyshev method, E = N = 128

Page 41: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. -4 PSEL3OSPECTRAL CHEB WHET- METEOD

i i 3 / Condition Xumber / Average Error 1 Cpu-Tiroe 1 / 3 2 i 6.4x102 / 1.23 x10-I 0.3 1

Table 2.1: Example 1, pseudospectral Chebyshev method, E = lo-"

Table 2.2: Example 1, pseudospectral Chebyshev method, s = l o w 4

3 I Condition Number

32 1 4.5 x l o 4

Bverage Error / Cpu-Time

4.38 x 1 0 - ~ 1 0 -28

Table 2.3: Example 1, pseudospectral Chebyshev method, E =

S / Condition Sumber 1 Average Error Cpu-Time

32 j 5.8 x l o 6 4.65 x lW2 0.41

j m / 1 . 2 ~ 1 0 ~ 1.6. lo-' :.R3 1 / 96 1 1.8 xlo7 I / 1.95 x ~ O - ~ 5.68

Page 42: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Example 2.

-4s the second example, we considered the BVP

which has the exact solution

whtxe U(r) denotes an quantity which can be bounded by a constant times E . This solution

has two boundary layers at the ends, and is smooth near the "turning point" x = 0. The

numeric23 error propagates from the boundaries to the middle of the i n t e r d [-I, 11. This

equation has tendency for an interior layer. Maybe oscillations in interior are related to this

fact. COLSYS succeeded in solving this problem for t = 10-"though the error is not too

small (See [l]).

Again, we considered three different cases corresponding to E = loe2, E = and

t = respectively. When E = accurate numerical approximation to the true

solution was easy to obtain; see Figure 2.12, Figure 2.13 and Table 2.4. When r =

it required a relatively large .ii t o obtain a ~easonable numerical solution; see Figure 1.14

to Figure 2-16 for n = 128, 256, 512, respectively and Table 2.5. However, for N = 512,

a fairly good numerical solution =as achieved. When E = it was difficult to reach

gcmd numerical solutions wen for large N. It is shown that the pseudospectral Chebyshev

method fails to solve this txo boundary l a ~ s problem with small r ( e g while it

succeeds in solving it with 6 = See Figures 2.17 and 2-18. and Table 2.6. However, it

appears reasonable xo expect highly accurate solution for sufEiciently large IS? even for s m d

Page 43: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 2.13: Example 2, pseudospectral Chebyshev method, r = 1V2, N = 32

Figure 2-14: Example 2, pseudospectral Chebyshev method, E = 10-5 N = 64

Page 44: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUDOSPECTRAL CHEBYSHEV METHOD

Figure 2.15: Example 2, pseudospectral Chebyshev method, E = N = 128

Figure 2.16: Example 2, pseudospectral Chebyshev method, E = N = 256

Page 45: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 2.17: Example 2, pseudospectral Cbebyshev method, 6 = N = 512

Figure 2.18: Example 2, pseudospectral Chebyshev method, 6 = 10-7 N = 128

Page 46: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 2.19: Example 2, pseudospectral Chebyshev method, E = N = 256

Table 2.4: Example 2, pseudospectral Chebyshev method, E =

N

32

N Condition Number Average Error Cpu-Time

128 3.3 XIO" 2.10 xlo0 14.57 I

Table 2.5: Example 2: pseudospectral Chebyshev method, c =

Condition Number

3.0 x103

Average Error ,

2.10 x ~ o - ~

Cpu-Time

0.39

Page 47: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Table 2.6: Example 2, psexdospectral Chebyshev method, c = lo-"

Example 3.

-4s the third example, we considered a problem with one boundary layer

which has the exact solution

U ( Z ) = (1 - exp (--%)I / {I - exp (-:)I. Similar to the previous two examples, when 6 = 1W2, our numerical solutions became

very accurate for N as small as 64; see Figure 2.19, Figure 2.20 and Table 2.7. When

E = a large N was needed t o produce a fairly good numerical solution; see Figure

2.21, Figure 2.22 and Table 2.8. When E = low6, our numerical solutions were not close to

the exact solution for N as large as 512; see Figure 2.23, Figure 2.24 and Table 2.9. For this

problem, the condition numbers are much smaller than 0(N4), because there is a smdl c

multiplying the matrix D;.

Finally? we plot some pictures of the error versus N for Example 1 and 2, as shown in

Figure 2.25 t o Figure 2.30. The errors become smaller as N is larger.

Page 48: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUDOSPECTRAL CHEBYSBEV METHOD

Figure 2.20: Example 3, pseudospectral Chebyshev method, E = N = 32

Figure 2.21: Example 3, pseudospectral Chebyshev method, E = N = 64

Page 49: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CEAPTER 2. A PSE CTDOSPECTRAL CHEBYSHEV METHOD

Figure 2.22: Example 3, pseudospectral Chebyshev method, t = N = 128

Figure 2.23: Example 3, pseudospectral Chebyshev method, t = N = 256

Page 50: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUDOSPECTRAL CHEBYSHEV METHOD

Figure 2.24: Example 3, pseudospectral Chebyshev method, 6 = N = 256

Figure 2.25: Example 3, pseudospectral Chebyshev method, E = low6, N = 512

Page 51: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Table 2.7: Example 3, pseudospectral Chebyshev method, E =

N

32

Condition Number Average Error

Condition Number

1.7 xlo3

Cpu-Time

Table 2.8: Example 3, pseudospectral Chebyshev method, 6 =

Average Error

4.52 xloqG

Cpu-Time

0.36

N

256

512

Condition Number

2.3 x lo4

Table 2.9: Example 3, pseudospectral Chebyshev method, E = lo-'

1.3 xlo5

Average Error

1.54 xloO Cpu-Time

94.07

1.32 xloO I

749.28

Page 52: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 2.96: Example 1, average error (*1012) for e = loe2, N = 32,64,96,128

Figure 2.27: Example 1, average error (*lo2) for e = lW4, N = 32,64,96,128

Page 53: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 2. A PSEUDOSPECTRAL CHEBYSHEV METHOD

Figure 2.28: Example 1, average error (*lo2) for E = N = 32,64,96,128

Figure 2.29: Example 2, average error (*lo3) for r = 1W2, N = 32,64,96,128

Page 54: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

W P T E R 2. A PSEUDOSPECTEAL CHEBYSIIEV METHOD

Figure 2.30: Example 2, average error for E = N = 128,256,512

Figure 2.31: Example 2: average error for E = N = 128,256,512

Page 55: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Chapter 3

Preliminary Transform To The

Circle

3.1 Introduction

In our study of the pseudospectral Chebyshev method for linear ODES of order 2 in Chapter

2, we must solve a system of linear equations whose condition number grows with the

number of collocation points X like 0(N4). This property arises from the differentiation of

the Chebyshev interpolating polynomials. When a relatively large AT is needed to produce

a fairly good numerical solution, the related condition a m b e r is large, indicating relatively

low precision in the numerical solution. Therefore, various efforts have been made t,o reduce

the condition number whenever possible.

l[n this Chapter, we will first discuss a variant of the pseudospectral Chehyshev method

studied in Chapter 2, which was suggested by Berrut, L' j . The idea is simple: firstl the

problem is replaced by an equiialent one on the circle using a transforrnatiou; secondly,

the trasformed problem on the circle is solved with the pseudosyectraI Fourier method.

It is hoped that the related matrices resulted from doing this will have smaller mdi t ior i

oumbers like 0(M2); see [4]. Fdowing this, we will discuss two iterative met-hods hriefl y.

Page 56: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

3.2 The Method of Transformation to the Circle

For simplicity, w e consider a first order problem. Consider the initial value problem

If the pseudospectraf Chebyshev method is used to find the Chebyshev interpdation poly-

nomials N

P ( z ) = C @(xjpj(x), j = O

and if the Chebyshev points

are used as collocation points, one will reach a system of linear equations

AO = b, (3.2.2)

where A is D, defined in section 2.3, b = (F(xl), - . , F ( X - ~ ) ) ~ ; I? = (a(xl) , + . - : U ( X ~ ) ) ~ .

The direct solution to (2.2.2) requires 0 ( N 3 ) operations. The condition number of the

matrix A grows with 3 like 0(.X2) (see 12;).

1% new define the process of transformation to the circle with 4 denoting the angle; we

have

5 = COS 9,

f(6) := F(cos 6).

Thus ujd) and fjd) are 21;-periodic even functions on the full unit circle by defining

f(21; - 9) = f(~).

With these definitions, problem (3-2.1) now becomes

Page 57: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

or7 multiplying both sides by sin o,

It is clear from the definitions that a31 functions appearing in (3-2.4) are 'LT-periodic and

inherit the differentiability properties of the corresponding functions in the original problem.

,More importantly: problem C3.2.4) can be solved by the pseudospectral Fourier method as

described below.

Interpolating the trigonometric polynomials of degree W between the equidistant. points

and collocating at the gj j yield the linear system

for the approximate d u e s 2~(+~j, - + - , 21(hNw1). The coefficients (D,+jj, are the values at

@j of the derivative of the coefficient [4f

1 @ - Qn 1,(4j = - sin[hT(+ - d,)] cot -.

2 2N

This result comes from the general Lagangian form

of the trigonometric po1pomid interpolating an arbitrary functiou f (4j between the (Gj.

From the definition of the deriwive and Bernoulli rule, one can easily compute [4f

I"he matrix Dd of the s);stem (3.2.5) is therefore circulant laud skew symmetrjc j. The 4,

are the images of the Chebyshev points under the transformation 6 = arccosls); therefore,

Page 58: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIiMfNARY TRA,'?SFORM TO TEE CIRCLE

the values of F(+) used in the computation of h(4j) are the same as those used in AU = b

of (32.2).

The transformation to the circle technique can be applied to higher order problems.

We now consider the (singularly perturbed) second order linear two-point boundary value

problem

Now, instead of solving (2.3.15) directly, we propose to apply the circle transformation to

obtain an equivalent problem which is defined on the circle. To do this, let #(x) = arc cos(x)

be the inverse of x = cos q3 2nd define ~ ( 4 ) := U(cos 4), p(4) := P(cos +), q(4) := Q(cos $),

and f(4) := F(cos4); then

cos +(x) dtl(x j = [sin - cos +(x) . @I(%) = - --

sin3 $(x) '

Substituting the above expressions into (3.2.7) leads to

cos 4

Multiplying both sides by sin3 4, we get

ml ~ n e boundary conditions in (3.2.6j are transformed into a(&,) = z k and = UN.

The pseudospectrd Fmrier xethod ~pplied t o the ahme equation then leads to the

h e a r system ( j = 0,1, . - -,2& - 1)

Page 59: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Similar to the pseudospectral Chebyshev method, the matrix of the second derivatives !::(A j

is the square of the matrix D4 of the first derivatives. And there even exists a simple formula

Since p($), q(4)? f($) and ~ ( 4 ) are even functions of 4, and moreover, since D4 is

antisymmetric and D$ is symmetric, only N - 1 of the 2N equations (3.2.10) are linearly

independent: equations number j = 0 and N reduce to 0 (sin $j = 0 and (Dd)j,ii($,) = O),

and for n = 1, - -, N - 1, equation number 2N -- n is the negative of equation number n.

If we substitute G($2N-n) = G(&) into (3.2.9), we only need to solve the system composed

of the equations numbered 1 to N - 1 of (3.2.9), namely

by Gaussian elimination. Our computations later show that the condition number of (32.10)

grows like 0(N2) for non-stiff problems (3.2.7)[4], But for stiff problems, this is not tnie.

The principle is the transformation of the original problem to the circle and the consequent

elimination of the endpoint singularities of the factor of the derivatives (csc(4) or an odd

power of it). The Fourier method is then applied to the regularized equation; it makes use

of the same values of the functions appearing in the differential problem as the classical

Chebyshev method.

Page 60: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELI.MKPI'-ARY TRANSFORM TO THE CIRCLE

3.3 Iterative Methods

It is well-known that algebraic systems resulting from spectral methods are full and rather

ill-conditioned. For problem (3.2.6), the condition number of the matrix Di grows like

0 ( N 4 ) . Considerable attention has been devoted to the use of iterative methods. In this

section, we briefly discuss two iterative methods [16].

3.3.1 CGNR (The Conjugate Gradient Iteration Applied to the Normal

Equations)

CGNR is the name for implementation of the conjugate gradient iteration method applied to

the normal equations [16]. We apply the conjugate gradient iteration to the nonsymmetric

system

The normal equations are

A ~ A U = ~ ~ b .

This algorithm constructs a sequence

T O , A ~ T . , ( A ~ A ) A ~ T ~ , . - - , ( A ~ A ) ~ - ~ A ~ T , - , .

We want to find the unique sequence of vectors

with minimal residual at each step:

1 1 r , I ] = minimum

where r , = b - ,421,. This is equivalent to the orthogonality condition:

r, i ~ ~ ~ { A A ~ T O ~ ( A A ~ ) ~ T O , - - - , ( A A ~ ) " T ~ } .

Page 61: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Now, un can be formed by a three-term recurrence relation in the conjugate gradienr itera,-

tion.

The algorithm of CGNR:

Given an initial guess uo and initial residual

Given Po := 0; po := Ot

DO n := 1 , 2 , - - - ,

The convergence of CGNR is determined solely by the singular values of A. Any two matrices

with the same singular values have identical worst-case convergence rates. If A is normal,

the moduli of the eigenvalues are equal to the singular values. For details see (161.

3.3.2 CGS (The Conjugate Gradient Squared)

CGS is a biorthogonaLization algorithm adapted from the hiconjugate gradient iteration

First, we introduce biconjugate gradient iteration (BCG j which constructs non-optimal

approximations.

BCG constructs a sequence sf vectors

which implies

Page 62: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIMINARY TRAhTSF0RM TO THE CIRCLE

for some polynomial pn of degree n, where eo = A-lb - uo, and TO = b - AuO. The value pn

is now determined by the orthogonality condition

rn i ~pan{i;~, AT?o, - + - , A,T~ FO)

where To E Rn-I is a vector often taken equal to ro. BCG computes its choice of un by

three- term recurrence relations.

CGS, which stands for "CG-squared", is a modification of BCG by Scbnneveld PO] who

replaces equation (3.3.11) by

The polynomial pn remains the same and there is no increase in the amount of work per

step.

Furthermore, whereas BCG requires vector multiplications by both A and AT, CGS only

requires multiplications by A.

CGS algorithm:

1. Given an initial guess u0 and initial residual

Page 63: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIAiPliVliV4RY T E A W O R M TO THE CIRCLE

Although the convergence of CGS is governed by eigenvalues of A [16], its convergence

properties are less well understood than CGNR. It is still unknown how frequently CGS

turns out to be effective.

3.4 Numerical Results

We look again at the three examples studied in Chapter 2, using the method of transfor-

mation to the circle of section 3.2. We emphasize the comparison of the methods of this

Chapter and the pseudospectral Chebyshev method of Chapter 2. The reader is reminded

that in al l the figures t o follow, the exact solutions are plotted as dotted lines, and the

numerical solutions are plotted as solid-dotted lines.

Example 1 Revisited.

For the three different values of E and the method of transformation

to the circle was applied to solve the BVP of Example 1. Figure 3.1 to Figure 3.11 and

Table 3.1 to Table 3.3 show the results of the same kind of numerical work that was done

in Example 1 of Chapter 2.

The pictures here and the pictures in Chapter 2 look similar, however, the condition

numbers here are much smaller than those of Chapter 2 (except for the case where N = 128,

E = and the average errors here tend to be smaller for c = and slightly larger

for E = and E = low6. The cpu times here tend to be larger than those of Chapter

2 (except for the case where N = 128, E = When we applied the iterative methuds

above, we found that CGNR converged reasonably fast, but CGS did not. Also CGNR

appears t o work better when applied to the original problems versus the transformation to

Page 64: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIMINARY TRANSFORM TO TBE CIRCLE 48

the circle. This came as a surprise, since the matrices associated with the circle thechnique

are better conditioned. Figure 3.18 also shows that quite a few iterations of CGNR are

required, making this rather expensive. Further study, especially on the use of efficient

preconditioners is needed. We have chosen N = 96 and computed (2 x N) iterations of the

CGNR method. The results for the pseudospectral method are shown in Figure 3.17 and

Figure 3-i8. The Figure 3.19 and Figure 3.20 are the results for the transformation to the

circle technique.

Page 65: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CEAPTER 3. PRELIAMIATT4RY TRAIL'SFOKAf TO THE CIRCLE

Figure 3.1: Example 1, transformation to the circle method, 6 = N = 32

Figure 3.2: Example 1, transformation to the circle method, r = N : 64

Page 66: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIMINARY TP,Ai\iSFORM TO THE CIRCLE

Figure 3.3: Example 1, transformation to the circle method, E = 1W2, N = 96

Figure 3.4: Example 1, transformation to the circle method, E = N = 32

Page 67: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CEAPTER 3. PRELLVlINN4Rk- TRANSFORM T 0 OTHE CIRCLE

Figure 3.5: Example 1, transformation to the circle method, E = N = 64

Figure 3.6: Example 1, transformation to the circle method, r = lo-', N = 96

Page 68: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIMINN4RY TRANSFORM TO THE CIRCLE

Figure 3.7: Example 1, transformation to the circle method, E = N = 128

Figure 3.8: Example 1, transformation to the circle method, E = -7V = 32

Page 69: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELI,tfl.ATT4RY TRAXSF0Ril. f TO THE CIRCLE

I 1

- l l . O -0'. 5 O!O 015 1!0 X

Figure 3.9: Example 1, transformation to the circle method, c = rlr = 64

Figure 3.10: Example 1, transformation to the circle method, E = N = 96

Page 70: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIMIIIXARY TRANSFORAi TO THE CIRCLE

Figure 3.11: Example 1, transformation to the circle method, E = N = 128

?i I Condition ir'umber 1 Average Error / Cpu-Time

32 1 7.1 x102 1 1.23 x ~ O - ~ 0.97

/ 61 1 2.3 xlD3 1 4.18 xlO-" 3.26

Page 71: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Cpu-Time

0.92

3.23

7.17

12.74

X / Condition Xumber / Average Error

Table 3.2: Example 1: transformation to the circle method, E - 3. W4

4.39 x 1 0 - ~

2.15 x10-'

1.17 x 1 0 - ~

6.20 x10-~

32 1 3.2 xlo3

2.2 xlo4 1 7.7 x IO ' 96

Table 3.3: Example 1, transformation to the circle method, r = 101"

128 1.7 xlo5

N 1 Condition Number

32

Average Error 1 Cpu-Time

5.3 x105 4.65 X X O - ~ 0.91

Page 72: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Example 2 Revisited.

The same kind of numerical vork was carried out as we did in Example 2 of Chapter 2.

The results are displayed in Figure 3-15 to F i p r e 3.20 and Table 3.4 to Table 3.6.

The pictures here look close to the pictures in Chapter 2 again, but the condition numbers

and the average errors show a crossed pattern. For E = the method of transformation

to the circle produced much smaller condition numbers to reach the same average errors

when compared with the pseudosvctral Chebyshev method, however, for 6 = and

6 = this is no longer true. F x E = the average errors are still the same for the

two methods, but the condition numoers are larger for the first method when N is small,

and then become smaller when N is large. For E - the condition numbers with the

first method are always larger, while the average errors with the first method are always

smaller. The cup times also show a crossed pattern.

We wonder why the condition numbers related with circle technique for smaller

and are much larger than the condition numbers obtained by pseudospectral Cheby-

shev method. It seems that the circle technique is only successful in solving non-singularly

perturbed boundary value problems, but not so successful for solving singularly perturbed

boundary value problems.

Page 73: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 3.12: Example 2, transformation to the circle method, 6 = 1W2, N = 64

Figure 3.13: Example 2, transformation to the circle method, 6 = lo-*, N = 128

Page 74: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 3.14: Example 2, transformation to the circle method, c = N = 256

E'igure 3.13: Example 2: transformation to the circle method; E- = N = 128

Page 75: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELI&11XT4RY 'TRANSFORAM TO TEE CIRCLE

Figure 3.16: Example 2, transformation to the circle method, E = lo-', N = 256

Page 76: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELI121INARY TRANSFORM TO THE CIRCLE

Table 3.4: Example 2, transformation to the circle method, E =

N

32

64

96

128

Condition Number

9.2 xlO1

3.3 xlo2

6.5 x102

1.1 x l o 3

N

128

Table 3.6: Example 2, trmsformation to the circle method, E =

256

Average Error

2.10 x ~ o - ~

7.89 XIO-4

7.85 x l w 4

7.83 XIO-~

Condition Number

1.5 xlo6

Cpu-Time

0.91

3.2

7.18

12.87

3.7 xlo5

Average Error

0.21 x lo1

0.24 x10-I

Cpu-Time

12.78 ,

0.13 XIO-~ fl 343.65 512

Table 3.5: Example 2, transformation to the circle method, E =

1.2 xlo5

Page 77: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIMIRTARY TE4hTSFORM TO TIfE CIRCLE

Figure 3.17: Example 1, the pseudospectral method, N = 96, r = lo1*

S'O 1d0 160 Itaratf ons

Figure 3.18: Example 1, the pseudospectral method, IV = 96, E =

Page 78: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 3. PRELIMINARY TRANSFORM TO THE CIRCLE

Figure 3.19: Example 1, the circle technique, N = 96, E = lV4

Figure 3.20: Example I, the circle technique, N = 96, E = lo-*

0 0 0- d

0 0) (n m 0-

0 m 0, m 0-

0 PP I- & a 0 (n- & o & - r4 0

U) (n (n 0-

0

- -

In CII m 0

q 2 - o

20 Iterations I ~ O 190 I

Page 79: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Chapter 4

Chebyshev Collocation Met hod

4.1 Chebyshev Collocation Method

In this Chapter, we will consider the collocation method with Chebyshev polynomials to

solve two point boundary value pr,blems. This method is discussed by Boyd [5] and it is a

"nontraditionaln spectral method, in the sense that we formulate the problem in terms of

the (Chebyshev) expansion coefficients, but still use collocation. Usually these coefficients

are determined by a Galerkin approach. We will compare the collocation method with the

pseudospectral Chebyshev method discussed in Chapter 2. The pseudospectral Chebyshev

method has a feature that is very attractive for certain types of problems, but leads to dif-

ficulties with others. This feature is very high resolution near the boundaries. For example,

the collocation points for Chebyshev polynomial pseudospectral methods for prohlerns on

-1 5 x 1 are usually chosen such that sj = cos(rj/N) ( j = 0,1, - ., N). The collocation

points XI and XN-1 are within approximately 7r2/2N2 of the boundary points and z ~ ,

respectively, so that the boundary resolution is As = O(l/NZ).

This leads to extremely good resolution properties of spectrd metbods for touudary-

layer problems. While resolution of a problem with a boundary layer of thicknss t. < 1

would require O(l/ef uniformly spaced grid points, it requires only ~ ( l / r ' / ~ j terms in the

Page 80: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 4. CHEBYSHEV COLLOCATION METHOD 64

Chebyshev spectral series. Nonuniform grids could be used in many of these problems, as

they can be implemented fairly efficiently in spectral methods using coordinate transforma-

tion. We will consider linear two point boundary value problems of the form:

Using the Chebyshev collocation method, we seek a solution

where {Tk} is the Chebyshev polynomial of degree k on [-I, 11 define!

(4.1.2)

d by formula

Tk (cos 8) = cos(k0).

Clearly,

and, using elementary trigonometric id en ti tie^

T k + l ( ~ ) = 22Tk(2) - Tk -I(x) f OT k 2 1.

We introduce N + 1 suitable collocation points which are the extreme of the Chebyshev

polynomial of order N. i.e., x j = c o s ( ~ j / N ) for j = 0,1, .--, N. Then, the approximate

solution (4.1.2) must satisfy the ODE (4.1.1) and its boundary conditions at the collocation

points {zj}. Moreover, the f ~ ~ o w i n g three steps are done:

(1) Determination of N + 1 coefficients ak(k = 0,1, - . - , N), so that

and; (2) Evaluation of uf(xj) by

Page 81: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 4. CHEBYSHEV CBLLOCAT1UAT METHOD

Here, the collocation equations are

and substituting (4.1.3) (4.1.4) and (4.1.5) into the collocation equations, we have a linear

system for determining coefficients {ak)Fzo, i.e.,

We write it in matrix form

with

Chapter 2 indicates that the matrix A is a very U-condition matrix, Its condition aumber

is 0(N4). Some researchers consider a prwonditialliag scheme to solve this syt;tem(4.1,?)

[6]- However, we use Lipack subroutines (Gaussian elimination) to solve (4.1.7).

Page 82: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

4.2 Numerical Results

The method described in section 4.1 is applied to Example 2. Table 4.1 to Table 4.3 contain

the summaries of the related res-its.

/ N / Condition Number I Average Error / Cpu-Time i

Table 4.1: Example 2, Chebyshev collocation method, E =

Table 4.2: Example 2, Chebyshev collocation method, E =

N

96

Table 4.3: Example 2, Chebyshev collocation method, c =

Condition Number

6.1 x104

N

96

Average Error

1.27 xloO

Condition Nsmber

5.0 x104

Cpu-Time

4.59

Average Error

1-28 xlo0

Cpu-Time

4.29

Page 83: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

For the large parameter(€ = 10-~), the numerical results are gradually better with

increasing N. See Figure 4.1 to Figure 4-6 for N = 32, 641 96, 128. 256, 51'2 respectively.

For stiff problem, E = we first try N = 96 and N = 128, respectively. Figure 4.7

and Figure 4.8 show that there are large oscillations. A large N is needed to produce a fairly

good numerical solution, see Figure 4.9 and Figure 4.10 and Table 4.2.

For the very stiff problem f viz-, E = the method becomes difficult to solve it with

the large average errors. See Figrrre 4.10, Figure 4.11 Figure 9-12 and Table 4.3.

We compare the present method with pseudospectral Chebyshev method we studied in

Chapter 2. The Chebyshev collocation method for solving the non-stiff problem ( E =

is less efficient than the pseudospectral Chebyshev method. For the stiff problem 6 = lo-",

the Chebyshev collocation method can compete with the pseudospectral Chebyshev method.

For the very stiff problem ( E = 1W6), the Chebyshev collocation method is not quite as bad

as the pseudospectral Chebyshev method. It is interesting the oscillation that occurred in

the Chebyshev collocation method is still reasonable, while the oscillation that occurred in

the pseudospectral method is unacceptable in some sense. However, our bastsic conclusjon is

that the pseudospectral is better than the collocation approach. Also, the condition numbers

resulting from the collocation approach appear to be worse.

Page 84: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 4.1: Example 2, Chebyshev collocation method, E = 1W2, N = 32

Figure 4.2: Example 2? Chebyshei. collocation method, E = 10-5 ,N = 64

Page 85: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 4.3: Example 2: Chebyshev collocation method, E =.. N = 96

Fi,oure 4.4: Example 2: Chebyshev collocation method, r = loy2, rV =; 128

Page 86: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 4. CHEBYS%ZEV COLL0CATlO.X METHOD

Figure 4.3: Example 2, Chebyshev collocation method, E = N = 256

Figure 4.6: Example 2, Chebyshe5- collocation method, E = LY = 512

Page 87: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 4.7: Example 2, Chebyshev collocation method, c - N = 96

Figure 4.8: Example 2, Chebyshev collocation method, c- = l V 4 , hi = I 28

Page 88: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CRAPTER 4 . CHEBYSHEV COLLOCATION METHOD

Figure 4.9: Example 2, Chebyshev collocation method, E = lW4, N = 256

Figure -1.10: Example 2, Chebyshev collocation method, E = 1W6, 3 = 96

Page 89: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

CHAPTER 4. C H B YSHEF7 COLLOCATIOX ,h,ifETHOD

Figure 4.11: Example 2, Chebyshev collocation method, r = lom6, N = 128

Figure 4.12: Exampie 2, Chebyshev collocation method, E = TO-" N = 256

Page 90: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Chapter 5

Discussion

In this thesis we have studied three numerical methods for solving singularly perturbed

boundary value problems of order 2. The pseudospectral Chebyshev method was little

applied to solve singularly perturbed boundary value problems, therefore, three problems

have been chosen for our study-the first problem has a layer in the middle of the interval

[-I: I]; the second problem has two bomdary layers at x = -1 and z = 1; and the third

problem has one boundary layer at z = -1. 145th each problem and with each method, we

have considered three cases of singularity-mild ( E = stiff ( E = and very stiff

( 6 = Our attention in the study has been given to three areas: condition numbers,

average errors and cpu times.

The pseudospectral Chebyshev method was studied in Chapter 2. The numerical results

in this Chapter show that the conditioz number of the matrix related to the N-point pseu-

dospectral Chebyshev approximation is smaller than N*, but it depends on the singularity

paraneter E . ffl general: the s m d a the E , the larger the cmditim ownber.

For E = lom2 and E = the pseudospectrd Chebyshev method can be successfully

applied to solve the three singulasly perturbed BVPs, even though for E = a relatively

large 3' (X = 256 or 512) is needed to reach a fairly good solution. For E = lov6, the

pseudospectral Chebyshev method succeeds in solving the first problem. When applied to

Page 91: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

solve the second and the third problems, the method fails to produce cowergins solutions

for N as large as 512. The failure in these cases is most serious in the middle of the interval

[-l? 11: where the exact solutions are flat and smooth, while the numerical solutions have

large oscillations,

The method of transformation to the circle was studied in Chapter 3. By transforming

the problem defined on z E f-l, l] into an equivalent problem defined on the unit circle

through z = cos 4, this method proceeds to apply the Fourier spectral method. The numer-

ical results in this chapter also show that the condition number of the N-point approximation

increases as the the singularity parameter E decreases.

The numerical solutions produced with the method of transformation to the circle arc

of similar quality when compared with those of the numerical solutions produced with

the pseudospectral Chebyshev method. However, the transformation method does out-

perform the pseudospectral Chebyshev method for the mildly singularly perturbed problems

(E = low2). For the stiff (E = and very stiff ( 6 = lov6) problems, there is no

dominance in performance; sometimes the transformation method does better; sometimes

the pseudospectral Chebyshev method does better. We compare the condition number for

above two methods as shown in Table 5.1 to Table 5.6.

It is noticed that when E = both the pseudospectral Chebyshev method and the

transformation method failed to produce acceptable numerical solutions in all the case6

related to the second and the third examples, for N as large as 512. The failure is in

the middle of the interval [-I, 11, where large oscillations occur in the numerical solutions

even when N = 512. One possible reason for this failure is that there are always fewer

collocation points near x = 0 than near x = -1 and x = 1 in the above two methods. (For

the transformation method, thinlc in terms of the inverse transformation 4 = arccos(x), j

The two iterative methods; the conjugate gradient iteration applied to the normal eyua-

tions (CGNR) and the biorthogonalization algorithm adapted from the biconjugate gradient

iteration (CGS) were also studied in Chapter 3- We had hoped to see a good performame

Page 92: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

of these two iterative methods, but only the CGNR method converged.

Other effort has also been made to study the possibility of improving the quality of our

numerical solutions. For instance, in the study of the pseudospectral Chebyshev method,

we also tried to use Chebyshev polynomials to construct approximations (known as the

Chebyshev collocation method) in addition to the standard use of Lagrange polynomials.

The condition number appears to be worse.

Finally, we will briefly analyze the numerical errors. We consider the linear system

A s = b, then the relative error in z [lo] is

where f and 6 are the numerical results, i.e. AZ = 6. Thus, the relative error in x can be

the condition number k2(A) times the relative error in A and b. In this sense, the condition

number ka(A) quantifies the sensitivity of the Az = b problem. On the other hand, by a

singular d u e decomposition (SVD) analysis, the SVD of A is

where U = (u1,u2,+-=,a,), V = (v1,v2,..-,vn) and C = diag(al,o2:..-,on) with UI 2

a2 > . . 2 a,, > 0. Then

The absolute error in x is

n

6b = b - 6 = C fiBiui (where ~i = i=l

Page 93: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Here we assume that every component in 6 has the same relative error

Therefore, we have

The relative errors in x and b have the same order,

We have plotted the singular vectors versus Chebyshev points for Example 1 (with

E = 1 V 2 and N = 96) as shown in Figure 5.1 to Figure 5.6. The behaviour of the singular

values and the coefficients {b;) of the equation (5.1) are shown in Figure 5.7 and Figure

5.8. Based on our numerical experiments, we can see that the numerical solutions are

accurate despite the large condition numbers. This needs to be contrasted with the worst

case scenario, namely that b = blul and 6b = ,Gnu.,, i.e. the right hand side is the direction

of the singular vector associated with the largest singular value GI, but the perturbatio~l is

only in the direction of 21, associated with the smallest singular vdue a,. Our investigation

shows that the singular vectors associated with large singular values are highly oscillatory,

whereas the ones associated with small 0;s are smooth. This is expeckd since A describes

a differentiation process. Sow, although the right hand side of our BVPs may be smooth,

the boundary conditions areincorporated ia the vector b, making it a nonsmooth vector (at

least for problems which generate interior or boundary layers), as is illustrated by Figure

5.8. However, the full effect of the large condition number kz(A) = a1 /a, could only he felt,

if the perturbation in b were very smooth [associated with the small sir~gvlar K&PS), wfiicli

Page 94: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

is extremely unlikely for perturbation generated by finite precision arithmetic. Thus it is

plausible that (5.2j holds. This also explains why the transformation to the circle, although

decreasing the condition numbers, does not promote higher accuracy.

Page 95: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

N / Direct Method I Circle Techniaue

Table 5.1: Example 1, the condition number for two methods, E - 1W2

Table 5.2: Example 1, the condition number for two methods, E = lo-"

K

1 32

Table 5.3: Example 1, the condition number for two methods, E = lo-"

Direct Method

4.5 x 104

1 ?j Direct Method Circle Technique

32 1

Circle Technique

3.2 x103

Circle Technique

5'3 x105

6.3 x105

5.8 x105

5.3 x l o 5

PI' / Direct Method

Table 5.4: Example 2: the condition number for two methods, c =

32

64

5.8 xlo6

1.2 x107

1.8 x107

128 2.4 x l o7

Page 96: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Table 5.6: Example 2, the condition number for two methods, E =

3

Figure 5.1: Example 1: singular vector (al) versus Chebyshev points, E = lo-*, N = 96

Direct Method Circle Technique

1.5 x106

3.7 x l o 5

1.2 x l 0 "

128

256

Table 5.5: Example 2, the condition number for two methods, E =

3.3 xlo4

I 2.5 x105

512 ] 3.9 x106

Page 97: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 5.2: Example 1, singular vector (uz) versus Chebyshev points, c = lo-" N = 96

Figure 5.3: Example 1; singular vector (a3) versus Chebyshev points, E = 1W2, M = 96

Page 98: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 5.4: Example 1, singular vector (ag3) versus Chebyshev points, E = loe2, N = 96

Figure 5.5: Exmple l2 singular vector (2694) versus Chebyshev points, t = 10-'; N = 96

Page 99: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 5.6: ExampIe 1, sinDnlar vector (uS5) versus Chebyshev points, E = N = 96

Figure 5.7: Example 1, singular d u e s E = N = 96

Page 100: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Figure 5.8: Example 1, coefficients ( b i } of the equation (5.1) t- = lop2, N = 96

Page 101: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

Bibliography

[I] Ascher, U. M., R. M. %Iti. Mattheij, R. M. M. and Russell, R. D., Numerical Solution

of Boundary Value Problems for Ordinary Diflerential Equations, Prentice-Hid Inc.,

[2] Atkinson, K. E., A Survey of Nurne~cal Meihods for the Solution of Fkdholm Integral

Equations of the Second h-ind, Society for Industrial and Applied Mathematics. 1976.

[3] Becker, R. A., Chambers, J. M. and Wilks, A. R., The New S Language: A Pro-

gramming Eizuironment for Data ilnalysis and Graphics, Wadsworth & Brooks/Cole

Advanced Books & Software, Pacific Grove, California, 1988.

[q Berrut, J. P., A Pseudospectral Chebyshev Method with Preliminary Transform to the

Circle: 0. D. E., Manuscript, 1990.

[5] Boyd, J. P., Chebyshev d Fourier Spectml Methods, Lecture Notes in Enginerring, 49,

Brebbia, C . A. and Orszag, S. -4. ed., Springer-Verlag, 1989.

[6] Canuto, C . and Quarteroni, A., Preconditioned Minimal Residul Methods for Cheby-

shev Spectral Calculations, J. Cornput. Phys., 60, 315-337, 1985.

[7] Dongaria, J. J., M&r, C. B. and B-mch, J. R., Stewart, G . W., Linpack users' Guide,

SLAM Philadelphia, 1979.

Page 102: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

[8f Funaso, D.: -4 Preconditioning Matrk for The Chebyshev Differencing Operator,SI.4 :\I

J. Xurner. Ana1.,24, 1024-1031, 19E7.

[9] Funaro, D., Some Results about the Spectrum of ChebysBev Differencing Operator, in

the proceedings ccrf the International Symposium of iV'unzefienl Analysis (Madrid, Sept.

1985).

[lo] Golub, G. H. and Vaxi Loan, C . F., hl'atriz Computations, second edition, The Johns

Hopkins Universty Press, Baltimore and London, 1989.

[ l l ] Greengard, L., Spectral Integration and Two - Point Boundary Value, SIAM J, Nurner,

Anal., 28, 1071-1080,1991.

[12] Gottlieb, D., Hussaini, M. T., and Orszag, S. A., Theory and Applications of Spectral

Methods, Report No. 83-66, 1983.

1131 Gutknecht, M. H., Variants of BICGSTAB for Matrices with Cornplx Spectrum, 1PS

Research report No. 91-14, ETH-Zentrum CH-8092 Zurich, 1991.

1141 Hussaini, M. Y., and Zag, T. A.: Iterative Spectral Method and Spectral Solution to

Compressible Flows, Spectml Methods for Partial Diflerential Equations (R. Voigt, I).

Gottlieb, Y. Hussaini Eds.), SLAM, Philadelphia, 1984.

[15] Gottlieb, D., and Orszag, S. A., i\iurnen'cul Analysis of Spectml Methods: Theory and

Applications, CBMS regional Conferance Series in Applied Math., 26, SlAM Philadel-

phia, 1977.

[16] Wachtigal, N, M., Reddy, S. C., and Trefethen, L. N., How Fast Are 3onsymmetric

Ma~ri-x Iterztions?, Mmmcript, Massach1wetts TI.stitcte of Technology, Carclbridge,

1991.

[17] Orszag, S. A., Spectral Methods for Problems in Complex Geometries, J. Corr~put.

Page 103: Pseudospectral Chebyshev method for two-point boundary value problems / by Yunyun Liu

BIBLIOGRAPHY 8 7

[IF] Prenter, P, 34.; Splines and Variational Methods, John Wiley & Sons, Kew York, 1975.

[I91 Smith, R. C., Bogar, G. A., Bower, K. L., and Lund, J.: The Sinc-Galerlkin Method for

Fourth-Order Differantid Equations, SIAM J. Numer. Anal., 28, 760-788, 1991.

[20! Sonrreveld, P.: CGS, A Fast Lanczos - Type Solver for Xonsymmetric Linear Systems,

SlAM ,J. Sci. Stat. Comp., 10, 36-52, 1989,

[21] Don, W. S. and Solomonoff, A., Accuracy and Speed in Computing the Chebyshev Col-

location Derivative, Division of Applied Mathematics, Brown University, Providence,

1991.

f221 Yamasaki, A*, iWew Preconditioaers Based o n Low-Rmk Elimination, Numerical Anal-

ysis Report 89 - 10, Massachusetts Institute of Technology, Cambrige, 1989.

[23] Wight, K., Chebyshev Collocation methods for Ordinary Differential Equations, J.

[24] Huang, W., and Sloan, D. M., A New Pseudospectral Method with Upwind Features.

Manuscript, 1992.