Nonstandard Finite Difference Models of Differential Equations 9810214588, 9789810214586

This book provides a clear summary of the work of the author on the construction of nonstandard finite difference scheme

662 83 37MB

English Pages 262 [264] Year 1993

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Nonstandard Finite Difference Models of Differential Equations
 9810214588, 9789810214586

Table of contents :
Dedication
Preface
Table of Contents
1. Introduction
2. Numerical Instabilities
3. Nonstandard Finite-Difference Schemes
4. First-Order ODE’s
5. Second-Order, Nonlinear Oscillator Equations
6. Two First-Order, Coupled Ordinary Differential Equations
7. Partial Differential Equations
8. Schrödinger Differential Equations
9. Summary and Discussion
Appendix A: Difference Equations
Appendix B: Linear Stability Analysis
Appendix C: Discrete WKB Method
Bibliography
Index

Citation preview

NONSTANDARD FINITE DIFFERENCE MODELS OF DIFFERENTIAL EQUATIONS

This page is intentially left black

NONSTANDARD FINITE DIFFERENCE MODELS OF DIFFERENTIAL EQUATIONS Ronald E. Mickens

Callaway Professor of Physics Clark Atlanta University

World Scientific wb

Singapore • New Jersey • London • Hong Kong

Published by World Scientific Publishing C o . Pte. Ltd. P O Box 128, Farrer Road, Singapore 9128 USA office: Suite I B , 1060 M a i n Street, River Edge, N J 07661 UK office: 73 Lynton Mead, Totteridge, London N20 8 D H

Library of Congress Cataloging-in-Publication Data Mickens, Ronald E . , 1943Nonstandard finite difference models of differential equations / Ronald E . Mickens. p.

cm.

Includes bibliographical references and index. I S B N 9810214588 1. Finite differences. solutions.

2. Differential equations ~ Numerical

I. Title.

QA431.M428

1994

515\624~dc20

93-37665 CIP

Copyright © 1994 by World Scientific Publishing C o . Pte. Ltd. All rights reserved. This book, or parts thereof, may not be reproduced in any form orby any means, electronic or mechanical, including photocopying, recording or any information storage and retrieval system now known or to be invented, without written permission from the Publisher.

For photocopying of material in this volume, please pay a copying fee through the Copyright Clearance Center, Inc., 27 Congress Street, Salem, M A 01970, U S A .

Printed i n Singapore b y J B W Printers & Binders Pte. L t d .

This book is dedicated to my wife Maria, my son James W i l l i a m s o n , my daughter Leah maria.

This page is intentially left black

vii Preface This book was written i n response to a large number of requests for copies of the author's papers on nonstandard finite difference schemes for the numerical integration of differential equations. The book provides a general summary of the methods used for the construction of such schemes. T h e major goal is to show that discrete (finite-difference) models exist for which the elementary types of numerical instabilities do not occur. T h e guiding philosophy behind this work is to get the qualitative details correct while not being overly concerned, at this level of the analysis, w i t h the quantitative numerical results. (In any case, for most applications, the values of the various step-sizes are generally determined by the physical scales of the particular phenomena being studied.) The theoretical basis of our nonstandard discrete modeling methods is centered at the concepts of "exact" and "best" finite difference schemes. A set of rules is presented for constructing nonstandard finite difference schemes.

T h e application of these rules often leads to an "essentially"

unique finite difference model for a particular differential equation. It is expected that additional rules and restrictions will be discovered as research proceeds i n this area. A n important feature of this book is the illustration of the various discrete modeling principles by their application to a large number of b o t h ordinary and partial differential equations. The background requirements needed to fully understand the text are satisfied by the knowledge acquired i n an introductory course on the numerical integration of differential equations.

I thank my many colleagues for their interest i n my work. A g a i n , I am particularly grateful to M s . Annette Rohrs for typing the complete manuscript. B o t h she and M a r i a Mickens provided valuable editorial assistance. Finally, I thank the National Aeronautics and Space A d m i n i s t r a t i o n for providing funds that allowed me to do research on nonstandard finite difference schemes. R o n a l d E . Mickens A t l a n t a , Georgia August 1993

This page is intentially left black

ix Table of Contents 1. Introduction 1.1 Numerical Integration

1 1

1.2 Standard Finite-Difference Modeling Rules

2

1.3 Examples

4

1.4 Critique

13

References

14

2. Numerical Instabilities

17

2.1 Introduction

17

2.2 Decay E q u a t i o n

IS

2.3 Harmonic Oscillator

29

2.4 Logistic Differential Equation

35

2.5 Unidirectional Wave Equation

51

2.6 Burgers' E q u a t i o n

58

2.7 Summary

60

References 3. Nonstandard Finite-Difference Schemes

65 68

3.1 Introduction

68

3.2 Exact Finite-Difference Schemes

70

3.3 Examples of Exact Schemes

72

3.4 Nonstandard Modeling Rules

81

3.5 Best Finite-Difference Schemes

85

References 4. F i r s t - O r d e r O D E ' s

90 93

4.1 Introduction

93

4.2 A New Finite-Difference Scheme

94

4.3 Examples 4.4 Nonstandard Schemes

98 106

4.5 Discussion

115

References

119

X 5. Second-Order, Nonlinear Oscillator Equations 5.1 Introduction

120 120

5.2 M a t h e m a t i c a l Preliminaries

122

5.3 Conservative Oscillators

124

5.4 L i m i t - C y c l e Oscillators

132

5.5 General Oscillator Equations

137

5.6 Response of a Linear System References 6. T w o F i r s t - O r d e r , Coupled Ordinary Differential Equations

138 141 144

6.1 Introduction

144

6.2 Background

146

6.3 Exact Scheme for Linear Ordinary Differential Equations

147

6.4 Nonlinear Equations

150

6.5 Examples

151

6.6 Summary

162

References

163

7. P a r t i a l Differential Equations

165

7.1 Introduction

165

7.2 Wave Equations

166

7.3 Diffusion Equations

173

7.4 Burgers' T y p e Equations

182

7.5 Discussion

188

References

189

8. Schrodinger Differential Equations 8.1 Introduction

193 193

8.2 Schrodinger Ordinary Differential Equations

194

8.3 Schrodinger P a r t i a l Differential Equations

198

References 9. Summary and Discussion

213 217

9.1 Resume

217

9.2 Nonstandard Modeling Rules Revisited

219

9.3 T w o Examples

223

9.4 Future Directions

229

References

230

xi A p p e n d i x A : Difference Equations

232

A p p e n d i x B : Linear Stability Analysis

236

Appendix C: Discrete W K B M e t h o d

239

Bibliography

241

Index

247

This page is intentially left black

1 Chapter 1 INTRODUCTION

1.1 N u m e r i c a l Integration In general, a given linear or nonlinear differential equation does not have a complete solution that can be expressed i n terms of a finite number of elementaryfunctions [1-4].

A first attack on this situation is to seek approximate analytic

solutions by means of various perturbation methods [5-7]. However, such procedures only hold for limited ranges of the (dimensionless) system parameters a n d / o r the independent variables. For arbitrary values of the system parameters, at the present time, only numerical integration techniques can provide accurate numerical solutions to the original differential equations of interest. A major difficulty w i t h numerical techniques is that a separate calculation must be formulated for each particular set of initial a n d / o r boundary values. Consequently, obtaining a global picture of the general solution to the differential equations often requires a great deal of computation and time. However, for many problems currently being investigated i n science and technology, there exist no alternatives to numerical integration. T h e process of numerical integration is the replacement of a set of differential equations, both of whose independent and dependent variables are continuous, by a model for which these variables may be discrete. In general, i n the model the independent variables have a one-to-one correspondence w i t h the integers, while the dependent variables can take real values. O u r major concern i n this book will be the use of a particular technique for constructing discrete models of differential equations, namely, the use of finite-difference methods [8-13]. N o other procedures w i l l be considered. A n important fact often overlooked i n the formulation of discrete models of differential equations is that numerical integration methods should always be constructed w i t h the help of the knowledge gained from the study of special solutions of

2 the differential equations. F o r example, if the differential equations have a constant solution w i t h a particular stability property, the discrete model should also have this constant solution w i t h exactly the same stability property [12, 13, 14]. We w i l l consider this issue i n considerable detail i n Chapters 2 and 3. 1.2 S t a n d a r d F i n i t e - D i f f e r e n c e M o d e l i n g R u l e s To illustrate the construction of discrete finite-difference models of differential equations, we begin w i t h the scalar ordinary equation

| where f(y)

= /(y),

d.2.1)

is, i n general, a nonlinear function of y. F o r a uniform lattice, w i t h

step-size, At = h, we replace the independent variable t by t-+t

k

(1.2.2)

= hk,

where h is an integer, i.e., t 6 {...,-2,-1,0,1,2,3,...}.

(1.2.3)

T h e dependent variable y(i) is replaced by y(t) -

Vk,

where yt is the approximation of y(ijfc). Likewise, the function f(y) f(y) where

(1-2.4) is replaced by

