The Dynamics of Runge–Kutta Methods Julyan H
Total Page:16
File Type:pdf, Size:1020Kb
The Dynamics of Runge±Kutta Methods Julyan H. E. Cartwright & Oreste Piro School of Mathematical Sciences Queen Mary and West®eld College University of London Mile End Road London E1 4NS U.K. The ®rst step in investigating the dynamics of a continuous-time system described by an ordinary differential equation is to integrate to obtain trajectories. In this paper, we attempt to elucidate the dy- namics of the most commonly used family of numerical integration schemes, Runge±Kutta methods, by the application of the techniques of dynamical systems theory to the maps produced in the numerical analysis. QMW preprint DYN #91-9, Int. J. Bifurcation and Chaos, 2, 427±449, 1992 ¡ A CONICET (Consejo Nacional de Investigaciones Cienti®cas y Tecnicas de Argentina) Fellow. Present address: Institut Nonlineaire de Nice, Universite de NiceÐSophia Antipo- lis, Parc Valrose, 06034 Nice Cedex, France. 1 1. Introduction UMERICAL solution of ordinary differential equations is the most important technique in continuous time dynamics. Since most or- N dinary differential equations are not soluble analytically, numeri- cal integration is the only way to obtain information about the trajectory. Many different methods have been proposed and used in an attempt to solve accurately various types of ordinary differential equations. However there are a handful of methods known and used universally (i.e., Runge± Kutta, Adams±Bashforth±Moulton and Backward Differentiation Formulae methods). All these discretize the differential system to produce a differ- ence equation or map. The methods obtain different maps from the same differential equation, but they have the same aim; that the dynamics of the map should correspond closely to the dynamics of the differential equa- tion. From the Runge±Kutta family of algorithms come arguably the most well-known and used methods for numerical integration (see, for example, Henrici [1962], Gear [1971], Lambert [1973], Stetter [1973], Chua & Lin [1975], Hall & Watt [1976], Butcher [1987], Press et al. [1988], Parker & Chua [1989], or Lambert [1991]). Thus we choose to look at Runge±Kutta methods to investigate what pitfalls there may be in the integration of nonlinear and chaotic systems. We examine here the initial-value problem; the conditions on the so- lution of the differential equation are all speci®ed at the start of the trajectoryÐthey are initial conditions. This is in contrast to other prob- lems where conditions are speci®ed both at the start and at the end of the trajectory, when we would have a (two-point) boundary-value problem. Problems involving ordinary differential equations can always be re- duced to a system of ®rst-order ordinary differential equations by intro- ducing new variables which are usually made to be derivatives of the origi- nal variables. Thus for generality, we consider the non-autonomous initial value problem ¢¡ £ ¤¦¥¨§ © © ¥ © §¦© ¥¨ £ 1 ¡ § ¥¨§¦© where represents . This can be either a single equation ¥¨§¦© !¥©#"$ ¥© or, more generally, a coupled system of equations " (often, we will have % ): ¡ " £ ¤¦¥¨§¦© &© '©)(*(*(+© 1 1 1 2 ¡ " £ ¤¦¥¨§¦© &© '©)(*(*(+© 2 2 1 2 . ¡ " " " £ ¤¦¥¨§¦© '© '©)(*()(,© ( 1 2 (2) The variable § often represents time. Almost all numerical methods for the initial value problem are addressed to solving it in the above form.1 1 1 0 We use the unorthodox notation -/. etc. to avoid any confusion with the iterates of a map. 2 ¡ £ ¤¦¥¨§¦© A non-autonomous system can always be transformed into ¡ £ ¤¦¥¨ § an autonomous system of dimension one higher by letting ¢¡/£ ¥ £ ¢¡ "£¡ "£¡ " 1 , so that we add the equation 1 1 to the system and 1 to the initial conditions. In this case, however, we will have unbounded "¢¡ ¥¤ ¦ §§¤ ¦ solutions since 1 as . This can be prevented for non- autonomous systems that are periodic in § by identifying planes of constant "¢¡ 1 separated by one period, so that the system is put onto a cylinder. We are usually interested in one of the two cases above: either an autonomous system, or a non-autonomous system that is periodic in § . In these cases, we can de®ne the concepts of the limit sets of the system and their associated basins of attraction which are so useful in dynamics. It is known that suf®cient conditions for a unique, continuous, dif- §/ ferentiable function ¥ to exist as a solution to this problem are that ¤¦¥¨§ © be de®ned and continuous and satisfy a Lipschitz condition in in ¨ £ © '© ¥¦ ©¦ " . The Lipschitz condition is that " § © ¤¦¥¨§ © © ¥ § © © ¥¨§ © ¥ © ( ¥ ¤ ¥ 3 Here is the Lipschitz constant which must exist for the condition to be satis®ed. We shall always assume that such a unique solution exists. Our aim is to investigate how well Runge±Kutta methods do at mod- elling ordinary differential equations by looking at the resulting maps as dynamical systems. Chaos in numerical analysis has been investigated before: the midpoint method in the papers by Yamaguti & Ushiki [1981] and Ushiki [1982], the Euler method by Gardini et al. [1987], the Eu- ler method and the Heun method by Peitgen & Richter [1986], and the Adams±Bashforth±Moulton methods in a paper by PruferÈ [1985]. These studies dealt with the chaotic dynamics of the maps produced in their own right, without relating them to the original differential equations. In recent papers by Iserles [1990] and Yee et al. [1991], the connection is examined between a map and the differential equation that it models. Other studies by Kloeden & Lorenz [1986], and Beyn [1987a; 1987b], con- centrate on showing how the limit sets of the map are related to those of the ordinary differential equations. Sauer & Yorke [1991] use shadowing theory to ®nd orbits of the map which are shadowed by trajectories of the differential equation. We bring together here all the strands in these different papers, and extend the examination of the connection between the map and the differ- ential equation from our viewpoint as dynamicists. This topic has begun to catch the awareness of the scienti®c community lately (see for example Stewart [1992]), and several of the papers we discuss appeared after the initial submission of this work; we have included comments on them in this revised version. 3 2. Derivation of Runge±Kutta methods ¡ ¡ ¢¡ £ ¥¨§ UNGE±KUTTA methods compute approximations to , ¡ ¡ £ £ § £ ¤£¦¥¨§ ¥ © with initial values 0 0 , where , , using the R Taylor series expansion ¡ ¡ ¡ ¡ £ £ £ £ £ §& § § £ ¥§ ¥ 1 2 1 1 ¡ 4 1 2 ! © £ ¤ so if we term ¤¦¥¨§ etc. : ¤ ¤ " 1 ¡ £ £§'¤ £ § §! £$ ¥%§& ( ¥ 1 2 £ £ 1 1 ¡ § § 5 " 1 # 1 2 ! § is a non-negative real constant called the step length of the method. ' To obtain a ' -stage Runge±Kutta method ( function evaluations per step) we let )* §/ © ¥ £§)(¦¥¨§ © £ ¡ 1 6 where , ¡102¡ )* ¦¥¨§ © §/ £ + © ¥ ( 7 ¡.- 1 / so that , ¡405¡ £ £§3+ © ¥ ¡ 1 ¡.- 8 1 / with ¡ " 1 , ¡ ¡ ¡ 0 0 £ ¤$67&§ £§' © £§ ¥ 8 8;:< - 9 8 1 9 £ and 1 0 for an explicit method, or , 02¡ ¡ ¡ 0 £ ¤ 7&§ £§' © £§ ¥ + 6 < 8 8 : 10 - 8 1 9 for an implicit method. For an explicit method, Eq.(9) can be solved for each 05¡ in turn, but for an implicit method, Eq.(10) requires the solution of a nonlinear system of 0=¡ s at each step. The set of explicit methods may ¡ £ ¥ 8 be regarded as a subset of the set of implicit methods with 0, >@? . Explicit methods are obviously more ef®cient to use, but we 9 shall see that implicit methods do have advantages in certain circumstances. For convenience, the coef®cients , , and of the Runge±Kutta method 9 can be written in the form of a Butcher array/ : B ¥ 11 /BA ¡ £DC © ()(*( £GC © ()(*( £GC 8 where 1 2 , 1 2 and B . E +FE +HE A A 9 / / / / 4 Runge±Kutta schemes are one-step or self-starting methods; they give ¡ 1 in terms of only, and thus they produce a one-dimensional map if they are dealing with a single differential equation. This may be con- trasted with other popular schemes (the Adams±Bashforth±Moulton and Backward Differentiation Formulae methods), which are multistep meth- ¡ ¡ ods; is given in terms of " 1 down to . Multistep methods give rise to multi-dimensional maps from single differential equations. A method is said to have order if is the largest integer for which * ¡ ¥ § £§/ ¥¨§ §)(¦¥¨§¦© ¥¨§/ §/ ¦£ ¥%§ ( ¥ 1 12 ¡ ¡ ¡ For a method of order , we wish to ®nd values for , 8 and with ¥%¥+© @£ 9 / 1 > so that Eq.(8) matches the ®rst 1 terms in Eq.(4). To © do this we Taylor expand Eq.(8) about ¥¨§ under the assumption that £ , so that all previous values are exact, and compare this with Eq.(4) in order to equate coef®cients. For example, the (unique) ®rst-order explicit method is the well-known Euler scheme £ £§'¤¦¥¨§ © ( ¥ ¡ 1 13 £ £ Let us derive an explicit method with ' 2, that is, a two-stage, second-order method. From Eq.(5) we have ¤ £ £§&¤ £ § £ ¥§ © ¥ 1 2 3 ¡ 1 § 14 2 so expanding this, ¢¡ £¡ ¤ ¤ £ £$§'¤ £ § £ ¤ ( ¥ £ ¥%§ 1 2 3 ¡ ¡ ¡ § 15 1 2 From Eq.(8), and assuming previous exactness, 0 0 £ £ § £§ ( ¥ ¡ 1 1 1 2 2 16 / / £ We can choose 1 0 so 0 £ ¤ § © £ ¤ © 1 ( ) (17) 0 0 £ ¤ § £§& © £$§ 2 ( 2 21 1) (18) ¡ 9 0 0 ¤ § © £§ £§& ¤ § © £§ £ ¥%§ £ 2 ¡ ( 21 1) 2 § ( 21 1) (19) ¡ ¡ 9 9 ¤ ¤ £ § ¤ £ ¥%§ ¤ £ §& © £ 2 ¡ ¡ § 2 21 (20) 9 and Eq.(16) becomes £¡ ¤¡ ¤ ¤ £§ ¤ £ ¥§ £ £ § ¤ £ § ¤ £§' ( ¥ 3 ¡ ¡ ¡ § 1 1 2 2 21 21 9 / / 5 We can now equate coef®cients in Eqs.(15) and (21) to give: §'¤ £ £ © [ ] : 1 2 1 (22) ¢¡ ¤ / / £ © § 2 1 ¡ § ¢¡ : (23) 2 2 2 / ¤¡ ¤ ¤ £ ( § 2 1 ¡ ¡ : (24) 2 21 2 9 / This is a system with three equations in four unknowns, so we can solve in terms of (say) 2 to give a one-parameter family of explicit two-stage, second-order Runge±Kutta/ methods: 0 0 C £ § ¥ £ £ © ¡ 1 1 2 1 2 2 (25) 0 E £ ¤ § © © / / 1 ( ) (26) § § 0 0 £ £ ¤ § £ © ( 2 1 (27) 2 2 2 2 / / £ Well-known second-order methods are obtained with 2 1 2, 3 4 and 1. £ When 2 0, the equation collapses to the ®rst-order / Euler method.