/*,

(1.2.5)

is the approximation to /[«/( 0. For example, the following three equations correspond to using a centered discrete second-order derivative, a centered linear term, and, respectively, forward Euler, backward Euler and centered representations for the discrete firstorder derivative: y*+i 1

"

-

2

^

+

yfc

-

+ Vk = 0,

+ & ( ^ ± ^ )

1

y*+i - 2y* + yk i + 2 6 ^ " ^ h

1

) + y

f

c

= Q,

y

k

=

(1.3.34)

(1.3.35)

2

y*+i - 2yjtt + w - i h

+

^ y t + i - y * - ^

+

Q

( 1

3

3 6 )

2

A l l of these models axe second-order and linear; however, they clearly have different constant coefficients which implies that they have different solutions.

10 1.3.4 Unidirectional Wave Equation A linear equation that describes waves propagating along the z-axis with unit velocity is the unidirectional wave equation (1.3.37)

«« + « j = 0, where u = u(x,t) and

du u = —. dx

du

x

(1.3.38)

Denote the discrete space and time variables by (Ax)m,

(1.3.39)

ke {...,-2,-1,0,1,2,3,...},

(1.3.40)

m e {...,-2,-1,0,1,2,3,...}.

(1.3.41)

x=

tk = (At)fc,

m

where

Thus, the discrete approximation to u(x,t) is (1.3.42)

u(x,t) -* u , k

m

and the corresponding discrete first-derivatives are [8, 12] At

du

'

(1.3.43)

At m —

_m

I.

2At

'

and Ax

du

" m - « m - l Ax

dx k

'

(1.3.44)

2Ax

Various discrete models can be co nstructed by selecting a particular representation for the discrete time-derivative and a second particular representation for the discrete space-derivative. The following four cases illustrate this procedure.

11 (i) Forward Euler time-derivative and forward Euler space-derivative: +

Ax

m +

*

"

Ax

= 0;

m

(1.3.45)

(ii) forward Euler time-derivative and backward Euler space-derivative: k um - l = 0; Ax

At

(1.3.46)

(iii) forward Euler time-derivative and central difference space-derivative: „k u

v



.

k

_

k m - l m -l

m+1

U

At

mti

U

2Ax

=

Q

'

(1.3.47) v

;

(iv) an implicit scheme w i t h forward Euler for the time-derivative and backward Euler for the space-derivative: ^rn

_m

At

Ax

m-l

=

Q

(1.3.48) v

J

Clearly, a number of other discrete models can be easily constructed. A l l of the above equations are linear partial difference equations w i t h constant coefficients (for fixed At and Ax).

T h e models of Eqs. (1.3.45), (1.3.46) and (1.3.48)

are of first-order i n b o t h the discrete time and space variables. E q u a t i o n (1.3.47) is first-order i n the discrete time variable, but, is of second-order i n the discrete space variable. A g a i n , by inspection all four models are different and thus w i l l give different numerical solutions to the original partial differential equation. 1.3.5

Diffusion E q u a t i o n The simple linear diffusion partial differential equation, i n dimensionless form,

is u = u t

X I

,

u = u(x,t).

(1.3.49)

T h e standard explicit form for this equation is given by the expression

A*

(Ax)

2

(1.3.50)

12 while the standard implicit form is ,.k+l ,.k+l u u

k+i __ j.H-1

,.k ,.k

m

u u

u

m _ m

Ai

U

m + l m+1

22

u

tM + -il ,, *k+l +i u

uu

UU

"

511 ff l1 33 511

+ m m -- ll +

m ** m

U

(AT)

'

2



' '

;

W h i l e b o t h of these equations are linear, partial difference equations that are firstorder i n the discrete time and second-order i n the discrete space variables, they are not identical and consequently their solutions w i l l give different numerical solutions to the diffusion equation. 1.3.6 B u r g e r s ' E q u a t i o n T h e inviscid Burgers' partial differential equation is [13] u uu u , ++ u u = 0, t

(1.3.52)

u = u(x,t).

xx

T h e following four equations are examples of discrete models that can be constructed for E q . (1.3.52) using the standard finite-difference rules. (i) Forward E u l e r for the time-derivative and forward E u l e r for the space-derivative: s £

^+-i( 4r )-* :

("»)

i

(ii) forward E u l e r for the time-derivative and implicit forward E u l e r for the spacederivative: V

S

+

" "

Ax

=

°

;

( 1

- " 3

5 4 )

(iii) central difference schemes for both the time- and space-derivatives:

^

^

« ^ ( % ^ ) - 0

+

;

(1.3.55,

(iv) forward E u l e r for the time-derivative and backward E u l e r for the space-derivative: = =

^ ^

+ «» iS , . ( ( ?=^^^^) )=- 00 ..

+

(1.3.56) ,1.3.56)

13 Note that i n the limits k -* oo,

A * —• 0,

t = t =

TYI —• oo,

A x —> 0,

x

k

k

= x =

fixed,

(1.3.57)

fixed,

(1.3.58)

all of these difference schemes reduce to the inviscid Burgers' equation. However, inspection shows that for finite At and A x these four partial difference equations are not identical. T h i s fact leads to the conclusion that they w i l l give numerical solutions that differ from each other. 1.4 C r i t i q u e T h e major result coming from the analysis of the previous two sections is the ambiguity of the modeling process for the construction of discrete

finite-difference

models of differential equations. The use of the standard rules does not lead to a unique discrete model.

Consequently, one of the questions before us is which, if

any, of the standard finite-difference schemes should be used to obtain numerical solutions for a particular differential equation?

Another very important issue is

the relationship between the solutions to a given discrete model and that of the corresponding differential equation. A s indicated i n Section 1.3, this connection may be tenuous. T h i s and related matters lead to the study of numerical instabilities which is the subject of Chapter 2. Once a discrete model is selected, the calculation of a numerical solution requires the choice of a time a n d / o r space step-size. How should this be done? For problems i n the sciences and engineering, the value of the step-sizes must be determined such that the physical phenomena of interest can be resolved on the scale of the computational grid or lattice [12-14]. However, suppose one is interested i n the long-time or asymptotic-in-space behavior of the solution; can the step-sizes be taken as large as one wishes?

14 T h e general issue can be summarized as follows: Consider the scalar differential equation of E q . (1.2.1). Select a finite-difference scheme to numerically integrate this equation. A t the grid point t — t*, denote by y(tk) the solution to the differential equation and by yk(h) the solution to the discrete model. (Note that the numerical solution is written i n such a way as to indicate that its value depends on the stepi size, h.) W h a t is the relationship between y(t^) and y*(/i)? In particular, how does this relationship change as h varies? Numerical instabilities exist i n the numerical solutions whenever the qualitative properties of yk(h)

differ from those of y(tffc). One of the tasks of this book w i l l

be to eliminate the elementary numerical instabilities that can arise i n the finitedifference models of differential equations. O u r general goal w i l l be the construction of discrete models whose solutions have the saijie qualitative properties as that of the corresponding differential equation for all steplsizes. We have not entirely succeeded i n this effort, but, progress has definitely beeii made. A final comment should be made on the issue of chaos and differential equations. In the past several decades, much effort has been devoted to the study of "mathematical chaos" as it occurs i n the solutions of deterministic systems modeled by coupled differential equations [17-19]. Experimentally, chaotic-like behavior has been measured i n fluid phenomena [19, 20], chemical reactions [21], nonlinear electrical a n d mechanical oscillations [22, 23] and i n biomedical systems [24]. In this book, we do not address these issues. O u r task is to formulate discrete

finite-difference

models of differential equations that have numerical solutions which reflect accurately the underlying mathematical structures of the solutions to the differential equations. References 1. S. L . Ross, Differential

Equations (Blaisdell; W a l t h a m , M A ; 1964).

2. M . H u m i and W . M i l l e r , Second Course in Ordinary Differential Scientists and Engineers (Springer-Verlag, New Y o r k , 1988).

Equations

for

15 3. D . Zwillinger, Handbook of Differential 1989).

Equations

(Academic Press, Boston,

4. D . Zwillinger, Handbook of Integration (Jones and Bartlett, Boston, 1992). 5. C . M . Bender and S. A . Orszag, Advanced Mathematical and Engineers ( M c G r a w - H i l l , New York, 1978). 6. R . E . Mickens, Nonlinear 1981).

Oscillations

Scientists

(Cambridge University Press, New Y o r k ,

7. J . Kevorkian and J . D . Cole, Perturbation (Springer-Verlag, New York, 1981). 8. F . B . Hildebrand, Finite-Difference Englewood Cliffs, N J ; 1968).

Methods for

Equations

Methods in Applied

and Simulations

9. M . K . J a i n , Numerical Solution of Differential Equations W i l e y and Sons, New York, 2nd edition, 1984).

Mathematics

(Prentice-Hall;

(Halsted P r e s s / J o h n

10. J . M . Ortega and W . G . Poole, J r . , An Introduction to Numerical Differential Equations ( P i t m a n ; Marshfield, M A ; 1981).

Methods for

11. J . C . Butcher, The Numerical Analysis of Ordinary Differential Equations: Runge-Kutta and General Linear Methods (Wiley-Interscience, New York, 1987). 12. D . Greenspan and V . Casulli, Numerical Analysis for Applied Mathematics, Science and Engineering (Addison-Wesley; Redwood City, C A ; 1988). 13. M . B . A l l e n III, I. Herrera and G . F . Pinder, Numerical and Engineering (Wiley-Interscience, New York, 1988). 14. D . Potter, Computational

Modeling in Science

Physics (Wiley-Interscience, New York, 1973).

15. J . Marsden and A . Weinstein, Calculus I (Springer-Verlag, New Y o r k , 1984); section 1.3. 16. R . E . Mickens, Difference Equations: Theory and Applications Reinhold, New York, 2nd edition, 1990). 17. S. Wiggins, Introduction to Applied Nonlinear (Springer-Verlag, New York, 1990).

Dynamical

(Van Nostrand

Systems and Chaos

16 18. R . L . Devaney, An Introduction to Chaotic Cummings; M e n l o P a r k , C A ; 1986).

Dynamical

Systems ( B e n j a m i n /

19. H a o B a i - L i n , editor, Chaos ( W o r l d Scientific, Singapore, 1984). 20. G . L . Baker and J . P . G o l l u b , Chaotic Dynamics (Cambridge University Press, New Y o r k , 1990). 21. S. K . Scott, Chemical 22. F . C . M o o n , Chaotic

Chaos (Clarendon ^ress, Oxford, 1991). Vibrations (Wiley-Interscience, New Y o r k , 1987).

23. J . M . T . T h o m p s o n and H . B . Stewart, Nonlinear Dynamics New Y o r k , 1986). 24. B . J . West, Fractal Physiology gapore, 1990).

and Chaot in Medicine

and Chaos (Wiley,

( W o r l d Scientific, Sin-

17 Chapter 2 N U M E R I C A L INSTABILITIES

2.1 Introduction A discrete model of a differential equation is said to have numerical instabilities if there exist solutions to the finite-difference equations that do not correspond qualitatively to any of the possible solutions of the differential equation. It is doubtful if a precise definition can ever be stated for the general concept of numerical instabilities. T h i s is because it is always possible, i n principle, for new forms of numerical instabilities to arise when new nonlinear differential equations are discretely m o d eled. T h e concept, as we w i l l use it i n this book, will be made clearer i n the material to be discussed i n this Chapter. Numerical instabilities are an indication that the discrete equations are not able to model the correct mathematical properties of the solutions to the differential equations of interest. The fundamental reason for the existence of numerical instabilities is that the discrete models of differential equations have a larger parameter space t h a n the corresponding differential equations. T h i s can be easily demonstrated by the following argument. Assume that a given dynamic system is described i n terms of the differential equation §

= /(*/, A)

(2.1.1)

where A denotes the n-dimensional parameter vector that defines the system.

A

discrete model for E q . (2.1.1) takes the form y*+i =F(y ,\,h) k

where h — At is the time step-size.

(2.1.2)

Note that the function F contains (n + 1)

parameters; this is because h can now be regarded as an additional parameter. T h e solutions to Eqs. (2.1.1) and (2.1.2) can be written, respectively as y(£, A) and y*(A, h). E v e n if y(tf, A) and y (X,h) k

are "close" to each other for a particular value

18 of h, say h = h\. If h is changed to a new value, say h = hi, the possibility exists that yk(X,h ) 2

differs greatly from y*(A, Z^) both qualitatively and quantitatively.

T h e detailed study of what actually occurs relies on the use of bifurcation theory [1, 2, 3]. T h e purpose of this Chapter is to consider a number of differential equations, construct several discrete models of them, i n d compare the properties of the solutions to the difference equations to the corresponding properties of the original differential equations. A n y discrepancies foijnd are indications of numerical instabilities.

We end the Chapter w i t h a sumniary and discussion of the elementary

numerical instabilities. 2.2 Decay E q u a t i o n T h e decay differential equation is §

=

(2.2..)

E v e n if we d i d not know how to solve this equation exactly, its general solution behavior could be obtained by knowledge of the fact that for y > 0, the derivative is negative, while for y < 0, the derivative is positive. A l s o , y = 0 is a solution of the differential equation. Consequently, a l l solutions have the forms as shown i n Figure 2.2.1(b). For the i n i t i a l condition

y ( M = 2/0,

(2.2.2)

the exact general solution is V(t) = 2 / o e - - * . (
k

'

y(t)

(b)

Figure 2.2.1. The decay equation, (a) Regions where the derivative has a consant sign, (b) Typical trajectories.

20 where h = At is the step-size. It can be rewritten to the form = (1 - h)y ,

y

k+1

(2.2.5)

k

which shows i t to be a first-order, linear difference equation w i t h constant

coeffi-

cients. Its solution is Vk = Vo(l - h) .

(2.2.6)

k

Note that the behavior of the solution depends on the value of r(h) = 1 — h which is plotted i n Figure 2.2.2. Referring to Figure 2.2.3, the following conclusions are reached: (i) If 0 < h < 1, then y decreases monotonically to zero. k

(ii) If h — 1, then for k > 1, the solution is identically zero. (iii) If 1 < h < 2, yjt decreases to zero w i t h an oscillating (change i n sign) amplitude. (iv) If h = 2, then y oscillates w i t h a constant amplitude. T h e solution has periodk

two. (v) If h > 2, t/fc oscillates w i t h an exponentially increasing amplitude. Note that i t is only for cases (i) and (ii) that we obtain a y t that has the same qualitative behavior as the actual solution to the decay equation, namely, a monotonic decrease to zero. Quantitative agreement between y(t) a n d y c a n be gotten k

by choosing h small, i.e., 0 < h •< 1. The solution behaviors exhibited, i n particular, by Figures 2.2.3(c), (d) a n d (e), we call numerical instabilities. We now consider a forward Euler scheme w i t h a symmetric form for the linear term; it is given by the expression ^Vk+i + y*^

Vk+i - Vk _

^

n

7

^

Solving for yk+i gives S , t + 1

=

(

2

+

fe) J/t

( 2

- - > 2

8

21

>k

r(h)

1 X.

1 h

-1

Figure 2.2.2. Plot of r(h) = 1 - h.

22

02

24 Again, this is a first-order, linear difference equation with constant coefficients. Its solution behavior is dependent on the value of

K>0=f^,

(2-2.9)

which is plotted in Figure 2.2.4. Since |r(A)| < 1,

0 < h< oo,

(2.2.10)

it follows that all solutions of Eq. (2.2.8) =

Vk

decrease to zero with k —> oo.

(2.2.11)

y [r(h)] , 0

k

However, only for 0 < h < 2 is the decrease

monotonic. If h > 2, the solution is oscillatory with an amplitude that decreases exponentially. See Figure 2.2.5. The hackward Euler scheme for the decay equation is V k

fc

yt

~

1

= -y*.

(2.2.12)

or =

Vk+i

(2-2.13)

Since 0 < — ^ - r < 1, 1+ h

0 < h< oo,

(2.2.14)

it follows that all the solutions of Eq. (2.2.13), i.e.,

decrease (in magnitude) to zero monotonically for any step-size. The central difference scheme is

2 h

=

Vk-

(2.2.16)

25

A

^

r(h)

^

^

s

^

^

^

^

>

-1

Figure 2.2.4. Plot of r(h) =

2+n

.

26

A y

k

0 0; (d) central difference: no value of h. F r o m these results, we conclude that the central difference scheme has numerical instabilities for all step-size values; the forward Euler schemes provide useful discrete models i f limitations are placed o n the step-size; a n d the backward Euler scheme can be used for any (positive) step-size. Except for the central difference scheme, the other three discrete models will give excellent quantitative numerical solutions if h is made small enough, i.e., 0 < h 2.

(2.3.18)

Figure 2.3.1 gives the behavior of r+(/i) and r _ ( / i ) as a function of h. T h u s , for this case y = [ A K W I * + D \r.(h)\ ) k

and we conclude that

(-1)*,

k

3

(2.3.19)

w i l l increase exponentially w i t h an oscillating amplitude.

P u t t i n g all these results together, we observe that the straightforward central difference scheme has a solution w i t h the same qualitative behavior as the harmonic oscillator differential equation only if the step-size is restricted to the interval 0 < h

^ r(h)

:

-1

Figure 2.3.1. Plots of r (ii) and r.(h) from +

Eqs. (2.3.15a) and (2.3.15b); h = h - 2.

>•

33 The characteristic equation for E q . (2.3.20) is r - 2 r + ( l + ft ) = 0,

(2.3.22)

r+(ft) = [r_(ft)]* = 1 + ih.

(2.3.23)

2

2

w i t h solutions

These can also be rewritten i n the polar form r+(ft) = y/l + h eM \ 2

(2.3.24)

h

(2.3.25)

t 0 and that they have magnitudes that are greater than one. A s a consequence, all the solutions of this discrete model are oscillatory, but, they have an amplitude that increases exponentially. Likewise, the characteristic equation for E q . (2.3.21) is

^i^MiT*)- 0

(2

-" 3

26)

Its solutions are again complex valued for all ft > 0; they are r (A) = M

W

+

= ^

= ^

e



(2.3.27)

where (h) is given by the relation of E q . (2.3.25). Therefore, we conclude that, for ft > 0, a l l the solutions of E q . (2.3.21) are oscillatory w i t h an amplitude that decreases exponentially. We now examine the properties of a central difference scheme having a symmetric form for the linear term y. For the first example, we consider the following discrete model y*+i ~ 2yfc + yk-i ft 2

+

yn-i + yk-i 2

=

Q

^23 28)

34 Its characteristic equation is 2

r

.1 + h*

r + 1 = 0,

(2.3.29)

2

with roots r±(h)

=

1 1+ M

l> T

Note that

2

(2.3.30)

J

r+(h) = [r_ (h)]',

h>0,

(2.3.31)

|r+(h)| =Mfc)| = l;

(2.3.32)

= r*_ = e

(2.3.33)

consequently, i,Kh)

,

•4 + T

tan 4>(h) = Since

E(r ) +

Vk =

+

(2.3.34)

E*(r* ) ,

k

+

(2.3.35)

k

where E is an arbitrary complex-valued constant, we conclude that all solutions to this discrete model oscillate with constant amplitude for h > 0. The second example has a completely symmetric discrete expression for the linear term; it is y/t+i - 2y + yk-i h k

2

, Vk+i +Vk+ 2/Jt-i = 0. 3

i

(2.3.36)

The corresponding characteristic equation is r -2 2

6

1

1+*i

r + 1 = 0,

(2.3.37)

with the roots r±(h)

=

1 1+

{(

*I

fc \ 2

u 1

T)W

/ 1 +

/i l I2J2

(2.3.38)

35 These roots have the following properties:

r (h) +

=

/ i > 0,

[r_(ft)]«,

|r+(/i)| = | r _ ( A ) | = l , r ( f c ) = [r_(fc)]» +

(2.3.39)

h>0,

(2.3.40)



(2-3.41)

=

tan 0(h) =

W e c o n c l u d e t h a t , f o r / i > 0, a l l s o l u t i o n s o f E q . ( 2 . 3 . 3 6 ) a r e o s c i l l a t o r y w i t h c o n s t a n t amplitude. I n s u m m a r y , w e h a v e seen t h a t o n l y t h e use o f a d i s c r e t e r e p r e s e n t a t i o n

for

t h e l i n e a r y t e r m t h a t is c e n t e r e d a b o u t t h e g r i d p o i n t f t w i l l g i v e a d i s c r e t e m o d e l that has oscillations w i t h constant

amplitude.

Non-centered

a m p l i t u d e of the oscillations to either increase or decrease.

schemes allow

the

The straightforward

c e n t r a l difference s c h e m e h a s t h e c o r r e c t o s c i l l a t o r y b e h a v i o r i f 0 < h < 2, w h i l e t h e t w o " s y m m e t r i c " f o r m s for y give o s c i l l a t o r y b e h a v i o r w i t h c o n s t a n t

amplitude

f o r a l l h > 0.

2.4 Logistic Differential

Equation

T h e L o g i s t i c d i f f e r e n t i a l e q u a t i o n is

f

= y(i-y).

(2-4.1)

Its exact s o l u t i o n c a n be o b t a i n e d by the m e t h o d of s e p a r a t i o n of variables w h i c h gives y{t)

=

° yo + (1 - y )e M

n

(2-4.2)

y

0

1

w h e r e t h e i n i t i a l c o n d i t i o n is yo = 2/(0).

(2.4.3)

36 Figure 2.4.1 illustrates the general nature of the various solution behaviors.

If

j/o > 0, then a l l solutions monotonically approach the stable fixed-point at y(t) = 1. If j/o < 0, then the solution at first decreases to - c o at the singular point t = t* = L n

ri+ii/oii

(2.4.4)

M

after which, for t > **, it decreases monotonically to the fixed-point at y(t) = 1. Note that y(t) = 0 is an unstable

fixed-point.

O u r first discrete model is constructed by using a central difference scheme for the derivative: y

k

+

1

2 h

k

~

l

=

y

k

i

~

l

y

k

)

-

(

2

A

5

)

Since E q . (2.4.5) is a second-order difference equation, while E q . (2.4.1) is a firstorder differential equation, the value of y\ = y(h) must be determined by some procedure. We do this by use of the Euler result [7, 8, 9] Vi = yo + hy (l

- y ). 0

0

(2.4.6)

A typical plot of the numerical solution to E q . (2.4.5) is shown i n Figure 2.4.2. T h i s type of plot is obtained for any value of the step-size. A n understanding of this result follows from a linear stability analysis of the two fixed points of E q . (2.4.5). First of a l l , note that E q . (2.4.5) has two constant solutions or

fixed-points.

T h e y are Vk = y

( 0 )

=0,

yM = 1.

y= k

(2.4.7)

To investigate the stability of y* = y(°\ we set y* = y

( 0 )

M < 1 ,

+6*,

(2.4.8)

substitute this result into E q . (2.4.5) and neglect a l l but the linear terms. Doing this gives 2

*

^



.

C O ,

A

37

y(0

Figure 2.4.1. Solutions of the logistic differential equation. (a)yg>0. (D)VQ

=

yo (l-yo°)(l +

+

^

-

(

2

A

3

7

)

E x a m i n a t i o n o f E q . ( 2 . 4 . 3 7 ) s h o w s t h a t , f o r h > 0, i t s q u a l i t a t i v e p r o p e r t i e s a r e t h e s a m e as t h e c o r r e s p o n d i n g e x a c t s o l u t i o n t o t h e L o g i s t i c d i f f e r e n t i a l e q u a t i o n , n a m e l y , E q . (2.4.2).

Hence, the forward Euler, nonlocal discrete model has

no

n u m e r i c a l i n s t a b i l i t i e s f o r a n y s t e p - s i z e . F i g u r e 2.4.5 g i v e s n u m e r i c a l s o l u t i o n s u s i n g

47

y

k

L

y =0.5 h = 0.01

2

Q

l.l1 ft1 .u

0.90.80.70.6ft

^

U.J

) (

200

400

600

800

10 00 k

(a)

y

k

1

2

y =0.5 h = 1.5 Q

1.11.00.90.8-

f iI

0.70.6W.J 1

5

0

10

15

20

25

30 k

(b)

Figure 2.4.5. Numerical solutions of y

k

+

r

y

k

h "V'W-

(a) y = 0.5, h = 0.01. (b) y =0.5, h =1.5. Q

()

48

k (c)

Figure 2.4.5. Numerical solutions of Y

k+

l" k y

— (c) y

n

s

n

y

x

k V k l^ (

y

= 0.5, h = 2.5.

+

49 E q . (2.4.31) for three step-sizes. Note that E q . (2.4.31) can be written i n explicit form y t + 1

=

TThyV'

( 2 A 3 8 )

O u r last discrete model for the Logistic differential equation is based on a second-order R u n g e - K u t t a method [8, 9]. T h i s technique gives for the

first-order

scalar equation (2.4.39) the discrete result y*+i ~ Vk _ f(yk) ft

+ f[yk + 2

hf(y )]

(2.4.40)

k

A p p l y i n g this to the Logistic equation, where / ( y ) = y ( l — y), gives

2/H-i =

1 +

(2 + ft)ft

(2 + 3ft + ft )ft 2

Vk

yl + (l +

T h i s first-order, nonlinear difference equation has four

41)

h)h yl 2

fixed-points.

T h e y are lo-

cated at y(0)

y ' ( 2

3 )

T h e first two fixed-points, y^

=

Q )

-(1)

= (^)[(2 +

=

^

(

A

A

2

)

(2.4.43)

^ ) ± x ^ i ] .

and y^\ correspond to the two fixed-points of the

Logistic differential equation. T h e other two fixed-points, y^ fixed-points

2

and y^,

are spurious

and are introduced by the second-order R u n g e - K u t t a method.

that for ft < 2, the fixed-points y^

and y^

Note

are complex conjugates of each other;

while for ft > 2, a l l fixed-points are real. Figure 2.4.6 gives a plot of a l l the fixedpoints as a function of the step-size ft. For 0 < ft < 2, there are only two real y^ ) = 1. 1

fixed-points,

namely, y^

= 0 and

T h e first is linearly unstable and the second is linearly stable. A l l

numerical solutions of E q . (2.4.41), w i t h yo > 0? thus approach However, for ft > 2, there exists four real

fixed-points.

as k —• oo.

T h e i r order and linear

50

A .y

y

y (0)= 0

I

(

3

)

( 2 )

(h)

( h ) ^ \

,

^

2

> h

Figure 2.4.6. Plot of the fixed-points of the 2nd-order Runge-Kulta method for the logistic differential equation. Only the spurious fixed-points depend on h.

51 stability properties are indicated below where U and 5 , respectively, mean linearly unstable and linearly stable: y < y^(h) U

S


_ ! = 0.

m

(2.5.23)

m

These difference equations have the solutions C

k

D

(2.5.24)

= A(()C

k

= B i ( C ) M / ? , C)]* + S (C)[r_(/3, Q] ,

m

2

(2.5.25)

k

where r+(/?, Q and r_(/3, £) are roots to the characteristic equation [7] I3r + (C - l ) r - /9 = 0.

(2.5.26)

2

Therefore, u*,G8,0 = {F (C)[r (/?,C)] + ^ 2 ( C ) K ( / 3 , 0 ] C * , 1

+

m

m

(2.5.27)

and a general solution is «»(/») = ^

u

m ( ^ . 0 ¥> 9(*m - 0, the fixed-point y(t) = y ^ is linearly unstable. (ii) If Ri < 0, the fixed-point y(t) =

is linearly stable.

Now construct a central difference discrete model for Eq. (2.7.1), i.e., 2fe

•* ^ '~

=

yk

(2.7.5)

For small perturbations, e^, about the fixed-point y('\ we have W =y

( i )

+ e*.

(2-7.6)

If Eq. (2.7.6) is substituted into Eq. (2.7.5) and only linear terms are kept, then we obtain e t + 1

~

f t

-

1

= Rie . k

(2.7.7)

A n examination of the characteristic equation for Eq. (2.7.7) r - (2hRi)r - 1 = 0 2

(2.7.8)

shows that one root is always larger than one in magnitude. In fact, r± = hRi ± yJl + h R?. 2

(2.7.9)

Since, e =A(r ) +B(r_) , k

+

k

k

(2.7.10)

where A and B are arbitrary, but small constants, we must conclude that the fixedpoint at yjt = y(') is linearly unstable. However, if Ri < 0, then the corresponding fixed-point of the differential equation is stable. Therefore, the use of the central

63 difference scheme of E q . (2.7.5) leads to a discrete m o d e l of E q . (2.7.1) for w h i c h a l l t h e f i x e d - p o i n t s are l i n e a r l y u n s t a b l e .

T h i s means that the central

s c h e m e h a s n u m e r i c a l i n s t a b i l i t i e s f o r a l l h > 0.

difference

A s stated previously, the m a i n

r e a s o n f o r t h e o c c u r r e n c e o f n u m e r i c a l i n s t a b i l i t i e s i n t h i s case is t h a t t h e o r d e r o f t h e f i n i t e - d i f f e r e n c e e q u a t i o n i s l a r g e r t h a n t h e o r d e r of t h e c o r r e s p o n d i n g d i f f e r e n t i a l equation. L e t us n o w i n v e s t i g a t e t h e l i n e a r s t a b i l i t y p r o p e r t i e s o f t h e f i x e d - p o i n t s f o r t h e f o r w a r d E u l e r s c h e m e f o r E q . ( 2 . 7 . 1 ) . It is g i v e n b y t h e f o l l o w i n g e x p r e s s i o n

y

k

+

1

~

y

k

= f(y ). k

(2.7.11)

A p e r t u r b a t i o n o f t h e i-th. f i x e d - p o i n t , as g i v e n b y E q . ( 2 . 7 . 6 ) , l e a d s t o t h e p e r t u r bation equation t

k

+

= Ritk,

(2.7.12)

= (1 + hRi)e ,

(2.7.13)

~

X

t k

or e

k+1

k

w h i c h has the s o l u t i o n e

k

= £„(1 + hRi) .

(2.7.14)

k

D e t a i l e d s t u d y of E q . (2.7.14) gives the f o l l o w i n g results: (i) F o r Ri > 0, t h e f i x e d - p o i n t

is l i n e a r l y u n s t a b l e f o r b o t h t h e d i f f e r e n t i a l E q .

(2.7.1) a n d t h e difference E q . (2.7.11) for h > 0. ( i i ) F o r Ri < 0, w h i c h c o r r e s p o n d s t o a l i n e a r l y s t a b l e f i x e d - p o i n t f o r t h e d i f f e r e n t i a l E q . ( 2 . 7 . 1 ) , t h e f i x e d - p o i n t of t h e d i s c r e t e m o d e l , n a m e l y E q . ( 2 . 7 . 1 1 ) , h a s t h e properties: 2 0 < h < -pjr-r, \Ri\ 2 h > -—-, y \Ri\

Vk —

k

is l i n e a r l y stable;

= y * ' is l i n e a r l y u n s t a b l e . 1

64 Consequently, we conclude that the forward Euler scheme a n d the differential equation w i l l have corresponding fixed-points w i t h the same linear stability properties only i f there is a limitation o n the step-size h, i.e., 0 < h< h* = - J ^ ,

(2.7.15)

R* =Max{|fl;|;j' = 1,2,...,/}.

(2.7.16)

where

Numerical instabilities will occur whenever h > h*. T h i s type of numerical instability w i l l be called a threshold instability. Note that for the central difference scheme h* = 0, i.e., numerical instabilities occur for a l l h > 0. The

previous two finite-difference methods were explicit schemes.

W e now

investigate the properties of an implicit discrete model for E q . (2.7.1), the backward E u l e r scheme. It is given by the expression

V

k

+

1

~

V k

= /(y* ). + 1

(2.7.17)

For small perturbations about the fixed-point at j / * = y('\ the equation for e/t is

e

k

+

1

~

e

k

=R

i e t + 1

,

(2.7.18)

or

™=(i-h*h>

e

which has the solution e

*-*G-U)-

(2 7 i9)

-(2

-7

2o)

Inspection of E q . (2.7.20) leads to the following conclusions: (i) For Ri < 0, the fixed-point of E q . (2.7.17) is linearly stable for a l l h > 0. T h u s , the stability properties of the finite-difference scheme a n d the differential equation are the same.

65 (ii) For Ri > 0, the finite-difference scheme is linearly unstable for 0 < h < -J-,

(2.7.21)

h >

(2.7.22)

but, is linearly stable for Ri

Note that for h>l,

R = Um{\Ri\;i

(2.7.23)

= 1,2,..., I},

all the fixed-points of this implicit scheme are linearly stable. T h i s phenomena is called super-stability by Dahlquist et al. [27] and has been investigated by Lorenz [28], Dieci and Estep [29], and Corless et a l . [24].

T h i s phenomena is of great

interest since, for systems of ordinary differential equations, there exist discrete models that produce solutions that are not chaotic even though the differential equations themselves are known to have chaotic behavior. T h i s result is the " n a t u r a l complement of computational chaos" (Corless et a l . [24]) or numerical instabilities that can arise when certain finite-difference schemes are used to construct discrete models of ordinary differential equations. Above, we have shown that super-stability can also occur i n the backward Euler scheme for a single scalar equation. T h e next chapter w i l l be devoted to the study of nonstandard

finite-difference

schemes and how they can be used to eliminate the elementary forms of numerical instabilities as shown to exist i n the present chapter. References 1. G . Iooss, Bifurcation 1979).

of Maps and Applications

(North-Holland, Amsterdam,

2. V . A r n o l d , Geometrical Methods in the Theory of Ordinary Differential tions (Springer-Verlag, New York, 1983). 3. G . Iooss and M . Adelmeyer, Topics in Bifurcation (World Scientific, Singapore, 1992).

Theory and

Equa-

Applications

66 4. F . B . Hilderbrand, Finite-Difference Englewood Cliffs, N J ; 1968).

Equations and Simulations

5. V . D . Barger and M . G . Olsson, Classical Mechanics: ( M c G r a w - H i l l , New Y o r k , 1973). 6. R . E . Mickens, Nonlinear 1981).

Oscillations

7. R. E . Mickens, Difference Equations: Reinhold, New Y o r k , 1990). 8. M . K . J a i n , Numerical 2nd edition, 1984).

Solution

(Prentice-Hall;

A Modern

Perspective

(Cambridge University Press, New Y o r k ,

Theory and Applications

of Differential

9. J . M . Ortega and W . G . Poole, J r . , Numerical tions ( P i t m a n ; Mashfield, M A ; 1981).

Equations

( V a n Nostrand

(Wiley, New Y o r k ,

Methods for Differential

Equa-

10. M . Y a m a g u t i and S. U s h i k i , Physica 3 D , 618-626 (1981). Chaos i n numerical analysis of ordinary differential equations. 11. S. U s h i k i , Physica 4 D , 407-424 (1982). Central difference scheme and chaos. 12. J . M . Sanz-Serna, SI AM Journal of Scientific and Statistical Computing 6, 923-938 (1985). Studies i n numerical nonlinear instability I. W h y do leapfrog schemes go unstable? 13. R . E . Mickens, Dynamic Systems and Applications 1, 329-340 (1992). F i n i t e difference schemes having the correct linear stability properties for a l l finite . step-sizes II. 14. R . M . M a y , Nature 2 6 1 , 459-467 (1976). Simple mathematical models w i t h very complicated dynamics. 15. P. Collet and J . - P . E c k m a n n , Iterated Maps of the Interval as Dynamical tems (Birkhauser, Boston, 1980). 16. T . L i and J . Yorke, American Period-3 implies chaos.

Mathematical

17. R . L . Devaney, An Introduction to Chaotic Cummings; M e n l o Park, C A ; 1986).

Sys-

Monthly

8 2 , 985-992 (1975).

Dynamical

Systems ( B e n j a m i n /

67 18. G . B . W h i t h a m , Linear and Nonlinear 1974).

Waves (Wiley-Interscience, New Y o r k ,

19. J . M . Burgers, Advanced in Applied Mechanics 1, 171-199 (1948). A mathematical model illustrating the theory of turbulence. 20. R . E . Mickens, Difference equation models of differential equations having zero local truncation errors, i n Differential Equations, I. W . Knowles and R . T . Lewis, editors (North-Holland, A m s t e r d a m , 1984), pp. 445-449. 21. R. E . Mickens, M a t h e m a t i c a l modeling of differential equations by difference equations, i n Computational Acoustics: Wave Propagation, D . Lee et al., editors (Elsevier Science Publications B . V . , A m s t e r d a m , 1988), pp. 387-393. 22. R . E . Mickens, Numerical Methods for Partial Differential Equations 5, 313¬ 325 (1989). Exact solutions to a finite-difference model for a nonlinear reactionadvection equation: Implications for numerical analysis. 23. R. E . Mickens, R u n g e - K u t t a schemes and numerical instabilities: The Logistic equation, i n Differential Equations and Mathematical Physics, I. Knowles and Y . Saito, editors (Springer-Verlag, Berlin, 1987), pp. 337-341. 24. R . M . Corless, C. Essex and M . A . H . Nerenberg, Physics Letters A 1 5 7 , 27-36 (1991). Numerical methods can suppress chaos. 25. A . Iserles, A . T . Peplow and A . M . Stuart, SI AM Journal of Numerical Analysis 28, 1723-1751 (1991). A unified approach to spurious solutions introduced by time discretization. Part I: Basic theory. 26. M . Sever, Ordinary 101-103.

Differential

Equations

(Boole Press, D u b l i n , 1987), pp.

27. G . Dahlquist, L . Edsberg, G . Skollermo, and G . Soderlind, A r e the numerical methods and software satisfactory for chemical kinetics, i n Numerical Integration of Differential Equations and Large Linear Systems, J . Hinze, editor (Springer-Verlag, B e r l i n , 1982), pp. 149-164. 28. E . N . Lorentz, Physica D 3 5 , 299-317 (1989). C o m p u t a t i o n a l chaos — A preclude to computational instability. 29. L . Dieci and D . Estep, Georgia Institute of Technology, Tech. Rep. M a t h . 050290-039 (1990). Some stability aspects of schemes for the adaptive integration of stiff initial value problems.

68 Chapter 3 NONSTANDARD FINITE-DIFFERENCE

SCHEMES

3.1 I n t r o d u c t i o n T h i s chapter provides background information to understand the general rules of Mickens [1] for the construction of nonstandard finite-difference schemes for differential equations. F i r s t , the concept of an exact difference scheme is introduced and defined. Second, a theorem is stated and proved that a l l ordinary differential equations have a unique exact difference scheme.

T h e major consequence of this

result is that such schemes do not allow numerical instabilities to occur.

Third,

using this theorem, exact difference schemes are constructed for a variety of both ordinary and partial differential equations.

F r o m these results are formulated a

set of modeling rules for the construction of nonstandard

finite-difference

schemes.

F o u r t h , the notion of best difference schemes is defined and its use i n the actual construction of finite-difference schemes is illustrated by several examples. Before proceeding, we would like to make several comments related to the discrete modeling of the scalar ordinary differential equation §

= /(y,A),

(3.i.i)

where A is an n-parameter vector. T h e most general finite-difference model for E q . (3.1.1) that is of first-order i n the discrete derivative takes the following form yj^

=

F{yk

,y X,h). k+u

(3.1.2)

T h e discrete derivative, on the left-side, is a generalization [2] of that which is normally used, namely [3], dy dt

yt+i - Vk h

,„ -

( 3

1 > 3 )

69 Prom E q . (3.1.2), we have

dy where the denominator function

y*+i - yk

(3.1.4)

(h,X) has the property [2]

(h,\) = h + A=

fixed,

0(h ), 2

h —> 0.

(3.1.5)

This form for the discrete derivative is based on the traditional definition of the derivative which can be generalized as follows: dy_ dt

Lim

y[t +

Mh))-y(t)

(3.1.6)

h-+o

where /i->0;

il> (h) = h + 0(h ), 2

i

t = l,2.

(3.1.7)

Examples of functions ^(h) that satisfy this condition are h, sin(ft), e -1, l-e- . h

h

l-e~

Xh

A etc.

'

Note that i n taking the L i m h —> 0 to obtain the derivative, the use of any of these i>(h) w i l l lead to the usual result for the first derivative _dy _ y[t + i>i(h)]-y(t) dt h-+o xl> (h) L

i

m

2

=

L

.

y(t + h) h^o h m

y

(t)

(3.1.8)

However, for h finite, these discrete derivatives will differ greatly from those conventionally given i n the literature, such as E q . (3.1.3). This fact not only allows for the construction of a larger class of finite-difference models, but also provides for more ambiguity i n the modeling process.

70 3.2 E x a c t F i n i t e - D i f f e r e n c e

Schemes

We consider only first-order, scalar ordinary differential equations i n this section. However, the results can be easily generalized to coupled systems of first-order ordinary differential equations. It should be acknowledged that the early work of Potts [4] played a fundamental role i n interesting the author i n the concept of exact finite-difference schemes. Consider the general first-order differential equation -£ = /(y,t,A),

y(to) = yo,

(3.2.1)

where / ( y , t , A ) is such that E q . (3.2.1) has a unique solution over the interval, 0 < t < T [5, 6] and for A i n the interval A i < A < A . (For dynamical systems of 2

interest, i n general, T = oo, i.e., the solution exists for a l l time.) T h i s solution can be written as y(t) = 0 ( A , y , < » O »

(3.2.2)

^(A,yo,*o, to) = y .

(3.2.3)

o

o

with 0

Now consider a discrete model of E q . (3.2.1) y*+i = y(A,fe,y*,tjb),

t

k

=

hk.

(3.2.4)

Its solution can be expressed i n the form Vk = 0(A,ft,y , - ,y< >] « « - « . ) + g) 2

0-3.36)

[vP + ivP] [y> + iy< >] - * - > . 2

e

e

(3.3.37)

M a k i n g the substitutions of E q . (3.3.24) gives

Finally, eliminating y

k

yi'l,

= cos(/ )yi

yfl,

= sin(ft)yi

l

1)

1)

+ sin(%< ,

(3.3.38)

+ cos(%< .

(3.3.39)

2 )

2 )

gives the expression . . 4 sin" (§) 2

+

= 0,

(3.3.40)

which is the exact finite-difference scheme for the harmonic oscillator. Note that i f h -> u>fc, then E q . (3.3.40) becomes E q . (3.3.17). W i t h o u t giving the details, we now present several other ordinary differential equations and their exact discrete models [11]: 2 § + y= i at y

(3.3.41a)

78 y/b+i - yk 1 - e~

vl

(3.3.41b)

h

± dt

d

= 9

-y\ '

(3.3.42a)

2y*+i

y*+i - yk

.y*+i + y* dy

_

dy

dt

~

dt'

2

2

Vk+Wk',

(3.3.42b)

(3.3.43a)

Vk+i -- 2y + y * - i _ , (yk fc

V

-Vk-\\ h )'

(3.3.43b)

A l l of the above examples of exact finite-difference schemes have been obtained for ordinary differential equations. We now turn to an example of a partial differential equation for which an exact discrete model exists. Consider the nonlinear reaction-advection equation u + u t

= u(l -

x

u),

(3.3.44)

w i t h the initial value u(x,0)

=/(*),

(3.3.45)

where / ( z ) is bounded w i t h a bounded derivative. T h e nonlinear transformation [1] u(x,t)

=

w(x, t)

(3.3.46)

reduces E q . (3.3.44) to the linear equation w + w t

x

= 1 — w.

(3.3.47)

T h e general solution of this equation can be easily determined by standard methods [8]. It is w(x,t) = g{x - t > ~ ' + 1,

(3.3.48)

79 where g(z) is an arbitrary function of z having a bounded first derivative.

Imposing

the initial condition of E q . (3.3.45) allows g to be calculated, i.e., 9{*) + 1 =

(3-3.49)

or ,(*)

= ^

.

(3-3.50)

Using this result w i t h Eqs. (3.3.46) and (3.3.48), we can obtain the solution to Eqs. (3.3.44) and (3.3.45); it is given by the expression

^

;

/

)

/

(

,

-

«

)





.

To proceed, we first construct the exact finite-difference

( 3

- 3

5 i )

scheme for the unidi-

rectional wave equation u + u = 0. t

x

(3.3.52)

xme general soiuuon o i inis equation is [oj u(x,t) • H{x — t),

(3.3.53)

where H is an arbitrary function. Now the partial difference equatic

u

u

m

— m-l

(3.3.54)

has as its general solution an arbitrary function of (m — k) [10], i.e., u

k m

= F(m

-

k).

(3.3.55)

If we impose the condition A x = A0.

2

(3.3.58)

The general solution of Eq. (3.3.57), which is formally equivalent to Eq. (3.3.54), is u

k m

= Fi [h(m - k)} =

(h = Ax = At) (3.3.59)

F (x -t ), 1

m

k

where Fi is an arbitrary function of its argument. Thus, the exact finite-difference scheme for the unidirectional wave equation is Eq. (3.3.57). We can use this result to calculate the exact difference scheme for Eq. (3.3.44). Solving Eq. (3.3.51) for f ix - t) gives f

(

x

t

)

(3.3.60)

'«(*,*)

e

=

>

A

l-(l-e->(i,t)

Now make the following substitutions in the last equation ' x -* x

m

= (Ai)m,

t -»t

= (At)k,

k

Ax = At = h,

(3.3.61)

• «0M)-» m, u

f{x-t)-,f[h(m-k)}

=

fl

Doing this gives

—hk..k

p

/ i ^ - d - e - ^ u i , -

( 3

- 3

6 2 )

However, from Eqs. (3.3.54) and (3.3.55), we know that f£, satisfies the following partial difference equation fk+l

_

fk

(3.3.63)

Therefore, we have e-«*+i>u*+'

e-»uJS,_

1 - [1 - c - * ( * + » ] t t * ,

+ 1

"

_

1

1 - (1 - e - " ) ! ! * , . ! "

(3.3.64)

After some algebraic manipulations, this expression becomes u

m e

+

1

- " m

* t _ i

. 1

U

m - « m - l _

e

A l

-l

~

t

/,

Jt+1 x m

>'

(3.3.65a)

81 (3.3.65b)

At = Ax.

Discrete models of the nonlinear reaction-advection equation using the standard rules do not have the structure of Eqs. (3.3.65). For example, a particular standard model is t-Li A*

^

k +

m

* +

LAx

(3.3.66)

=u (l-u ).

m

k

m

k

m

3.4 N o n s t a n d a r d M o d e l i n g R u l e s Let us now examine i n detail the results obtained i n the previous section. In particular, we concentrate on the exact

finite-difference

schemes for the general

Logistic ordinary differential equation and the nonlinear, reaction-advection partial differential equation. These are given, respectively, by Eqs. (3.3.27) and (3.3.30), and (3.3.44) and (3.3.65). T h e following observations are important: (i) E x a c t

finite-difference

schemes generally require that nonlinear terms be

modeled nonlocally. Thus, for the Logistic equation the y

2

term is evaluated at two

different grid points y -> y*+iy*.

(3.4.1)

2

Similarly, the u

2

term for the nonlinear, reaction-advection equation is modeled by

the expression «

2

- ^ - i « 4

+

1

-

(3-4.2)

T h i s corresponds to u being evaluated at two different lattice space-points and two 2

different lattice time-points. Note that Lim y*+iy* = Lim y\ = y(t), h-+0 h^O k—*oo hk=t=fixed hk=t=fixed A:—•oo

(3.4.3)

82 and

Lim

At-»0 Ai->0 k—*oo m —>oo (Ax)m=a:=fixed (At)Jt=t=fixed

uS,_i«5. = + 1

Lim

(u ) h m

Ai-tO A k + 1 changes the right-side of E q . (3.5.14) into the expression on the left-side. T h i s means that, independent of the value of fc, each side of E q . (3.5.14) is equal to the same constant. Consequently, the discrete model of the Duffing equation, given by E q . (3.5.10), has the following associated conservation law

G)

iVk+1

~ .+ (i)«Wiy* Vk)2

+ (tyvl+iVl

= «*»tant.

(3.5.15)

T h i s is to be compared to the energy relation of the differential equation as expressed by E q . (3.5.3).

88 A n ambiguity i n the above modeling process is that the denominator function V> is not uniquely specified. A t this level of analysis, any function that obeys the relation given by E q . (3.5.11) works. Finally, it should be indicated that Potts [19] has also investigated various nonstandard

finite-difference

approximations to the

unforced, undamped Duffing differential equation. For our second example of the construction of a best

finite-difference

scheme,

we consider the nonlinear diffusion equation [11] (3.5.16)

u = uu . t

xx

N o known exact solution exists for the general initial-value problem for this equation. However, a special rational solution is known. To obtain i t , write u(x,i)

in

the form u(x,i)

= C[t)D{x).

(3.5.17)

= CDCD"

(3.5.18)

Substitution into E q . (3.5.16) gives CD and ^

= £>"(*) = a,

where a is the separation constant.

(3.5.19)

Integrating these differential equations gives

the solutions C(t)=—?—, OL\ — at D{x)

=

(

f

)

(3.5.20)

*

2

(

3

-

6

-

2

1

)

where ( a i , / ? i , / 3 ) are arbitrary integration constants. Therefore, E q . (3.5.16) has 2

the following special rational solution „(,,,>= (f>''+ft'+ft, a i — at

( 3

. . 5

2 2 )

89 A nonstandard explicit finite-difference model for E q . (3.5.16) is u

.1

k

— 2u

(Ax)

At

+ u

k

,

k

(3.5.23)

2

where the orders of the discrete derivatives are the same as the derivatives of the partial differential equation. A l s o , the nonlinear term, uu

is modeled nonlocally

XXl

on the lattice, i.e., one term is at time-step k and the other is at k + 1. Since we know a special solution of the original partial differential equation, we must require that any best finite difference scheme also have this as a solution. T o see whether this is the case for the model of E q . (3.5.23), let us calculate a special solution by assuming that

has the form (3.5.24)

u =C D . k

k

m

m

Substitution of E q . (3.5.24) into E q . (3.5.23) gives (C*

+ 1

- C )D At k

m

k+i k

=

c

c

£>m+l — 2D + (As) m

D

.Djn-l

2

and

2>

C +*-C k

k

(At)C ^C k

m + 1

-20

+ i> -i= m

T O

(Ax)

k

2

a,

(3.5.25)

(3.5.26)

where a is the separation constant. T h e two difference equations _ k c

D +! m

- 2D

m

=

a

(Ar)C*

+

+ 1

C*,

(3.5.27)

= a(Ax) , 2

(3.5.28)

have solutions that can be put i n the forms [10] 1 ai -

D

rn

=

at '

(3.5.29)

k

( ^ P m + A ^ + A ,

(3.5.30)

90 where t = (At)k,

x

k

and ( = l ,

y

(2

i l i = 1,

(

3

)

Ri = Rs = - 2 ,

= - l ,

(4.3.13)

R" = 2.

(4.3.14)

U s i n g {z) f r o m E q . ( 4 . 3 . 4 ) , w e o b t a i n , o n s u b s t i t u t i o n o f t h e s e r e s u l t s i n t o E q . (4.2.5), t h e f o l l o w i n g discrete m o d e l for E q . (4.3.11)

*

V

+

=

1

y*(l -

(4.3.15)

y ). 2 k

F i g u r e 4.3.2 g i v e s t h e g e n e r a l b e h a v i o r o f t h e s o l u t i o n s f o r v a r i o u s i n i t i a l v a l u e s , y(0) = y . 0

T h e ( ± ) sign denotes the regions where the derivative has a constant

sign; at t h e f i x e d - p o i n t , t h e d e r i v a t i v e m u s t b e zero. a p p r o a c h t h e s t a b l e f i x e d - p o i n t a t y< > =

1.

2

approach the other stable fixed-point at y

( 3 )

For y

0

>

0, a l l s o l u t i o n s

L i k e w i s e , for y

0




^ y(t) (-)

y(2)

=

1

(+)

w

y(D=0

t

y(3)--l

^

(-)

(+)

Figure 4.3.2. General solution behavior for Eq. (4.3.11).

104 y

k

1.1 1.0 /

0.9

h = 0.01

0.8 0.7 0.6 0.5 0

l

l

1

200

400

600

1

l

800 1000 k

(a) V y

k

1.1 1.0

I

0.9

h = 0.75

0.8 0.7 j

0.6 0.5

f

i

0

5

i

10

i

I

I

l

15

20

25

30 k

(b)

Figure 4.3.3. Plots of Eq. (4.3.15 ). For each graph y = 0.5, (a) h = 0.01. (b) h = 0.75. Q

105 V

y

k

1 1 1.1

/

1.0 -

/

0.9 -

h = 1.5

0.8 0.7 0.6U.J

1

1

1

0

1

5

10

I

1

15

20

1

1

25

30 V

(c) 1 1

V

y i.i k

/

1.0 -

/

0.90.8 0.7 -

h=

2.5

I

I

1

15

20

/

/

0.6 I

U.J

0

5

10 (d)

Figure 4.3.3. Plots of Eq. (4.3.15). For each graph y = 0.5, (c) 0

h=

1.5, (d) h = 2.5.

k

106 Perturbations about the three

fixed-points

Vk = \ 0 + e

(4.3.17)

k

give the following linear stability equations

e*+i lk+i F r o m E q . (4.3.18), it follows that the fixed-points at y^

— 1, y^

(1 +

h)e

k

(1-2%*.

(4.3.18) (4.3.19)

— 0 is linearly unstable for a l l h > 0. However, = — 1, have the following linear stability properties:

(i) For 0 < h < 0.5, both fixed-points are linearly stable. (ii) For 0.5 < h < 1, b o t h fixed-points are linearly stable; however, the perturbations decrease to zero w i t h an oscillating amplitude. (iii) For h > 1, the two-fixed-points are linearly unstable. T h e results given i n Figure 4.3.4 are numerical solutions obtained from the forward Euler scheme of E q . (4.3.16). For each, the initial condition is y(0) = yo = 0.5 and the respective step-sizes are h = (0.01,0.75,1.5,2.0). Note that the graphs are fully consistent w i t h the above linear stability analysis. T h e results of this section can be summarized i n the statement that the new finite-difference

scheme of E q . (4.2.5) provides superior discrete models of the three

differential equations studied as compared to the use of the standard forward Euler scheme. 4.4 N o n s t a n d a r d S c h e m e s Chapter 3 provided a set of nonstandard modeling rules. We now apply them to two of the differential equations examined i n the last section. T h e new modeling rule, to be added to the results of Section 4.2, is the requirement that nonlinear terms be modeled nonlocally on the computational grid.

107

11 1.

X

1.0¬ /

0.9 -

h = 0.01

0.8 0.7 0.6 -

U.J

1

i 200

0

i 400

I 600

I 800

i 1000

(a) y

k

1 1 1.1

1.00.9 -

r

|

h = 0.75

0.8 0.7 -

I

0.6 -

U.J

1

0

l 5

l 10

l

15

l 20

l

1

25

30 k

(b) Figure4.3.4. Plots of Eq. (4.3.16 ). Foreach graph y = 0.5, (a) h = 0.01, (b) h = 0.75. Q

108 1 A y

k

1.4

-

h=

1.5

A 1 k 1 11 I1 1

fM A AAA A V 1 1 1

1.2-

1

1.00.80.6-

I

0.4-

0.2 H ()

i 5

i 10

i 15

i 20

i 25

(c)

30 1

1 c

1J

-

1

h

= 2.0

i

1.00.5 0.0-0.5 -1.0-1.5

1 1D

l

5

10

l 15

(d) Figure 4.3.4. Plots of Eq. (4.3.16). For each graph y = 0.5, (c) h = 1.5, (d) h = 2.0. 0

20 1c

109 4.4.1 L o g i s t i c E q u a t i o n T h e discrete scheme for t h e L o g i s t i c differential e q u a t i o n , w i t h a n o n l o c a l n o n linear t e r m , is

y

f^

(4.4.1)

= Vk(i-y ). k+1

T h i s d i f f e r e n c e e q u a t i o n c a n b e s o l v e d e x a c t l y b y u s e o f t h e t r a n s f o r m a t i o n [10] 1 —• w

Vk =

(4-4.2)

k

T h i s gives (

u>k+i -

1

\

{2-e-»)

Wk

1-e-* 2-e-»>

=

(44.3)

w h o s e e x a c t s o l u t i o n i s [10] = 1+A(2-

Wk

where A is a n arbitrary constant.

e- )- , h

k

(4.4.4)

I m p o s i n g t h e i n i t i a l c o n d i t i o n , y(0) = jfo, w e

obtain

V k

=

yo + ( l - J ) ( 2 - e - ^ -

( 4

- ' 4

5 )

Note that 1 < 2 - t~

< 2,

h

h > 0,

(4.4.6)

consequently, g =(2-e- )- , h

k

k

(4.4.7)

is a n e x p o n e n t i a l l y d e c r e a s i n g f u n c t i o n o f k. E x a m i n a t i o n o f E q . ( 4 . 4 . 5 ) s h o w s t h a t a l l t h e s o l u t i o n s o f E q . (4.4.1) have t h e same q u a l i t a t i v e p r o p e r t i e s as t h e s o l u t i o n s t o t h e L o g i s t i c d i f f e r e n t i a l e q u a t i o n f o r a l l s t e p - s i z e s , h > 0.

4.4.2 O D E w i t h T h r e e F i x e d - P o i n t s A discrete m o d e l for E q . (4.3.11), w i t h a n o n l o c a l n o n l i n e a r t e r m , is Vk+l ~ Vk /1 \ n-e-*^ = yk(l - yk+iVk)-

v

2

;

IA A o\ (4.4.8)

110 This expression is linear in y/t+i! solving for it gives ( l + 0)y* where

-j 1 - e e~ -2& 9 = = — ^ - 9

2h

(4.4.9a)

(4.4.9b) (4.4.9b)

Numerical solutions of Eq. (4.4.8) or (4.4.9) are plotted in Figure 4.4.1 for j/o = 0.5 and the step-sizes h = (0.01,0.75,1.5,2.5). Observe that for all the selected step-sizes, the numerical solutions increase monotonically toward the limiting value of Voo =

= 1- This is exactly the same qualitative behavior as the corresponding

solution to the differential equation. For purposes of comparison, it is of interest to also examine the numerical solutions of the discrete model

y

k

+

1

~

y

k

(4-4.10)

=yk(i-y m)k+

This model is constructed by using a standard forward Euler scheme for the firstderivative and a nonlocal representation for the nonlinear term. Solving for y

k

gives y >= k+

(

l

l

+ )y* h

+

h

y

l

/A A 1 1 \ (4.4.11)

-

Figure 4.4.2 presents numerical solutions to the finite-difference scheme of Eq. (4.4.10) or (4.4.11). The initial condition and step-size values are the same as in Figure 4.4.1. The obtained results can be explained by means of a linear stability analysis. Perturbations about the three fixed-points of Eq. (4.4.10) give the following linear stability equations e

k+1

= (1 + h)e , k

^-G+HK

(4.4.12)

-- >

(4 4 i3

Ill

y

k

L 1

1

1.0-

^

0.9-

/

0.8 -

h = 0.01

/

0.7-

/

0.6-/ 0.5 -f 0

1

1

1

1

200

400

600

800

1—

1000

k (a) \

1 1

1

1.0-

>

0.90.80.7-

/

h

=

0

-

7 5

/ /

0.6-/ 0.5 -f 0

1

1

1

1

1

5

10

15

20

25

(b) Figure 4.4.1. Plots of Eq. (4.4.8). For each graph y = 0.5, (a) h = 0.01, (b) h = 0.75. Q

r 30

k

112

h

1

1

- p

-



,

0.9-

h

/

=

1

-

5

0.8- / 0.7- / 0.6-/ 0.5 ~r 0

1

1

1

1

1

T

5

10

15

20

25

30 k

(c)

\

1 1

1

1.0-

^

0.9-

h

/

0.8 -

2

= -

5

/

0.7-

/

0.6- / 0.5 -f 0

1

\

1

5

10

15

;

(d) Figure 4.4.1. Plots of Eq. (4.4.8). For each graph y = 0.5, (c) h = 1.5, (d) h = 2.5. 0

r

20 k

113

\

U

-|

1.00.9 -

/

0.8 0.7-

h

= °-

0 1

/ /

0.6- / 0.5

-r 0

1

1

1

200

400

600

1 1 — 800 1000

k

(a) y

k

u

T

0.9-

{

\

h =

0

-

7 5

I 0.7 - I 0.8 -

0.6-1

0.5 -f 0

1

5

1

10

1

15

1

20

1

25

(b) Figure 4.4.2. Plots of Eq. (4.4.10). For each graph y = 0.5, (a) h = 0.01, (b) h = 0.75. Q

r

30

k

114 y

u k

i

h

1.0-

h

0.9-

=

L

5

0.8¬ 0.7¬

0.6-1 0.5 ~T 0

1

1

1

1

1

5

10

15

20

25

r 30 k

(c)

1.0- \ / * h

0.9 -

=

2

5

0.8¬ 0.7 0.6¬ 0.5 -I 0

1

1

5

10

1—

15

(d)

Figure 4.4.2. Plots of Eq. (4.4.10). For each graph y = 0.5, (c) h = 1.5. (d) h = 2.5. 0

r 20 k

115 (See E q . (4.3.17).) at y* = y^ fixed-points,

From E q . (4.4.12), it can be concluded that the

= 0 is unstable for a l l step-sizes, h > 0. at

= 1 and y^

fixed-point

However, the two other

= — 1, have the following properties:

(i) For 0 < h < 1, the fixed-points are linearly stable. (ii) For h > 1, the fixed-points are linearly stable; but, the perturbations decrease w i t h an oscillating amplitude. This is just the behavior seen i n the various graphs of Figure 4.4.2. 4.5 Discussion The calculations presented i n this chapter show, for a scalar ordinary different i a l equation dy_ dt

(4.5.1)

that the use of a renormalized denominator function 1

-e

-R'h

(4.5.2)

R*

leads to discrete models for which the fixed-points have the correct linear stability properties for a l l step-sizes, h > 0. T h i s result is obtained whether or not a local or a nonlocal representation is used for the function / ( y ) .

T h e procedure given

for these constructions is the simplest possible for the differential equations investigated. However, more complicated discrete models exist. For example, consider the differential equation w i t h three dy dt

fixed-points

= y(l + y ) ( l - y ) .

(4.5.3)

A finite-difference scheme that incorporates the m a x i m u m symmetry i n the nonlocal modeling of the nonlinear term is ^ p - ~ S/fc+it + y * ) ( l - Vk)

"Ay*

1

•y*(l + y * + i ) ( l - y * ) - y * ( i + y * ) ( i - y*+i)

Ay*

y*(i + y*)(i -

yk)

= 0,

(4.5.4)

116 where Ay* = y*+i - y*,

1 =

t'

2h

g

*

(4.5.5)

(Such a form has been investigated by Price et al. [11] for an ordinary differential equation similar in form to Eq. (4.5.3). However, they consider the case where ^ = h.) This equation can be solved for y*+i to give [(5-e-2*) + (l-e- *)yj]j, 2

»*« =

( + « - » ) +8(1-e-»)rf 3

t



( 4

- - ^ 5

6

A geometrical analysis [10] of Eq. (4.5.6) shows that if yo > 0, then y* converges monotonically to the fixed-point at

= +1. Similarly, if yo < 0, then y* converges

monotonically to the fixed-point at y^ = —1. This result holds true for all h > 0 and corresponds exactly to the qualitative behavior of the various solutions to the differential equation. See Figures 4.5.1 and 4.5.2. Finally, it should be emphasized that these calculations indicate that the use of a renormalized denominator function has a more important effect on the solution behavior of a discrete model than does the use of a nonlocal representation for the nonlinear term. Of course, putting both in the same discrete model produces better results.

117

Figure4.5.1. Plot of E q . (4.5.6). The fixed-points are located at (-1,-1), (0,0) and (1,1).

118

Figure 4.5.2. Typical trajectories for E q . (4.5.6) with y >0: Q

0