- G40 60 Fuel Cell Test Station
- Fuel Cost Minimization in Multimodal pipeline
- Marine2013_isogeo
- Index
- 6EAF3d01
- BR917059EN-CYMCAP70-NewFeatures
- CAM II
- 1-s2.0-S002002551300532X-main
- 00581777
- 1801.09756
- Chap013 Rev
- PO SS2011 05.1 DynamicOptimization p11
- Iima Teaching Note Merton
- SSRN-id1866674 (1)
- bmw_finrep.ml.pdf
- Mounting Components Enus
- Alternating Direction Method for image restoration: application to 3D biological imaging
- Neutrosophic Operational Research
- US Senior Citizen Diabetes Prevention Proposal
- Pre Solving in Linear Programming
- Rockwell Autoamtion TechED 2017 - AP21 - Uncork the Value of Premium Wines With MES
- 10.1109-90.803389
- Design of a Sequential Control Circuit
- chap07.ppt
- K2UserManual
- Development and Application of a Hybrid Genetic Algorithm for Resource Optimization and Management
- Synthesis of a Pumping
- 4-Assignment of Opration Research
- Design Wind Speeds for Mexico
- MUSA Method
- Sapiens: A Brief History of Humankind
- Yes Please
- The Unwinding: An Inner History of the New America
- The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution
- Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
- Dispatches from Pluto: Lost and Found in the Mississippi Delta
- John Adams
- Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
- The Prize: The Epic Quest for Oil, Money & Power
- This Changes Everything: Capitalism vs. The Climate
- Grand Pursuit: The Story of Economic Genius
- A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
- The Emperor of All Maladies: A Biography of Cancer
- Team of Rivals: The Political Genius of Abraham Lincoln
- The New Confessions of an Economic Hit Man
- Rise of ISIS: A Threat We Can't Ignore
- The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
- Smart People Should Build Things: How to Restore Our Culture of Achievement, Build a Path for Entrepreneurs, and Create New Jobs in America
- The World Is Flat 3.0: A Brief History of the Twenty-first Century
- Bad Feminist: Essays
- How To Win Friends and Influence People
- Steve Jobs
- Angela's Ashes: A Memoir
- The Silver Linings Playbook: A Novel
- Leaving Berlin: A Novel
- Extremely Loud and Incredibly Close: A Novel
- The Sympathizer: A Novel (Pulitzer Prize for Fiction)
- The Light Between Oceans: A Novel
- The Incarnations: A Novel
- You Too Can Have a Body Like Mine: A Novel
- Life of Pi
- The Love Affairs of Nathaniel P.: A Novel
- The Blazing World: A Novel
- The Rosie Project: A Novel
- The First Bad Man: A Novel
- We Are Not Ourselves: A Novel
- The Flamethrowers: A Novel
- Brooklyn: A Novel
- A Man Called Ove: A Novel
- The Master
- Bel Canto
- Interpreter of Maladies
- The Kitchen House: A Novel
- Beautiful Ruins: A Novel
- The Art of Racing in the Rain: A Novel
- Wolf Hall: A Novel
- The Wallcreeper
- A Prayer for Owen Meany: A Novel
- The Cider House Rules
- Lovers at the Chameleon Club, Paris 1932: A Novel
- The Bonfire of the Vanities: A Novel
- The Perks of Being a Wallflower
- The Constant Gardener: A Novel

**Automation of Computational Mathematical Modeling
**

ANDERS LOGG

Automation of Computational Mathematical Modeling ANDERS LOGG ISBN 91–7291–436–X c ANDERS LOGG, 2004. Doktorsavhandlingar vid Chalmers tekniska h¨gskola o Ny serie nr 2118 ISSN 0346–718X Department of Computational Mathematics Chalmers University of Technology G¨teborg University o SE–412 96 G¨teborg o Sweden Telephone +46 (0)31 772 1000

Department of Computational Mathematics CHALMERS UNIVERSITY OF TECHNOLOGY ¨ GOTEBORG UNIVERSITY G¨teborg, Sweden 2004 o

Tryckeriet, Matematiskt centrum G¨teborg, Sweden 2004 o

**Automation of Computational Mathematical Modeling
**

ANDERS LOGG Department of Computational Mathematics Chalmers University of Technology G¨teborg University o

ABSTRACT

This thesis concerns the Automation of Computational Mathematical Modeling (CMM), involving the key steps of automation of (i) discretization, (ii) discrete solution, (iii) error control, (iv) modeling, and (v) optimization. The automation of (i)–(ii) is realized through multi-adaptive Galerkin methods on general discretizations of space–time with time steps variable in space. The automation of (iii) is realized through a posteriori error estimation based on residuals of computed solutions and stability factors or stability weights obtained by the solution of associated dual problems. The automation of (iv) is studied in a model case, while that of (v) is reduced to an application of (i)–(iv). An open-source software system for the Automation of Computational Mathematical Modeling is developed and implemented, based on general order multi-adaptive Galerkin methods, including automatic evaluation of variational forms, automatic discrete solution, automatic generation and solution of dual problems, and automatic model reduction.

Keywords: Computational mathematical modeling, automation, adaptivity, multiadaptivity, individual time steps, dual problem, a priori, a posteriori, model reduction.

i

ii

THESIS

This thesis consists of an introduction, a sequence of papers as listed below, and the source code included on the compact disc.

iii

iv

Numer. M. PAPER IV: Multi-Adaptive Galerkin Methods for ODEs IV: A Priori Error Estimates. J. R. Comput. with J. SIAM J. Comput. Softw.. with K. with J. CEDYA 2001: Congreso de Ecuaciones Diferenciales y Aplicaciones (2001). 339–354 (2004). Dyn. Johnson.. Sci. with J. 2003–21 (2003). to appear in Encyclopedia of Computational Mechanics (2004). PAPER III: Multi-Adaptive Galerkin Methods for ODEs III: Existence and Stability. (2004). pp. Jansson and C. Larson. no. Kirby. C. Hoﬀman.G. Jansson. 25 (2003). 1142–1157.. 24 (2003). no. PAPER VII: Interpolation Estimates for Piecewise Smooth Functions in One Dimension. Eriksson and C. Johnson. Applied Numerical Mathematics. to appear in M 3 AS (2004). Jansson. • Multi-Adaptive Time-Integration. SIAM J. with J. submitted to SIAM J. PAPER VIII: Estimates of Derivatives and Jumps Across Element Boundaries for Multi-Adaptive Galerkin Solutions of ODEs. 2002– 06 (2002). and L. Hoﬀman. Eriksson and C. 2004–03 (2004). submitted to SIAM J. 1879–1902. Math. Comput. PAPER IX: Algorithms for Multi-Adaptive Time-Stepping. Scott. Sci. 25 (2003). pp. Jansson. pp. Sci. 48. Chalmers Finite Element Center Preprint Series. v vi . pp. no. PAPER II: Multi-Adaptive Galerkin Methods for ODEs II: Implementation and Applications. Johnson. with K.APPENDED PAPERS The following papers are related. • DOLFIN: Dynamic Object oriented Library for FINite element computation. Anal. (2004). vol. submitted to ACM Trans. • The FEniCS project. PAPER X: Simulation of Mechanical Systems with Individual Time Steps. • Topics in Adaptive Computational Methods for Diﬀerential Equations. with T. submitted to SIAM J.R. 2004–02 (2004). vol. vol. Johnson. Johnson. Numer. Anal. PAPER VI: Explicit Time-Stepping for Stiﬀ ODEs. Hoﬀman and C. but are not included in the thesis: The following papers are included in this thesis: PAPER I: Multi-Adaptive Galerkin Methods for ODEs I. vol. PAPER XI: Computational Modeling of Dynamical Systems.C. • Adaptive Computational Methods for Parabolic Problems. no. Chalmers Finite Element Center Preprint Series. submitted to BIT (2004). PAPER V: Multi-Adaptive Galerkin Methods for ODEs V: Stiﬀ Problems. with J. Chalmers Finite Element Center Preprint Series. Dupont. Chalmers Finite Element Center Preprint Series. Syst. 1119– 1141. Appl. with J. SIAM J. (2004). (2004).

• PAPER I–XI as listed above. vii viii .4.11.6.CONTENTS ON THE COMPACT DISC The included compact disc contains the following material: • The introduction. • Source code for DOLFIN version 0.1. • Source code for Puﬃn version 0. • Images and animations.

and Chicago during my time as a graduate student. Erik Svensson. Harald Svensson. G¨teborg. and Prof. Thomas Svedberg. Thanks also to Prof. my parents and grandparents. Ridgu way Scott for giving me the opportunity to visit Oxford. and football. In particular. Georgios Foufas. the tennis lessons. I wish to acknowledge my co-authors Johan Hoﬀman and Johan Jansson. for all their love and support. my two advisors. Jan Verwer. Prof. my little sister Katarina. philosophy. and Walter Villanueva. Aleksandra Krusper. and the endless discussions on music. and life. David Heintz. programming. Karin Kraft. To all my friends and colleagues at the Department of Computational Mathematics at Chalmers. Amsterdam. But most of all. Axel M˚ alqvist. Thanks also to G¨ran Christiansson for valuable comments on the manuscript. Endre S¨ li. Jim Tilander. Special thanks to Claes for the piano lessons. Claes Johnson. These visits have all been invaluable experiences. and Lysekilarna. Niklas Ericsson. April 2004 o Anders Logg ix x . Johan Hoﬀman. Johan Jansson.PREFACE To Prof. o Special thanks to all the members of the DOLFIN team: Fredrik Bengzon. Andreas Mark. Andreas Nilsson. thanks for all your inspiration and support over the years. thanks for the many enlightening discussions on mathematics. I would like to thank my wife Anna. Rasmus Hemph. Kenneth Eriksson and Prof.

astronomers. . For it is unworthy of excellent men to lose hours like slaves in the labor of calculations which could safely be relegated to anyone else if the machine were used. it is well known. are the managers of ﬁnancial aﬀairs. the administrators of others’ estates. navigators. . merchants. geographers.And now that we may give ﬁnal praise to the machine we may say that it will be desirable to all who are engaged in computations which. surveyors. Gottfried Wilhelm Leibniz (1646–1716) .

the advancement of CMM opens new possibilities for our understanding of nature. each step of the algorithm operates on and transforms physical material. A prime example is the n-body problem. We may also express this as abstraction. and to the action as the modiﬁcation strategy. We thus identify the following basic principles of automation: algorithms. such as food. A key step in the automation of a complex process is modularization. Typically. Modularization (or abstraction) is central in all engineering and makes it possible to build complex systems by connecting together components or subsystems without concern for the internal workings of each subsystem. An automatic process is deﬁned by an algorithm. In the context of an algorithm for feedback control. The task of the automatic system may be formulated as follows: For given input satisfying a ﬁxed set of conditions (the input conditions). cars. using classical analytic methods. a quantity relating to the given set of conditions to be satisﬁed by the output is measured. stating that the rate of change u of ˙ the solution u is given by f (u) depending on u and space derivatives of u. Using a computer. Computational simulation of real world phenomena is becoming possible for the ﬁrst time. consisting of a sequential list of instructions (like a computer program). Feed-back control is realized through measurement. An automatic system carries out a well-deﬁned task without intervention from the person or system actuating the automatic process. i.INTRODUCTION Computational Mathematical Modeling (CMM) can be viewed as the modern manifestation of the basic principle of the natural sciences: formulating equations (modeling) and solving equations (computation). clothes. the distinction between the properties of a component (its purpose) and the internal workings of the component (its realization). and modularization. the measure of quality is given in the form of a tolerance TOL > 0 for the size of the error e = U − u in a suitable norm: e ≤ TOL. solutions are only available in a few special cases. allowing the given output conditions to be satisﬁed under variable input and external conditions. produce output satisfying a given set of conditions (the output conditions). i. evaluation. In particular. it has not been possible to solve diﬀerential equations in any generality.e. 1 The key problem for the Automation of CMM is thus the design of a feed-back control for the automatic construction of a discrete solution U . Each subprocess may then itself be automated.e. Models of nature are often expressed as diﬀerential equations of the canonical form u = f (u) ˙ (1) on a given domain in space–time. The emerging information society is based on automated mass-processing of information by computers. and the Schr¨dinger equation of quantum mechanics. feed-back control. A key problem of automation is the design of a feed-back control. ideally at a minimal cost. and action. such as turbulence in ﬂuid motion and the stability of our solar system. Thus.. an algorithm for the Automation of CMM operates on digits and consists of the automated transformation of digital information. and computers. the solution of the three-body problem can be obtained in fractions of a second. by making possible the detailed study of complex phenomena. the input is a given model of the form (1) and the output is a discrete solution U ≈ u satisfying some measure of quality. with the product satisfying some measure of quality (the output conditions).. the hierarchical organization of the complex process into components or subprocesses. The situation has changed with the arrival of the modern computer. but no one has been able to ﬁnd the general solution of the n-body problem for n = 3. in which case some action is taken to make the necessary adjustments. In the Automation of CMM. satisfying the output condition (2) at minimal cost. 2 . the general solution of the n-body problem was given by Newton for n = 2 [52]. Maxwell’s equations of electromagnetics. An important part of this process concerns the Automation of Computational Mathematical Modeling. The Automation of Computational Mathematical Modeling In automated manufacturing. which is the topic of this thesis. the task of the automatic system is to produce a certain product (the output) from a given piece of material (the input). In automated manufacturing. including feed-back control. we refer to the evaluation of the set of output conditions as the stopping criterion. o Until recently. Famous models of nature of the form (1) include the Navier–Stokes equations of ﬂuid dynamics. (2) The Principles of Automation The modern industrial society is based on automated mass-production of material goods. the measured quantity is evaluated to determine if the output conditions are satisﬁed or if an adjustment is necessary. Correspondingly.

with the solution of the primal problem (1) and an associated dual problem being the key steps in the minimization of a given cost functional. This is the goal of the FEniCS project. a software system implementing the automation of (i)–(v). · (a u) = 0. These key steps concern the automation of (i) discretization. Puﬃn is used in a number of courses at Chalmers. FEniCS is based on the open-source computational platform DOLFIN [31. We return to (i)–(v) below. The solution of the dual problem is also the key to the realization of an automatic system for the construction of the discrete solution U at minimal cost. and an aspect of eﬃciency (the solution should be computed with minimal work). the modern computer. In particular. we identify the key steps in the Automation of CMM. plays a key role. We return to this in detail below. 3 The Realization of the Automation of CMM The Automation of CMM includes its own realization. of Computational Mathematics at Chalmers. ranging from introductory undergraduate courses to advanced undergraduate/beginning graduate courses. We discuss the current status of DOLFIN below in Section 6. or adaptivity. 33]. This includes an aspect of reliability (the error of the computed solution should be less than a given tolerance). (ii) discrete solution. recently initiated in cooperation between Chalmers University of Technology and the University of Chicago [12]. modeling 4 .. The necessary prerequisites for this venture are now available. (iii) error control. Following our previous discussion on modularization as a basic principle of automation. feed-back control. Figure 1: Solution of the equation u + b · u − ˙ convection–diﬀusion around a hot dolphin. FEniCS also includes a minimal and educational implementation of the basic tools for the Automation of CMM. that can be solved on a computer to obtain a discrete solution of (1). DOLFIN and Puﬃn constitute an essential part of this thesis. The automation of discretization means the automatic translation of a continuous model of the form (1) to a discrete model. In all cases. The automation of modeling concerns the process of automatically ﬁnding the optimal parameters describing the model (1). currently working as a prototype implementation of FEniCS. i. connecting the size of the residual R(U ) = U − f (U ) of the computed discrete solution to the size of the error e. the automation of optimization relies on the automatic generation of the dual problem. developed at the Dept. (iv) modeling. either to ﬁnd the model from a given set of data or to construct from a given model a reduced model for the variation of the solution on resolvable scales. (v) optimization. and modern tools of computer science. called Puﬃn.e. including the mathematical methodology. The automation of error control means that the resolution of the discrete model is automatically chosen to produce a discrete solution satisfying a given accuracy requirement with minimal work. and thus to the output condition (2). and is discussed in more detail below in Section 7. The automation of discrete solution means the automatic choice of an appropriate algorithm for the solution of the discrete system of equations obtained from the automatic discretization of (1). The automation of optimization relies on the automation of (i)–(iv).The design of this feed-back control is based on the solution of an asso˙ ciated dual problem.

2]. 21. tj ] given by the time step kj = tj −tj−1 . (7) .. j = 1. . Based on the partition T . T ])]N : v|Ij ∈ [P 1 (Ij )]N . Galerkin’s method with piecewise polynomial subspaces (V. v) dt ˆ ∀v ∈ V . ·) is an inner product for functions on a domain Ω × (0. . (4) where (·. (5) i. a necessary ingredient is the automatic generation of ﬁnite elements. j = 1. General references include [61. T ] → RN a given function that is Lipschitz-continuous in u and bounded. 22. it follows that the cG(1) solution can alternatively be deﬁned in terms of its nodal values. as discussed below.e. (6) where (·. . . we consider the cG(1) ﬁnite element method in its basic form. as deﬁned in [54. Euler. t) dt. From (6). V ) is known as the ﬁnite element method. and return below to the general multi-adaptive methods mcG(q) and mdG(q). Recent work [55] makes it possible to automatically generate a ﬁnite element. as discussed below in Section 2. Both DOLFIN and Puﬃn implement this language. T ] in space–time. The Galerkin ﬁnite element method thus provides the basic tool for the automatic discretization of (1). T ] → RN is the solution to be computed. An important step in the Automation of CMM is thus the automated solution of these discrete equations. . Rayleigh. T ]. To give a concrete example of the automatic translation of (1) to a discrete model of the form (3). an additional translation is necessary from a model given in the (strong) form (1) to a model given in the (weak) form (3). T = {I j }M . V represents the space of continuous and piecewise linear vector-valued ˆ functions on the partition T and V represents the space of (possibly discontinuous) piecewise constant vector-valued functions on the partition T . and ˆ Ritz [56]. The discrete model (3) represents a discrete system of (possibly nonlinear) equations. v) dt = 0 T (f (U. and f : R N × (0. with the length of each j=1 subinterval Ij = (tj−1 . we construct the trial space V ˆ and the test space V of (3) as follows. . (3) to a software system by just giving their deﬁnition. Furthermore. the ﬁnite elements may be chosen adaptively by feed-back from computation. M }. u(t) = f (u(t). T > 0 a given ﬁnal time. the trial and test spaces are now deﬁned as follows: V = {v ∈ [C([0. it is convenient to specify models in the language of variational forms corresponding to (3). The time interval interval (0. Galerkin’s method for (1) is given by specifying a ˆ pair of ﬁnite-dimensional subspaces (V. . v) ˆ ∀v ∈ V . Another advantage is that by automating the generation of ﬁnite elements. 54. . . M }. . In addition. Hamilton. 13. t). the cG(1) method for (4) now reads: Find U ∈ V with U (0) = u0 . V ) and then formulating a discrete version of (1) for functions in the trial space V by testing (1) against all ˆ functions in the test space V . given by tj U (tj ) = U (tj−1 ) + tj−1 f (U (t). V ) [4] and goes back to the variational principles of Leibniz. Castigliano [6]. ˆ V = {v : v|Ij ∈ [P 0 (Ij )]N . ˙ u(0) = u0 . The ﬁnite element method was introduced by engineers for structural analysis in the 1950s and was independently proposed by Courant in 1943 [7]. such that ˙ (U . to complete the automation of discretization. T ] is partitioned into M subintervals. The exploitation of the ﬁnite element method among engineers and mathematicians exploded in the 1960s. 23. t ∈ (0. This allows a model to be speciﬁed in a notation which is close to the mathematical notation of (3). Galerkin’s method was originally formulated with global polynomial ˆ subspaces (V. satisfying a given set of properties. it becomes easier to guarantee the correctness of the implementation. To obtain the discrete version of (4). With the automation of discretization made possible through the automation of the Galerkin ﬁnite element method. 58. since the implementation is common for all types of ﬁnite elements. 18. Following the general formulation (3). The discrete version of (1) takes the form: Find U ∈ V . With automatic discretization based on the Galerkin ﬁnite element method. Dirichlet. providing a general framework for the discretization of diﬀerential equations. 58]. ·). Lagrange. . u0 ∈ RN a given initial value. a language must be speciﬁed in which models of the general form (1) can be expressed and interpreted by a computer. 20. v) = (f.1 The Automation of Discretization The automation of discretization is based on Galerkin’s method. M. the partition T is automatically determined by an adaptive algorithm with the goal of obtaining an optimal discrete representation U of the exact solution u. ·) denotes the inner product on R N . To automate this process. 19. 6 j = 1. such that T 0 ˙ (U . As discussed further below in Section 3. New ﬁnite elements may thus be added 5 where u : [0. 14. . In its basic form. We shall further assume that the model (1) takes the form of an initial value problem for a system of ordinary diﬀerential equations.

as multi-adaptive Galerkin methods. see e. Figure 3: Local time steps in a multi-adaptive solution of the 2D heat equation with a variable heat source localized to the center of the domain. Note that (7) represents a (possibly nonlinear) system of equations for the degrees of freedom of the discrete solution U . 10]. known as asynchronous variational integrators (AVI) with individual time steps. Ti = {Iij }Mi . we modify ˆ the trial space V and the test space V to allow individual time steps for each component. For the multi-adaptive version of the standard cG(q) method. into Mi subintervals. 38. V ). If the diﬀerent time scales are localized in space. . collecting elements between common synchronized time levels {T n }M . 48.with U (0) = u0 and where U (t) = U (tj−1 ) + (t − tj−1 )(U (tj ) − U (tj−1 ))/kj on each interval Ij .j−1 tij Tn−1 Kn Tn T Figure 4: A sequence of M = 4 time slabs for a system of size N = 6. 60. Ui |Iij )} are arranged in time slabs. the multi-adaptive algorithm consists of two phases: the generation of time slabs and the solution of the discrete equations on each time slab. tij ] given by the local time step kij = tij − ti. In particular. eﬃcient representation of the solution thus requires that this diﬀerence in ˆ time scales is reﬂected in the choice of discrete representation (V. To extend the standard cG(q) and dG(q) methods for (4). The resulting individual elements {(Iij . . This can be very costly if the system exhibits multiple time scales of diﬀerent magnitudes. N . 29. Multi-Adaptive Galerkin It is desirable. and low-order methods for conservation laws [53.j−1 . with the length of each subinterval j=1 Iij = (ti. Early attempts at individual time-stepping include [62.g. 9. [8. John Stuart Mill (1806–1873). . the time interval (0. . We return to the iteration on time slabs below. 50. 36]. We refer to the resulting methods. but has been used to some extent for speciﬁc applications. 35. See also [40. has been introduced [42]. in short. PSfrag replacements Iij Figure 2: A simple mechanical system consisting of n = 5 particles exhibiting multiple time scales. 63]. As discussed in [35]. as shown in n=0 Figure 4. individual time-stepping (multi-adaptivity) has previously received little attention in the large literature on numerical methods for ODEs. 1]. 30. a new class of related methods. For i = 1. i Surprisingly. 5.j−1 . On Liberty (1859) Standard methods for the discretization of (1) require that the temporal resolution is constant in space at each given time t. referred 8 . 37]. 45. 49. including specialized integrators for the n-body problem [51. corresponding to a diﬀerence in time scales between the diﬀerent components of the solution U of (4). that in things which do not primarily concern others. T ] is partitioned 7 0 t kij ti. recently introduced in a series of papers [44. Recently. 59]. the cG(1) method for (4) requires that the same time step k = k(t) is used for all components Ui = Ui (t) of the solution U . individuality should assert itself.

N }. . . (9) Rewriting (9) as a sequence of successive local problems for each component. in Ω. with the linearized equations being solved using direct methods based on Gaussian elimination. referred to as the mdG(q) method. 2 The Automation of Discrete Solution Depending on the model (1). It is also an attractive 10 . T ])]N : vi |Iij ∈ P qij (Iij ). 2. . For the solution of the discrete system given by (9). . 9 for n = 1. j = 1. ﬁxed point iteration is a competitive alternative to standard Newton iteration. . . showing the mcG(1) solution of a system with three components with individual partitions for the diﬀerent components.j−1 ). see [44] or [48]. The trial and test spaces for the multi-adaptive version of the standard dG(q) method. (11) [q ] q Figure 5: A multi-adaptive solution with individual time steps for the three diﬀerent components. Traditionally. 57]). The mcG(q) method for (4) can now be deﬁned as follows: Find U ∈ V with U (0) = u0 . . are deﬁned similarly with discontinuous trial and test functions. such that T 0 on the unit cube Ω = (0. 1]) is a set of polynomial weight functions and τij maps Iij to (0. we deﬁne the trial and test spaces by V = {v ∈ [C([0. Mi . . . t) dt. 1) with T = 100 and = 0. 0) = u0 on ∂Ω. in Ω × (0. . qij . If the number of iterations remains small. corresponding to (7). (10) for each local interval Iij . j = 1. V denotes the space of continuous piecewise polynomials ˆ of degree q = qi (t) = qij . V ). the solution of the discrete system is obtained by some version of Newton’s method. Alternatively. . This is illustrated in Figure 5.we obtain ˙ Ui v dt = Iij Iij fi (U. . . T ]. direct ﬁxed point iteration on the discrete equations (11) may be used. The ﬁxed point iteration takes the form xn = g(xn−1 ) = xn−1 − (xn−1 − g(xn−1 )) = xn−1 − F (xn−1 ). and V denotes the space of (possibly discontinuous) piecewise polynomials of degree q − 1.. This explicit form of (10) is given by xijm = xij0 + Iij ij where {wmij }m=1 ⊂ P qij −1 ([0. v) dt ˆ ∀v ∈ V . the solution of the resulting discrete system of equations may require more or less work. or iterative methods such as the conjugate gradient method (CG) or GMRES in combination with a suitable choice of problem-speciﬁc preconditioner. ·)v dt ∀v ∈ P qij −1 (Iij ). . v) dt = 0 T (f (U. 1) × (0.0001. (8) In other words. . converging to a unique solution of the equation F (x) ≡ x − g(x) = 0 if the Lipschitz constant L g of g satisﬁes Lg < 1. N }. Mi . . i = 1.j−1 )/(tij − ti. . ˆ V = {v : vi |Iij ∈ P qij −1 (Iij ). t ∈ Iij . (12) to as the mcG(q) method. the method used for the automatic discretizaˆ tion of (1). . . and the choice of discrete representation (V. u − ∆u = u(1 − u2 ) ˙ ∂n u = 0 u(·. . . 1) × (0. 1]: τij (t) = (t − ti. wmij (τij (t)) fi (U (t). An example of multi-adaptive time-stepping taken from [35] is presented in Figure 6. ·). . showing the solution and multi-adaptive time steps for the bistable equation (see [26. (13) ˙ (U . . it is convenient to rewrite (10) in explicit form for the degrees of qij freedom {xijm }m=0 of the local polynomial Ui |Iij . [q ] m = 1. i = 1.

the simple ﬁxed point iteration (13) is modiﬁed according to xn = (I − α)xn−1 + αg(xn−1 ) = xn−1 − αF (xn−1 ). with ˆ the construction of the discrete representation (V. an algorithm for the solution of (1) should have the following properties: Given a tolerance TOL > 0 and a functional L. estimating the error ˙ e = U − u in terms of the residual R(U ) = U − f (U ) and the solution φ of a continuous dual problem connecting to the stability of (1).alternative for the iterative solution of the discrete equations on time slabs in multi-adaptive methods. this idea is explored for the iterative solution of the discrete equations on time slabs. since it avoids the formation of large Jacobians on time slabs. an adaptive algorithm typically involves a stopping criterion. where e = U − u. V ) based on feed-back from the computed solution. 11 . which is characterized by a large Lipschitz constant L g > 1. for example the error in the drag coeﬃcient of an object such as a car or an airplane in a numerical ﬂow simulation. The functional L is typically chosen to represent the error e in some output quantity of interest. the stopping criterion and the modiﬁcation strategy are based on an a posteriori error estimate E ≥ |L(e)|. As discussed above. 3 The Automation of Error Control Ideally. In adaptive ﬁxed point iteration. Often. However. (14) with adaptively determined damping α : R N → RN . and a modiﬁcation strategy to be applied if the stopping criterion is not satisﬁed. the algorithm shall produce a discrete solution U approximating the exact solution u of (1). The suitable damping α is automatically determined in each iteration. Conditions (A) and (B) are satisﬁed by an adaptive algorithm. simple ﬁxed point iteration may fail to converge. which in particular means that α = I for a non-stiﬀ problem. based on ideas for the adaptive stabilization of stiﬀ systems presented in [24]. if the problem being solved is stiﬀ. relying on the inherent property of the stiﬀ problem itself: rapid damping of high frequencies. Other natural choices include L(e) = e(T ) for a suitable choice of norm · for functions on Ω. In [36]. indicating that the size of the error is less than the given tolerance. 12 Figure 6: Cross-section of solution (above) and multi-adaptive time steps (below) at time t = 10 for the bistable equation (12). such that (A) |L(e)| ≤ TOL. (B) the computational cost of obtaining the approximation U is minimal.

1.Alternatively. ψ) + 0 (e. Choose an initial discrete representation (V. M . where (∂f /∂u)∗ denotes the adjoint of the derivative of f . ·) ds. As a concrete example. Φ) dt = ˙ 0 (J(πu. . the discrete dual problem of (6) takes the followˆ ing form: Find Φ ∈ V with Φ(T + ) = ψ. Φ) dt + ˙ ˙ 0 (f (πu. ·) = 0 ∂f /∂u(sπu + (1 − s)U. the solution of a dual problem in addition to the solution of the primal problem (1). knowledge of the stability of the problem being solved is thus required. 4. T A Priori Error Estimates To obtain an a priori error estimate for the discrete cG(1) solution U of (4). the required stability properties can be obtained e. (17) for given dual data (ψ. ·). (15) on Ω × [0. such that T T S(T ) = 0 φ(q) dt. u. (16) 0 (v. πu(tj ) = u(tj ) for j = 0. 13 for all v ∈ V with v(0) = 0. 3. following earlier work on adaptivity for the cG(q) and dG(q) methods [11. Solve the dual problem (15) and compute the stability factor S(T ). Φ) dt = 0 (R(U. we note that (18) represents a Galerkin method for (15). If not. see [48] for details. Solve the discrete problem (3) to obtain the discrete solution U approximating the exact solution u of (1). ·)¯. V ) based on the residual R(U ) and the stability factor S(T ). U. typically involving derivatives of the dual solution. To estimate the error. since πu interpolates u at each tj and Φ is constant on each interval Ij . U. ·)v. ·) is orthogonal to the test space V . reﬁne the discrete representation ˆ (V. The a priori error estimate now follows by an interpolation estimate. By computing the solution of the dual problem (15). We derive a priori and a posteriori error estimates and indicate how these estimates ﬁt into the basic adaptive algorithm. 39. 27]. J ∗ (πu. Assuming that the functional L can be expressed as T L(e) = (e(T ). Φ) dt = 0 (πu − u. Φ) dt T (20) = 0 (f (πu. Subtracting the residual R(u. ·) − f (u. Integrating by parts. Φ) dt T =− 0 T (πu − u. we note that e ≡ U − πu ∈ V and so ¯ T T ˙ ¯ e if follows from (18). g). (19) where we have used the Galerkin orthogonality (6). . i. ·). ·) − f (u. The a priori error estimate then follows by subtracting the residual of the exact solution u in the representation of the error. These stability properties are in general obtained by solving the dual problem of (1). Φ) dt and thus that T L(¯) = − e 0 (R(πu. in the form of a stability factor S(T ). Φ) dt + L(v) 1 (18) Error control thus requires some extra eﬀort from the adaptive algorithm. where J(πu. Letting πu denote the piecewise linear nodal interpolant of u.g. that L(¯) = 0 (e − J(πu. which in most cases is comparable to the eﬀort of solving the primal problem itself. ·)Φ) dt. 2. Φ) dt. it now follows that T L(¯) = − e 0 T (R(πu. If E ≤ TOL. The Adaptive Algorithm The basic adaptive algorithm for the solution of (1) can now be expressed as follows: ˆ 1. which takes the form ˙ −φ = (∂f /∂u)∗ φ. the stopping criterion and the modiﬁcation strategy can be based on an a priori error estimate involving the exact solution u of (1) and the solution Φ of a discrete dual problem. then stop.e. U. . ·) = 0 of the exact solution ˙ u of (4) in the error representation (19). ·) = u − f (u. g) dt. ·) = U − f (U.T ].l2 ) . and go back to 2. ·) − e R(πu. T ). ·). ·) − R(u. 28. ·). (21) . 5. . either a priori or a posteriori. the error e = U − u is represented in terms of a discrete dual solution Φ and the residual of an interpolant πu of the exact solution u of (4). we consider below the cG(1) method for the basic model problem (4).. expressing that the ˙ ˆ residual R(U. ¨ |L(¯)| ≤ CS(T ) k 2 u e 14 L∞ ([0. Compute an error estimate E based on the residual R(U ) and the stability factor S(T ). together with an interpolation estimate. V ) for (1). ·).

·) = U − f (U. ·). (28) for each interval Ij . parabolic problems are often described in vague terms as being dominated by diﬀusion.l2 ) . t)φ(t) + g(t). with the prototype examples being Poisson’s equation. U. The new time steps are determined adaptively from the error estimate (27).T ]. and also the two stability factors S(T ) deﬁned in (22) and (26). (27) A Posteriori Error Estimates To obtain an a posteriori error estimate for the discrete cG(1) solution U of (4). We may now give concrete meaning to the adaptive algorithm discussed above. the method used for the automatic discretization of (1). the heat equation. ·) L∞ ([0.T ]. and stability weights may be used instead of stability factors. (25) where C is an interpolation constant and the stability factor S(T ) is given by T S(T ) = 0 ˙ φ l2 dt. In particular. ˙ we note that by (6). ·) satisﬁes an estimate of ˙ ¨ the form kR(U.T ]. φ) dt and thus that T The Stability Factor and the Dual Problem The size of the stability factor S(T ) varies with the model (1). In particular. see [49]. ·) L∞ ([0. it involves computable quantities (if the exact solution u is approximated with the discrete solution U ). φ) dt. ·) L∞ ([0. Note that several extensions to this simple strategy are possible.. ·) L∞ (Ij . i. this time with smaller time steps. In the context of computational methods for a general class of models of the form (1). parabolic. and pertinent questions concern the predictability (inﬂuence of perturbations in data and model) and the computability (inﬂuence of errors introduced by the discretization) of a given model. ·) L∞ ([0.l2 ) .l2 ) = TOL/(CS(T )).e. while hyperbolic problems are dominated by convection in a setting of systems of convection-diﬀusion equations. The presence of a large stability factor indicates that the problem is sensitive to small perturbations. U. ·). The a posteriori error estimate then follows by subtracting an interpolant of the dual solution. Similarly. which may be based either on the a priori error estimate (21) or the a posteriori error estimate (25).T ]. the error estimate E is given by E = CS(T ) kR(U. and thus in particular T T ˙ for v = e. it follows from the a priori error ¯ estimate (21) that the cG(1) method is of second order in the time step k. and thus the residual R(U.T ]. (22) Noting now that e = e at each node tj . U. More generally. ·) − R(u. respectively. a better approximation U needs to be computed. (23) This error estimate for the computed solution U is thus compared to the given tolerance TOL and if E > TOL.l2 ) ≤ C k 2 f(U.l2 ) ∼ k 2 u L∞ ([0. ·). ·)e. t ∈ [0. ·). A common classiﬁcation of partial diﬀerential equations uses the terms elliptic. φ) dt = 0 (R(U. and the wave equation. i. φ(T ) = ψ. (24) Using the Galerkin orthogonality (6) to subtract a piecewise constant interpolant πφ of the dual solution φ in the error representation (24).where C is an interpolation constant and the stability factor S(T ) is given by T S(T ) = 0 J ∗ (πu. together with an interpolation estimate. showing two sides of the same coin. (26) 15 . Note that the a priori error estimate (21) does in fact take the form of a quantitative estimate. and the chosen output quantity of interest represented by the functional L.e. u. the derivative U of the computed solution U is an interpolant (the projection onto piecewise constants) of the right-hand side ˙ f (U. as discussed in [44]. showing that the mdG(q) method is of order 2q + 1. ·)Φ l2 dt. the notion of parabolicity may be given a precise quantitative 16 L(e) = 0 (R(U. Noting that the dual solution φ of (23) satisﬁes (18) for all v such that v(0) = 0 with J(πu. T ). Note the similarities between the a priori error estimate (21) and the a posteriori error estimate (25). ·). Basing the adaptive algorithm on (25). U. the cG(q) method is of order 2q. including the stability factor S(T ) which may be obtained from a computed solution of the discrete dual problem (18). and hyperbolic. The continuous dual problem of (4) takes the form ˙ −φ(t) = J ∗ (u. an a priori error estimate can be obtained for the dG(q) method. the error is represented in terms of a continuous dual solution φ and the residual of the discrete solution U . a sharper error estimate E may be obtained directly from (24).. This process is then repeated until E < TOL. we take k = k(t) such that kR(U. we obtain the following a posteriori error estimate for the cG(1) method: T |L(e)| = 0 (R(U. it follows that L(e) = 0 (e − J(u. ·) replaced by J(u. In general. φ − πφ) dt ≤ CS(T ) kR(U.l2 ) .

r = 28. We note that the stability factor peaks at the time of active reaction. is very sensitive to perturbations and is often said to be chaotic. 50 50 40 45 40 30 35 20 30 10 0 PSfrag replacements −10 10 −20 z 0 10 20 30 40 25 20 15 5 Multi-Adaptivity The a priori and a posteriori error analysis presented above extends naturally to the general multi-adaptive methods mcG(q) and mdG(q). ˙ 0 0 10 20 30 40 T 60 70 80 90 100 Figure 7: The growth of the stability factor S(T ) for the reaction front problem (29).25). as shown in [44. 49]. i. For a typical hyperbolic problem. We consider two basic examples with very diﬀerent stability properties. z(t)). 40]. We deﬁne a model of the form (1) to be parabolic if computational solution is possible over long time without error accumulation. In particular. 100] with Ω = (0. U (t) on Ω × (0. The ﬁrst example is the following system of reaction–diﬀusion equations. which limits the computability of the Lorenz system to time T = 50 with standard double precision arithmetic. The solution u(t) = (x(t). With the initial conditions chosen to obtain a reaction front moving through the domain Ω. if the stability factor S(T ) remains bounded and of moderate size as T increases. 0. the stability factor S(T ) is signiﬁcantly smaller.0001. discussed in more detail in [57. 0. 0). shown in Figure 8 for T = 40. and initial value (x(0). ˙ 2 u2 − ∆u2 = u1 u2 . 45]: u1 − ∆u1 = −u1 u2 . the stability factor for the computation of the solution at ﬁnal time at a given point in Ω grows as shown in Figure 7. Our second example is the Lorenz system.. and that before and after the reaction front has swept the region of observation. A more detailed discussion on this subject can be found in [25]. this is reﬂected by the rapid growth of the stability factor S(T ). given by ˙ x = σ(y − x). b = 8/3. y(0). ˙ 2 (29) 80 70 60 50 S(T ) PSfrag replacements 40 30 20 10 with σ = 10.e. y(t). while for more general models the growth may be polynomial or even exponential in time. y = rx − y − xz. 18 . and homogeneous Neumann boundary conditions. the corresponding stability factor S(T ) grows linearly in time. as shown in Figure 9.deﬁnition. The stability factor grows on the average as 10 T /3 . = 0. z(0)) = (1. we obtain a priori error estimates showing 17 −30 t 0 −20 −10 0 x 10 20 Figure 8: The solution of the Lorenz system (30) on the time interval [0. 45. With our perspective. ˙ (30) z = xy − bz. 1) × (0. indicating parabolicity for large values of T . the ﬁrst one is a parabolic system of chemical reactions and the second one is the Lorenz system which has an exponentially growing stability factor. 48.

even with a multi-adaptive method. 10 12 4 The Automation of Modeling 10 10 S(T ) 10 8 10 6 10 4 PSfrag replacements 10 2 10 0 0 5 10 15 20 T 30 35 40 45 50 Figure 9: The exponential growth of the stability factor S(T ) connecting to modeling/round-oﬀ errors for the Lorenz system (30). As for the cG(1) method. 35]. or protein folding represented by a molecular dynamics model. u. Together with the q + 1 powers of k obtained from the interpolation estimate for the diﬀerence πu − u. with fast time scales on the range of femtoseconds and slow time scales on the range of microseconds. In both cases. We here discuss brieﬂy the automation of model reduction. ·)(t) − f (¯(t). This interpolation estimate is proved in [46]. (31) 19 . It follows that we may subtract an interpolant πJ ∗ (πu. u. Note that each component has an individual stability factor Si (T ). the interpolant πu is chosen to satisfy a set of q − 1 projection conditions in addition to interpolating u at each nodal point.. with fast time scales on the range of seconds and slow time scales on the range of years. and the automatic construction of a reduced model for the variation of the solution on resolvable scales (model reduction). t)).10 16 10 14 corresponding to (25). ¯ ˙ u u or ˙ u(t) = f (¯(t). i. ·)(t) − f (¯(t).T ]) . to determine the subgrid model g such that g (u. ¯ u ¯ (34) u where the variance g (u. since individual time steps are used for the diﬀerent components of the multi-adaptive discrete dual solution Φ. t) ≈ g (¯(t).e. t) and ¯ ˜ ¯ ˜u 20 (33) |L(e)| ≤ C i=1 q Si (T ) ki i Ri (U. The automation of model reduction typically involves extrapolation from resolvable scales. The key step is now to model the variance g in terms of the average ¯ u. t) accounts for the eﬀect of ¯ small scales on resolvable scales. u. t) = f (u. u. Typical examples include meteorological models for weather prediction. we obtain an error representation of the form (20). ·)Φ − J ∗ (πu. t). that the mcG(q) and mdG(q) methods are of order 2q and 2q + 1 in the local time step kij . we instead seek to compute an average u ¯ of the solution u of (1) on resolvable scales. However. we thus obtain a total of 2q powers of k. computation of the solution may be very expensive. the interpolation estimate for πJ ∗ (πu. as discussed in detail in [45. t) + (f (u. The model for the average u is obtained by taking the average ¯ of (4): ¯ ˙ u(t) = u(t) = f (u. The local time steps kij are determined automatically based on this posteriori error estimate. ¯ In the setting of the basic model problem (4). we thus seek to determine a model (equation) for the average u of u deﬁned by ¯ u(t) = ¯ 1 τ τ /2 u(t + s) ds. ·)Φ is not straightforward. ·)(t) = f (¯(t). In situations where the solution u of (1) varies on time scales of diﬀerent magnitudes. To make computation feasible. ·)Φ in (20) to obtain an additional q − 1 powers of k in the error estimate. For q > 1. respectively. The main challenge in the error analysis of multi-adaptive methods lies in the proof of the a priori error estimates. The individual multi-adaptive time steps are determined based on an a posteriori error estimate of the form N The automation of modeling concerns both the problem of ﬁnding the parameters describing the model (1) from a given set of data (inverse modeling). −τ /2 (32) where τ is the size of the average (with a suitable construction near t = 0 and t = T ). a large-scale model for the average u is constructed from the given model (1). ·)Φ of J ∗ (πu. and these time scales are not localized in space. based on basic interpolation estimates for piecewise smooth functions proved in [47]. ·) L∞ ([0. t) + g (u. or the construction of a large-scale model from local resolution of ﬁne scales in time and space.

In optimization. t). discrete solution. ¯ ¯ t ∈ (0. ·). ¯ u ˜u u(0) = u0 . automatic validation of solutions through automatically generated dual problems (the automation of error control). and a basic implementation of the automatic generation of reduced models (the automation of model reduction). p. Core features. T ]. are implemented as basic tools at kernel level. together with initial values u(0) = u 0 and φ(T ) = 0 for the primal and dual problems. referred to as kernel level. t) + g (¯(t). and modeling. the ability to export a computed solution to a variety of visualization systems. of Computational Mathematics at Chalmers. adaptive mesh reﬁnement in two and three space dimensions. with u satisfying u(t) = f (u(t). DOLFIN functions as the current prototype implementation of FEniCS. ˙ (37) which takes the form of a system of diﬀerential equations. as well as an equation expressing stationarity with respect to variation of control variables: u = f (u. allowing simple speciﬁcation of variational forms in a language that is close to the mathematical notation. ˙ ˙ −φ(t) = (∂f /∂u)∗ φ − ∂J /∂u. T ] → RM minimizing J (u. in combination with special techniques to avoid object construction.replace (4) with the reduced model ˙ u(t) = f (¯(t). DOLFIN is organized into three levels of abstraction. depending on the solution u of the model (1). (36) The optimization problem can be formulated as the problem of ﬁnding a stationary point of the associated Lagrangian. T ]. involving the primal and the dual problem. Performance is ensured by automatic precomputation and tabulation of integrals. p) + (u − f (u. automatic assembly of the discrete system representing a given variational form (the automation of discretization). multigrid. In the setting of the basic model problem (4). ˙ u(0) = u0 . aiming ultimately at the Automation of CMM. either using one of the built-in solvers/modules or by direct usage of the basic tools. The optimization problem may thus be solved by computational solution of a system of diﬀerential equations. we explore this idea for a simple model problem by determining the solution u(t) of (4). p. with the model depending on the control parameter p. error control. The automation of optimization thus relies on the automated solution of both the primal problem (1) and the dual problem (15). ∂J /∂p = (∂f /∂p)∗ φ. 22 (39) . module level. we thus seek to ﬁnd the control parameter p : [0. t). one seeks to determine the value of a control parameter p which minimizes a given cost functional J (u. or as a tool for the development and implementation of new methods. t) based on the ˜u computed solution. Currently implemented features of DOLFIN include the automatic evaluation of variational forms. Automatic Evaluation of Variational Forms Automatic evaluation of variational forms is implemented by operator overloading in C++. respectively. φ) = J (u. and user level. p). p. At user level. including the automatic generation of the dual problem. a system for easy integration of new solvers/modules for speciﬁc problems. accurately over a short time period and then matching a model of the form g (¯(t). Consider as an example Poisson’s equation −∆u(x) = f (x). At module level. such as the automatic evaluation of variational forms and adaptive mesh reﬁnement. 5 The Automation of Optimization With the automation of computation realized in the form of automated discretization. φ). DOLFIN is implemented as a C++ library and can be used either as a stand-alone solver. t ∈ (0. as shown in Figure 10. including fast time scales. a number of algebraic solvers including preconditioners. a model of the form (1) is speciﬁed and solved. To simplify usage and emphasize structure. new solvers/modules can be assembled from these basic tools and integrated into the system. with help from a team of graduate and undergraduate students at the Dept. 21 (38) DOLFIN is a platform for research and teaching in adaptive Galerkin ﬁnite element methods developed by Hoﬀman and Logg. (35) 6 DOLFIN The validity of the subgrid model may be estimated by computing the modeling residual g − g and stability factors obtained from the solution of ˜ ¯ the dual problem. In [34]. and a multiadaptive ODE-solver with adaptive ﬁxed point iteration for the solution of the discrete equations on time slabs (the automation of discrete solution). p(t). ·). p). L(u. new possibilities open for the automation of optimization.

on some domain Ω. In fact. Figure 10: Simpliﬁed component diagram showing the modularized structure of DOLFIN. } } Table 1: Sketch of the speciﬁcation of the variational formulation of Poisson’s equation in DOLFIN. ShapeFunction v) { return (grad(u). the algorithm for the automatic assembly is just a couple of lines. and solve the linear system. 1 the variational (weak) formulation of (39) takes the form: Find u ∈ H 0 (Ω). faces. boundaries. and consist of the speciﬁcation of the two variational forms lhs and rhs. based on the automatic evaluation of variational forms. simple and clear at all levels. This automates a large part of the implementation of a solver. In the case of Poisson’s equation.and right-hand sides of (40). } real rhs(ShapeFunction v) { return f*v * dx. (40) The speciﬁcation of (40) in DOLFIN is given in Table 1. the algorithm becomes particularly simple: assemble the discrete system consisting of a matrix (the stiﬀness matrix ) and a vector (the load vector ). Automation of all parts of DOLFIN makes the implementation short. Automatic Assembly DOLFIN automatically assembles the discrete system representing a given variational formulation. v) dx = Ω Ω f v dx 1 ∀v ∈ H0 (Ω). cells. respectively. Adaptive Mesh Reﬁnement The concept of a mesh is central in the implementation of adaptive Galerkin ﬁnite element methods for partial diﬀerential equations.grad(v)) * dx. Other important concepts include nodes. 24 23 . Assuming homogeneous Dirichlet boundary conditions. and mesh hierarchies. as shown in Table 2. edges. such that ( u.class Poisson : PDE { real lhs(ShapeFunction u. representing the left.

the cells (triangles or tetrahedrons) are ﬁrst marked according to some criterion for reﬁnement. i. These concepts are all implemented as C++ classes in DOLFIN. ++n1) for (NodeIterator n2(n1).rhs(v). ++n2) cout << *n2 << endl. EdgeIterator. ++u) A(v.end().lhs(u. !v. !n1. A hierarchy of meshes. for (CellIterator cell(mesh). is automatically created. CellIterator. !n2.end(). such as the list of nodes contained in a mesh. To reﬁne a mesh. Both sparse and dense matrices are implemented. 25 Figure 12: Adaptive mesh reﬁnement of triangular and tetrahedral meshes in DOLFIN. before the mesh is reﬁned. that can be used for example in a multigrid computation. for (CellIterator c(m). as well as generic matrices only deﬁned through their action (multiplication with a given vector). 26 . as shown in Figure 11. see Figure 12. !cell. Algorithms operating on a mesh.dof) += pde. ++v) b(v. ++v) for (TrialFunctionIterator u(element).end(). !cell. Table 3: Iteration over all node neighbors n2 of the nodes n1 within all cells c of the mesh m. objects used for the traversal of aggregate structures. Table 3 provides an example of a code that displays all node neighbors of all nodes of all cells within a given mesh..dof().for (CellIterator cell(mesh). Iterators implemented in DOLFIN include a NodeIterator.end().v). !v. based on the algorithm given in [3]. and a MeshIterator. !c. Adaptive mesh reﬁnement is implemented in DOLFIN for triangular meshes (in 2D) and tetrahedral meshes (in 3D). ++cell) for (TestFunctionIterator v(element).end(). ++cell) for (TestFunctionIterator v(element).e. Figure 11: Class diagram of the basic mesh classes in DOLFIN. FaceIterator.end().end().dof()) += pde. u. Linear Algebra DOLFIN includes an eﬃcient implementation of the basic concepts of linear algebra: matrices and vectors. including adaptive mesh reﬁnement. Table 2: Sketch of the implementation of automatic assembly in DOLFIN. !u.end(). can often be expressed in terms of iterators. ++c) for (NodeIterator n1(c).

Current modules include solvers for Poisson’s equation. 15. and at the same time beneﬁts from this usage by incorporating new methods and solvers developed as a consequence of its usage. convection–diﬀusion. Multigrid A multigrid solver has recently been implemented in DOLFIN as part of a student project. and GiD. The new solver is developed with speciﬁc focus on the ability to handle stiﬀ problems and large-scale applications. and ultimately to realize the Automation of CMM. Puﬃn is currently used by students in a number of courses at Chalmers. convection–diﬀusion. the heat equation. speciﬁcation of general boundary conditions. and direct methods such as LU factorization. see improvements in the near future include the automatic evaluation of variational forms. automatic error estimation. The students follow a sequence of computer sessions and in each session implement a solver for a given model. a reform of education from basic to graduate level becomes necessary. the 28 . is currently being implemented in DOLFIN. the wave equation. a number of new features and improvements of existing features are necessary.Several algebraic solvers are implemented in DOLFIN. Multi-Adaptive ODE-Solver A general multi-adaptive ODE-solver. GMRES. support for general ﬁnite elements. In addition to OpenDX. based on IBM’s Visualization Data Explorer. such as the open-source program OpenDX. 17. DOLFIN has been designed to allow easy extension by addition of new ﬁle formats. linear algebra and iterative solvers. showing the beneﬁts of the open-source nature of DOLFIN. as the result of a merge with the existing multi-adaptive solver Tanganyika [43]. Puﬃn is a simple and minimal 2D implementation of FEniCS in GNU Octave (or MATLAB) designed for education. and BiCGSTAB. The potential impact of FEniCS as the computational tool in a reformed education is thus very strong. represents the ﬁrst coordinated eﬀort to meet these demands. Important areas of active development which will 27 With new tools available to science and engineering based on the Automation of CMM. Figure 13: Cross-sections of 3D turbulent ﬂow around a surface mounted cube computed with DOLFIN. linear elasticity. it functions as a tool in both research and education. and automatic model reduction. (Courtesy of Johan Hoﬀman) Easy Integration of New Modules New solvers/modules for speciﬁc models may easily be added to DOLFIN. Using a modular approach. 37]. incompressible Navier–Stokes (in preparation). including Poisson’s equation. 7 Puﬃn Limitations and Future Directions To reach a point where DOLFIN becomes attractive and useful to a wider audience. 16. These include preconditioned iterative methods such as CG. and the general multi-adaptive ODE-solver. support for a range of ﬁle formats. DOLFIN currently supports GNU Octave. 35. 41] and software (FEniCS). and the automatic integration of time-dependent partial diﬀerential equations using the multi-adaptive solver. including all features listed above. including automatic assembly and evaluation of variational forms. including automatic generation and solution of dual problems. Visualization DOLFIN relies on interaction with external tools for visualization. MATLAB. Post-processing (as well as pre-processing) is thus accomplished by implementation of the ﬁle formats needed for exchange of data. The Body&Soul-project. the heat equation. as discussed in [36. involving books [32.

8 Summary of Appended Papers PAPER I: Multi-Adaptive Galerkin Methods for ODEs I This paper introduces the multi-adaptive Galerkin methods mcG(q) and mdG(q) for initial value problems for ordinary diﬀerential equations and contains the a posteriori error analysis of the methods. PAPER VI: Explicit Time-Stepping for Stiﬀ ODEs This paper presents new ideas for adaptive stabilization of stiﬀ problems. In particular. based on ideas of adaptive stabilization of stiﬀ problems presented in PAPER VI. this paper contains the proofs of the a priori error estimates for the multi-adaptive methods mcG(q) and mdG(q). Figure 14: Solution of the bistable equation (12) in Puﬃn. in particular the adaptive algorithm based on the a posteriori error estimates from PAPER I. PAPER III: Multi-Adaptive Galerkin Methods for ODEs III: Existence and Stability This paper contains proofs of existence and stability for the discrete multiadaptive solutions. 29 30 Figure 15: Solution of the driven cavity problem for the Navier–Stokes equations in Puﬃn. This paper also discusses a number of applications of the multi-adaptive methods. PAPER IV: Multi-Adaptive Galerkin Methods for ODEs IV: A Priori Error Estimates Based on the stability estimates of PAPER III and a pair of special interpolation estimates proved in PAPER VII and PAPER VIII. PAPER II: Multi-Adaptive Galerkin Methods for ODEs II: Implementation and Applications Continuing from PAPER I. which is an important step in the proof of a priori error estimates for the multi-adaptive methods. PAPER V: Multi-Adaptive Galerkin Methods for ODEs V: Stiﬀ Problems This paper extends the applicability of the multi-adaptive methods to stiﬀ problems. making it possible to solve stiﬀ problems with explicit methods.bistable equation. the Navier–Stokes equations. and general systems of convection–diﬀusion–reaction equations (see Figure 14 and 15). . this paper discusses the implementation of the mcG(q) and mdG(q) methods. a new strategy for adaptive ﬁxed point iteration on time slabs is presented. and includes an evaluation of the performance of the multi-adaptive methods.

31 32 . This paper estimates the size of these jumps for the discrete multi-adaptive solutions. both for stiﬀ and non-stiﬀ problems. PAPER XI: Computational Modeling of Dynamical Systems This paper is a short note on the basic approach to automated computational modeling of dynamical systems. including the recursive construction of time slabs and adaptive ﬁxed point iteration on time slabs. PAPER IX: Algorithms for Multi-Adaptive Time-Stepping This paper presents the key algorithms for multi-adaptive time-stepping.PAPER VII: Interpolation Estimates for Piecewise Smooth Functions in One Dimension This paper contains basic interpolation estimates for piecewise smooth functions. in particular to large mass-spring systems modeling deformable solids. These estimates are used in the a priori error analysis of the multiadaptive methods. The performance of the multi-adaptive methods is examined. PAPER X: Simulation of Mechanical Systems with Individual Time Steps This paper discusses the application of the multi-adaptive methods to mechanical systems. where interpolation estimates are needed for functions with discontinuities. PAPER VIII: Estimates of Derivatives and Jumps Across Element Boundaries for Multi-Adaptive Galerkin Solutions of ODEs The interpolation estimates proved in PAPER VII are expressed in terms of the jumps in function values and derivatives at the points of discontinuity for the interpolated function.

2003. 1879. Journal of Parallel and Distributed Computing. Dahlquist. 1142–1157. 2003. Logg. and L.H. . Dawson and R. SIAM J. 1729–1749. Logg et al. Rep. 33 34 . Variational methods for the solution of problems of equilibrium and vibrations. [16] [17] . Hansbo. Johnson and A. Springer Series in Computational Mathematics.se/dolﬁn/. Dreams of Calculus — Perspectives on Mathematics Education. Tetrahedral grid reﬁnement. M2 AN. Parallel treeSPH.. Numer. Johnson. Springer-Verlag. I. [36] [37] . [39] C. Johnson. Numer. 706–740. .C. Tech.S. Stability and Error Bounds in the Numerical Integration of Ordinary Diﬀerential Equations. Johnson.R. . . Adaptive ﬁnite element methods for parabolic problems II: Optimal order error estimates in l∞ l2 and l∞ l∞ . Anal. Logg. Estep and D. Eriksson. Springer-Verlag. [40] C. [28] D. Marsden. Johnson. SIAM. Computational modeling of dynamical systems. Eriksson. pp. [15] K. Algorithms for multi-adaptive time-stepping. Anal. SIAM J. Johnson. [42] A. Rational. Dynamical Systems. J. 1996.. (2004). Larson. pp. [5] J. 55 (1995). Teresco. 2004. [26] D. [25] . 1991. Estep. Syst. and S. [30] . 7 (1994). SIAM J. Hoffman. Numer. 25 (1988). pp. [14] . J. Johnson. 1315–1325. C. Adaptive ﬁnite element methods for parabolic problems III: Time steps variable in space. Anal.P. Anal. [10] C. to appear in Encyclopedia of Computational Mechanics. Adaptive ﬁnite element methods for parabolic problems V: Long-time integration. Anal. B. pp. 49 (1943). Applied Mathematics: Body and Soul. Logg.phi. C. SIAM J. Johnson. [33] J... D. Shephard. Soc. [18] K. Multi-adaptive Galerkin methods for ODEs V: Stiﬀ problems. J. 32 (1995). [8] G. 2003–21. 277–297. (2004). Applied Mathematics: Body and Soul vol. 2004. Rannacher. C. and A. Error estimates and adaptive time-step control for a class of one-step methods for stiﬀ ordinary diﬀerential equations. Jansson. Introduction to adaptive methods for diﬀerential equations.. SIAM J. 897–908. and M. and L. pp.C. Math. [31] J. 2 e (1997). Stockholm University. Castigliano. SIAM J. 36 (1981). Johnson.K. 1445–1462. Comp. Dupont. Applied Mathematics: Body and Soul. submitted to ACM Trans. 2002–06. vol. Comput. Adaptive ﬁnite element methods for parabolic problems VI: Analytic semigroups. Kirby. Hernquist. [4] B. 47 (1997). Dyn. Courant. Asynchronous variational integrators. [29] E. Th´orie de l’´quilibre des syst`mes ´lastiques et ses applicae e e e tions. 32 (1995). Topics in adaptive computational methods for diﬀerential equations. An optimal control approach to a posteriori error estimation in ﬁnite element methods. Becker and R. New Astronomy. Estep. Delfour. 105–158. Computational Diﬀerential Equations. Adaptive ﬁnite element methods for parabolic problems IV: Nonlinear problems. Scott. 1750–1763.. C. Nonlinearity. SIAM J.M..A. A posteriori error bounds and global error control for approximations of ordinary diﬀerential equations. Eriksson and C. Cambridge University Press.G. Computer Methods for Ordinary Diﬀerential Equations and Diﬀerential-Algebraic Equations. W. Numer. pp. Hoffman. Rep. and C. Hoffman and A. Anal. Explicit time-stepping for stiﬀ ODEs. vol. SIAM J. M. A.. Global error control for the continuous Galerkin ﬁnite element method for ordinary diﬀerential equations. Eriksson. in preparation. Wanner. [13] K. Bey. The Numerical Analysis of Ordinary Diﬀerential Equations — Runge– Kutta and General Linear Methods. Logg. Sci.. Anal. [34] J. Numer. Galerkin. Trochu. 1 (1991).. Torino. 355–378. Springer-Verlag. [19] [20] [21] [22] . Hoffman.G. Flaherty. pp. [35] J. High resolution schemes for conservation laws with locally varying time steps. [38] J. Chalmers Finite Element Center Preprint Series.References [23] K. Simulation of mechanical systems with individual time steps. Eriksson. submitted to BIT. [3] J. 1–48. [7] R. pp. [24] K. 8. DOLFIN: Dynamic Object oriented Library for FINite element computation. Comput. Hairer and G. 2002. French. 908–926. An analysis of numerical approximations of metastable solutions of the bistable equation. 2256–2281. and A. to appear in M 3 AS. Solving Ordinary Diﬀerential Equations II — Stiﬀ and Diﬀerential-Algebraic Problems. West. PhD thesis. Series solution of some problems in elastic equilibrium of rods and plates.. D.. 1987. Wiley. P. Lew. R. Softw. (2004). pp.E.E. DOLFIN. Dav´. 85–146. [41] C. pp. 43–77. [1] U. Logg. Logg. Larsson. (1995). Arch. Petzold. A. Discontinuous Galerkin methods for ordinary diﬀerential equations. Jansson and A. 6 (2001). 139–152. Ziantz. pp. Applied Mathematics: Body and Soul. [12] T.. and L. vol. pp. Appl. Numer. [11] M. vol. 167 (2003). Kirby. Ortiz. 2003. 1958. Hoffman and A. (2004). http://www. SIAM J. Adaptive ﬁnite element methods for parabolic problems I: A linear model problem. Solving Ordinary Diﬀerential Equations I — Nonstiﬀ Problems. 22. Adaptive local reﬁnement with octree load balancing for the parallel solution of three-dimensional conservation laws. Loy. Adaptive computational methods for parabolic problems. and A. IV. (2001). No. 2003.. Dubinski. 1991. II. Tech. Butcher. 815–852.chalmers. 455–473. pp. Anal. Springer Series in Computational Mathematics. Mech. 25 (2003). and F. M. Estep. Chalmers Finite Element Center Preprint Series. 19 (1915). Negro ed. . Math. [27] . and C. pp. Logg. Amer. C.D. pp. III. Sci. 10 (2001). No. The FEniCS project. pp. pp. CEDYA 2001: Congreso de Ecuaciones Diferenciales y Aplicaciones. 1–23. Springer-Verlag. pp. R. Acta Numerica. pp. J. [2] R. 28 (1994). Logg.. Johnson. Hager.. 28. Szymanski. 1998. Springer-Verlag. [32] J. J. [9] R. 35 (1998). Numer. vol. 14. Math. submitted to SIAM J. Computing. [6] C. Bull. and A. 32 (1995). M. Vestnik inzhenerov i tekhnikov. 32 (1995). Johnson. (2004).F. Acta Numerica. Ascher and L.

.C. Fix. Estimates of derivatives and jumps across element boundaries for multiadaptive Galerkin solutions of ODEs. 135 (1908). Numerical Solution of Ordinary Diﬀerential Equations. Prentice-Hall. [44] [45] [46] . Multi-adaptive time-integration. 36 (1983). SIAM J. ¨ [56] W.B.. 35 . o 1996. Interpolation estimates for piecewise smooth functions in one dimension. Osher and R. [55] R. [53] S. 2004.. [47] [48] [49] [50] [51] J. J. The Mathematical Theory of Finite Element Methods. Springer-Verlag. Eng. Japan. On a Hermite integrator with Ahmad-Cohen scheme for gravitational many-body problems. [57] R. Sci. and J. Applied Numerical Mathematics. . pp. Sci. Comput. 2004–02. 1119–1141. Adaptive Finite Element Methods for Reactive Flow Problems. http://www. Rep. 2004. Kirby. 41 (1983). (2003). 1994. reine angew. [54] P. Soc. Multi-adaptive Galerkin methods for ODEs II: Implementation and applications. pp. pp. Uber eine neue Methode zur L¨sung gewisser Variationsprobleme der o mathematischen Physik. Tech. Sanders. pp. Chalmers Finite Element Center Preprint Series. . Publ.-ASCE. . Math. ICARUS. 241–254. Newton. G¨teborg.. Mech. pp. Math.R. Numer. 1994. 1687. 25 (2003). 109 (1983). Multi-adaptive Galerkin methods for ODEs IV: A priori error estimates. Logg.C. 321–336. . 2004–03. submitted to SIAM J. pp. Computer Methods in Applied Mechanics and Engineering.chalmers. Comp. Ciarlet. pp.G.se/tanganyika/. Numerical Analysis of the Finite Element Method. 24 (2003). Element-by-element implicit algorithms for heat-conduction. I. pp. Brenner and L. 1–61. Englewood Cliﬀs.G. [52] I. Ritz. J. 1973. . 48 (2004). I–III. An Analysis of the Finite Element Method. Comp. Les Presses de l’Universite de Montreal. submitted to SIAM J. 141– 151. Chalmers University of Technology. Winget. A linear algebraic approach to representing and computing ﬁnite elements. 339–354. . [63] . [58] S. Scott. [60] L. 1976. Numer. Strang and G. (2004). Astron. pp.[43] A. vol.. Chalmers Finite Element Center Preprint Series. SIAM J. Multi-adaptive Galerkin methods for ODEs III: Existence and stability. [61] G. Anal. Levit. Rep. [62] T. Numerical approximations to nonlinear conservation laws with locally varying time and space grids. Makino and S. Tech. Comput. Alexander and C. 576–585.phi. Aarseth. PhD thesis. submitted to Math. Philosophiae Naturalis Principia Mathematica. n-body simulations of late stage planetary formation with a simple fragmentation model. 113–124. 44 (1992). (2004).J.R Hughes.. Shampine. Anal. An element-by-element solution algorithm for problems of structural and solid mechanics. Department of mathematics. Chapman & Hall. Sandboge. Multi-adaptive Galerkin methods for ODEs I..J. 1879–1902. Tanganyika. [59] S. Agnor. 132 (1998).

12. and we seek an approximate solution U (t) = (Ui (t)) such that Ui (t) is a polynomial of degree qij on every local interval Iij . To discretize (1. 2. The methods presented in this paper fall within the general framework of adaptive Galerkin methods based on piecewise polynomial approximation (ﬁnite element methods) for diﬀerential equations. To measure the error we choose a norm. The entire collection of individual time-intervals {Iij } may be organized j=1 into a sequence of time-slabs. In this paper. [31. 1879–1902 c 2003 Society for Industrial and Applied Mathematics 1880 ANDERS LOGG MULTI-ADAPTIVE GALERKIN METHODS FOR ODES I∗ ANDERS LOGG† Abstract. i = 1. S1064827501389722 1. 14. t ∈ (0. A prime example to be studied in detail below is our own solar system. . 10. 5] or [25]—but a general methodology has been lacking. where the moon orbits around Earth once every month. attempts have been made to construct methods with ˙ individual (locally varying in space) time-steps. 2001. accepted for publication (in revised form) November 13. published electronically May 2.j−1 . 24. 24. 6. so that in particular each individual component has its own time-step sequence... all chosen adaptively in a computational feedback process.se). individual time-stepping for ODEs has received little attention in the large literature on numerical methods for ODEs. T ] into Mi subintervals. e. an analysis of their basic properties. 17. . SCI.html † Department of Computational Mathematics. we derive a posteriori error estimates for the two methods based on duality arguments. Individual time-steps and order. The outline of the paper is as follows: In section 2 we summarize the key features of the multi-adaptive methods. individual time-steps. The ODE (1. COMPUT. Basic properties of these methods. . we apply the multi-adaptive methods to a variety of problems to illustrate the potential of multiadaptivity. Iij = (ti. and T > 0 is a given ﬁnal time. multi-adaptivity. and monotonicity. 21. in particular for conservation laws of the type u + f (u)x = 0.g. we allow for individual timesteps. mdG(q) AMS subject classiﬁcations. Chalmers University of Technology. global error control. where a method based on the original work by Osher and Sanders [33] is presented for conservation laws in one and two space dimensions. 65L20. covering many areas of applications.2. T ] → RN . {kij }Mi . whereas the period of Pluto is 250 years. This goal includes an aspect of reliability (the error should be less than the tolerance) and an aspect of eﬃciency (minimal computational work). f : RN × (0. a partition of the time-interval (0. as illustrated in Figure 2. [11. energy conservation. For time-dependent PDEs. order and quadrature.chalmers. 22.1. e. using a minimal amount of computational work. section 6. o Euler time-stepping.SIAM J. . No. For speciﬁc applications. Taking adaptivity one step further. such as the Euclidean norm · on RN . tij ]. we present adaptive algorithms for time-stepping and global error control based on the results of the current paper. t). 2002.1) models a very large class of problems. 1. . Our aim is to ﬁll this gap. 2. are discussed in section 5. 13.org/journals/sisc/24-6/38972. We believe that our work on multi-adaptive Galerkin methods (including error estimation and arbitrary order methods) presents a general methodology to individual time-stepping. [20] have constructed a method based on the discontinuous Galerkin method combined with local forward ∗ Received by the editors May 23. 3.1) U (T ) − u(T ) = (R. pp. 34]. 2. including the continuous Galerkin method cG(q) of order 2q. We also prove an a posteriori error estimate for stability factors computed from approximate dual solutions.. Surprisingly. Each individual component Ui (t) thus has its own sequence of time-steps. local time-steps. Logg. and quadrature errors. In the accompanying paper [A. discontinuous Galerkin. T ] → RN is a given bounded function that is Lipschitz-continuous in u. 0 1879 . developed by Johnson and coworkers (see. In numerical simulations of the solar system. Vol. which will result in eﬃcient integrators also for time-dependent PDEs. including (i) time-step length.. Introduction. The mathematical basis of global error control in · for mcG(q) is an error representation of the form T (2. 16. (ii) order. we present multi-adaptive Galerkin methods for initial value problems for systems of ODEs of the form (1. methods with individual time-stepping have been used—see. 65L05. SIAM J. In the companion paper [29].1) u(t) ˙ u(0) = = f (u(t). Key words. The techniques for error analysis used in these references. Key features. and (iii) quadrature.siam. submitted]. such as the n-body problem. 65L70 PII.000. including Galerkin errors. the time-steps needed to track the orbit of the moon accurately are thus much less than those required for Pluto.g. ODE. .g. and [8] in particular) naturally carries over to the multi-adaptive methods. In the major part of this paper. SE–412 96 G¨teborg. A similar approach is taken in [6]. We present multi-adaptive versions of the standard continuous and discontinuous Galerkin methods for ODEs. u0 . ϕ) dt. Earlier work on adaptive error control for the cG(q) and dG(q) methods include [7. Flaherty et al. 65L60. u0 ∈ RN is a given initial condition. We use the term multi-adaptivity to describe methods with individual time-stepping for the diﬀerent components ui (t) of the solution vector u(t) = (ui (t)). . we extend the cG(q) and dG(q) methods to their multi-adaptive analogues mcG(q) and mdG(q). and the discontinuous Galerkin method dG(q) of order 2q + 1. Typically the time-steps used are based on local CFL conditions rather than error estimates for the global error and the methods are low order in time (meaning ≤ 2). http://www. such as order. 19]. 2003. Mi . numerical errors. we introduce for each component. Sweden (logg@math. Sci. see. This paper contains a description of the methods. [4. collecting the time-intervals between certain synchronised time-levels common to all components. where u : [0.1.1). mcG(q). Comput. 65L07. continuous Galerkin. adaptivity. N . . more precisely. 18. Often diﬀerent solution components have diﬀerent time-scales and thus ask for individual time-steps. and a posteriori error analysis. Global error control. We summarize the key features of our work on the mcG(q) and mdG(q) methods as follows. e. 15]. and in section 3 we discuss the beneﬁts of the new methods in comparison to standard ODE codes. j = 1. or more generally some other quantity of interest (see [32]). 65L50. We then motivate and present the formulation of the multi-adaptive methods mcG(q) and mdG(q) in section 4. T ]. the diﬀerence in time-scales being roughly a factor 3. Our goal is to compute an approximation U (T ) of the exact solution u(T ) at ﬁnal time T within a given tolerance TOL > 0.

ϕ(t) is the solution of an associated linearized dual problem. Mi . and where P q (I) denotes the linear space of polynomials of degree ≤ q on I. .1) 0 ˙ (U . . However. and thus the right-hand side of (2. the error representation can be converted into an error bound of the form N (2. . By solving the dual problem numerically.5. . . In this section we present the multi-adaptive Galerkin methods.2) may be evaluated. . Iterative methods.1. j = 1.4. Multi-adaptive Galerkin. Applications. mcG(q) and mdG(q). Mi . see.j−1 ) given.2) U (T ) − u(T ) ≤ i=1 Si (T ) max ki (t)qi (t) |Ri (U. . T ˙ where R = (Ri ) = R(U.1. Individual time-discretizations for diﬀerent components. j = 1. N }. i = 1. We take the opposite view: global error control is always needed and often possible to obtain at a reasonable cost. Standard ODE codes use timesteps which are variable in time but the same for all components.1) as a number of successive local problems for each component: For i = 1. expanding the scope to multi-adaptivity with individual stability factors for the diﬀerent components. The trial functions in V are thus continuous piecewise polynomials. For a presentation of the traditional approach to error estimation in ODE codes. 2. the solar system. Using the Galerkin orthogonality. Solving these systems with full Newton may be quite heavy. depending on the i=1 dual solution ϕ(t). ϕ) dt is bounded in terms of R and ϕ. an essential diﬀerence is thus the technique to estimate the global error: either by clever trial-and-error or.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1881 1882 ANDERS LOGG i 3. T ])]N : vi |Iij ∈ P qij (Iij ). We have implemented mcG(q) and mdG(q) in C++ for arbitrary q. The error bound may T take diﬀerent forms depending on how 0 (R.3. by solving the dual problem and computing the stability factors. . and the test functions in W are discontinuous piecewise polynomials that are locally of degree qij − 1. Noting that the test functions are discontinuous.1) {global error} ≤ S max{local error}. which in practice means 2q ≤ 50. and for each system we solve the dual problem to collect extensive information about the problems stability features. and where ki (t) = kij . i = 1. The adaptive algorithm seeks to satisfy the stopping criterion N where S is a stability factor. ·). N . ·)v dt ∀v ∈ P qij −1 (Iij ). . ·) is the RN scalar product. . . see [29].3) i=1 Si (T ) max ki (t)qi (t) |Ri (U. corresponding to (2. . {v : vi |Iij ∈ P qij −1 (Iij ). j = 1. the individual stability factors Si (T ) may be determined approximately. Comparing the adaptive error control of standard ODE codes with the error control presented in this paper and the accompanying paper [29]. 0≤t≤T with maximal time-steps k = (ki (t)). We have applied mcG(q) and mdG(q) to a variety of problems to illustrate their potential. where the following rather pessimistic view is presented: Here we just note that a precise error bound is often unknown and not really needed. locally of degree qij . we demonstrate the use of individual time-steps. and a number of time-dependent PDE problems.3) Iij ˙ Ui v dt = Iij fi (U. ﬁnd Ui |Iij ∈ P qij (Iij ) with Ui (ti. Both mcG(q) and mdG(q) give rise to systems of nonlinear algebraic equations. PSfrag replacements Iij 0 kij Fig. Comparison with standard ODE codes. e. 2. as we prefer. such that T (2. . t) is the residual vector of the approximate solution U (t). we refer to [2]. is described in more detail in [29] and is publicly (GNU GPL) available for Linux/Unix [30]. . t) = U (t)−f (U (t). we can rewrite the global problem (4. 2. .2) V W = = {v ∈ [C([0. 4. which can be used for global error control. of the form (3. t)| ≤ TOL. trial-and-error becomes very diﬃcult or impossible. 4. [32] for a comparison. and we have instead successfully used diagonal Newton methods of more explicit nature. The global error connects to the local error through an estimate. v) dt ∀v ∈ W. v) dt = 0 T (f (U. qi (t) = qij for t ∈ Iij . where (4. The implementation. 0≤t≤T where {Si (T )}N are stability factors for the diﬀerent components. The mcG(q) method for (1.) In these applications.g. N }. 2. . (4. . Both approaches carry extra costs and what is best may be debated. which means that the connection between the global error and the local error is left to be determined by the clever user. such that (4. Standard codes do not compute S. . t)|. (See also [27] and [26]. coupling the values of U (t) over each time-slab. .2). and the methods for adaptive time-stepping and error control presented below based on solving the dual problem seem to bring clear advantages in eﬃciency and reliability. Tanganyika. and the time-steps are adaptively chosen by keeping the “local error” below a given local error tolerance set by the user. and (·. typically by computing with a couple of diﬀerent tolerances. We hope that multi-adaptivity will bring new life to the discussion on eﬃcient and reliable error control for ODEs.1.1) reads as follows: Find U ∈ V with U (0) = u0 . . . . . including the Lorenz system. . Implementation of higher-order methods.. based on the discretization presented in section 2. Mi . . The mcG(q) method.

qij j = 1. .) Making an ansatz for the solution in terms of some nodal basis. [q] q {wm }m=1 ⊂ P q−1 (0. Some of the components could therefore be solved for using the mcG(q) method. 4. Energy conservation for mcG(q).j−1 ˙ Ui v dt = Iij Iij [q] fi (U. qij − (4.. .7) in the form (4.10) − ξijm = ξij0 + Iij [q wmij ] (τij (t)) fi (U (t). Notice also that if we deﬁne the residual R of the approximate ˙ solution U as Ri (U. Notice that this is similar to (4. . . The corresponding properties hold for the multi-adaptive methods. j = 1. m = 1.. . reads as follows: For i = 1. where the weight functions. see. where [·] denotes the jump.5) using nodal quadrature. For simplicity and eﬃciency reasons.11) ξijm = ξij0 + kij n=0 −1 [q −1 [q [qij wmn ] fi (U (τij (sn ij ] )). i. Mi .5) ξijm = ξij0 + Iij q [q wmij ] (τij (t)) fi (U (t). . 4. as well as adaptive time-steps.1. for certain weights {wmn } and certain nodal points {sn } (see the appendix). i. m = 1.9) [Ui ]i. [3].7) [Ui ]i. It turns out that for both methods.j−1 Ri (U. the zeros of Pq (x) + Pq+1 (x) on the interval (with time reversed so as to include the right end-point). i. N .3) as (4. or.1) x=− ¨ x P (x). . 5. . we obtain a fully discrete scheme in the form of an implicit Runge–Kutta method: For i = 1. . so that by the continuity requirement ξij0 = ξi. . . 5.4. We consider a Hamiltonian system. 1) are corresponding polynomial weight functions. Here we assume that the solution is expressed in terms of a nodal basis with the end-points included. ·)v dt = 0 ∀v ∈ P qij (Iij ).. and monotonicity.e. .e. . Ri (U. See [28] for a detailed discussion on this subject. ﬁnd Ui |Iij ∈ P qij (Iij ). m = 0. Choosing basis functions and quadrature.2. Iij . .7) on every local interval: (4. where Pq is the qth-order Legendre polynomial on the interval. . Basic properties of the multi-adaptive Galerkin methods.qi. ij where {ξijm }m=0 are the nodal degrees of freedom for Ui (t) on the interval Iij . the zeros of xPq (x) − Pq−1 (x).2. applying nodal quadrature. mcG(q) is of order 2q and mdG(q) is of order 2q + 1. . 1]: τij (t) = (t − ti. (5.3). . i = 1. In this section we examine some basic properties of the multi-adaptive methods. the nodal points. We now prove that also the mcG(q) method has this property. . we get. with the natural restriction that we should use the same time-steps for every pair of positions and velocities.11) is to choose basis functions and quadrature. it is desirable to let the nodal points for the nodal basis coincide with the quadrature points. . . ﬁnd {ξijm }m=0 . t).4) to include the left end-point of the interval Iij . N . Making an ansatz for every component Ui (t) on every local interval Iij in terms of a nodal basis for P qij (Iij ) (see the appendix). The mdG(q) method in local form. . assuming that the exact solution u is smooth. . t) = Ui (t) − fi (U (t). . qij . . we choose the Radau quadrature points. Mi . Order. including order. t) dt. In the same way as for the continuous method. this means that in order to solve the local problem for component Ui1 (t) we need to know the values of component Ui2 (t) and vice versa.j−1 ).j−1 v(t+ ) + i. i.4) if we extend the integral in (4. N }. m = 0. our focus will be mainly on adaptive time-steps. . We examine this in more detail in subsequent papers. . deﬁned on the inner of every local interval Iij . .3). . .e.6) ξijm = ξij0 + kij n=0 [q] −1 [q −1 [q [qij wmn ] fi (U (τij (sn ij ] )). . We refer to this as the Galerkin orthogonality for the mcG(q) method.4) Iij We refer to this as the Galerkin orthogonality for the mdG(q) method. for the mdG(q) method. t). . . τij (sn ij ] )). . while for others we use the mdG(q) method. On a global level.e.3. What remains in order to implement the two methods speciﬁed by (4. Although the formulation thus includes adaptive orders and methods. . by Ui (0− ) = ui (0). the following explicit version of (4. . such that (4. .g. respectively. The multi-adaptive mcG(q)-mdG(q) method. as for the continuous method. with ξij0 given by the continuity requirement.j−1 v(t+ ) + i. The solution is thus implicitly deﬁned by (4. . 4. . Mi . qij ..j−1 . t) dt. We thus choose the q + 1 Lobatto quadrature points for the mcG(q) method. i.8) V = W = {v : vi |Iij ∈ P qij (Iij ). the trial and test spaces are given by (4. . energy conservation. evaluating the integral in (4. Finally. ·)v dt = 0 ∀v ∈ P qij −1 (Iij ).. and we rewrite (4.j−1. and τij maps Iij to (0. the mcG(q) and the mdG(q) methods. j = 1. we deﬁne the residual R of the ap˙ proximate solution U as Ri (U. qij . The mdG(q) method. If thus component Ui1 (t) couples to component Ui2 (t) through f . ·)v dt ∀v ∈ P qij (Iij ). the residual is orthogonal to the test space on every local interval. e. The discussion above for the two methods extends naturally to using diﬀerent methods for diﬀerent components. .. t) = Ui (t) − fi (U (t).MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1883 1884 ANDERS LOGG We notice the presence of the vector U (t) = (U1 (t). UN (t)) in the local problem for Ui (t) on Iij . .6) and (4. . .e. . such that qij (4. . this is possible to achieve in a natural way. (The derivative of the discontinuous solution is a Dirac delta function at the end-point. . The standard cG(q) method is energy-conserving for Hamiltonian systems. [v]ij = v(t+ ) − v(t− ). qij . We can even change methods between diﬀerent intervals. corresponding to (4. we can rewrite (4. N .3) as (4. The standard cG(q) and dG(q) methods are of order 2q and 2q + 1. . 5. τij (sn ij ] )). The resulting discrete schemes are related to the implicit Runge–Kutta methods referred to as Lobatto and Radau methods. and the weights are not the same as for the continuous method. we can rewrite (4.j−1 )/(tij − ti. and the initial condition is ij ij speciﬁed for i = 1. .

We now prove the corresponding property for the discrete mcG(q) solution of (5. with data ϕT and right-hand side g. The dual problem. e.7) on the same partition. 6.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I N 1885 1886 ANDERS LOGG ˙ ¨ on (0.1. v). on [0. 2 [Wi ]i.1) where (6.j−1 Wi.1) with x it is easy to see that energy is conserved for the continuous ˙ problem. ·). we will make use of the continuous dual. at every synchronized time-level t. ·)ϕ + g ϕT . Following the procedure outlined in the introduction. together with initial conditions for x and x.j−1 + ij Iij ˙ Wi Wi dt ≤ 0. ¯ then. dt ¯ ¯ and thus K(t) + P (t) = K(0) + P (0). which by Newton’s second law is balanced by the force F (x) = − x P (x) for some potential ﬁeld P . T .7) ¯ ¯ U (t− ) − V (t− ) ≤ U (0− ) − V (0− ) . for given functions v1 (t) and v2 (t). see [23]. V ) be the mcG(q) solution to (5.3) with (5. ·) − f (V. Monotonicity. T ). (5. u − v) ≤ 0 ∀u.1. U − V ) dt ≤ 0. we obtain error estimates for diﬀerent quantities of the computed solution. With u = x and v = x we rewrite (5. Here x is the acceleration. v ∈ RN .5) ¯ ¯ K(t) + P (t) = K(0) + P (0). V ) dt + (P (t) − P (0)) = 0) but can also be obtained in the case of quadrature. deﬁned by (4. A posteriori error analysis.2). For the a posteriori error analysis of this section.7) for U and V .2. we have (5. including quadrature and discrete solution errors. and subtracting the two equations. Theorem 5. ·). Choosing the data and right-hand side appropriately. 2 1 W (0− ) 2 2 + 1 W (T − ) 2 2 ≤ + [Wi ]i. U ) dt = 0 ¯ t ˙ − P (U )U dt = − ¯ t 0 d ¯ P (U ) dt = −(P (t) − P (0)).j−1 Wi. we deﬁne.1) with initial data U (0 ) and V (0− ). The dual problem comes in two diﬀerent forms: a continuous and a discrete. i.2) deﬁned by (4. (5. ˙ then we may choose V as a test function in the equations for U .. The multi-adaptive continuous Galerkin method conserves energy in the following sense: Let (U. To set up the continuous dual problem. U may be chosen as a test function in the equations for V to get ¯ t 0 ˙ ˙ (V . . v2 . If every pair of positions and velocities have the same time-step sequence.j−1 + ij ˙ Wi Wi dt = Iij 0 T (f (U. The discrete dual problem is used to prove a priori error estimates.j−1 Wi.g. The total energy E(t) is the sum of the kinetic energy K(t) and the potential energy P (x(t)). T . In this section we prove a posteriori error estimates for the multi-adaptive Galerkin methods.. 2 Proof.j−1 ) we get − so that W (T − ) ≤ W (0− ) .. ·) − f (v. Let U and V be the mdG(q) solutions of (1. E(t) = E(0) for all t ∈ [0. ·).e. We (q ) shall assume below that the dual solution has q continuous derivatives (ϕi ij ∈ C(Iij ) locally on interval Iij ) for the continuous method and q + 1 continuous derivatives (q +1) (ϕi ij ∈ C(Iij ) locally on interval Iij ) for the discontinuous method. V ) dt = 2 ¯ t 0 d V dt 2 ¯ dt = K(t) − K(0).j−1 + Iij ˙ Wi Wi dt E(t) = K(t) + P (x(t)). Remark 5.3) −ϕ ˙ ϕ(T ) = = J ∗ (u. = = + − 2 − + 1 1 2 2 (Wi. e. Then at every synchronized time-level t. T ] with x(t) ∈ R . such as. such as. using the positivity of the quadrature weights.1) as ˙ (5.3. summing over the local intervals. t) = 0 ∂f (sv1 (t) + (1 − s)v2 (t). 1 = 1 v(t) 2 . ·)(v1 − v2 ) = = 1 0 1 0 ∂f ∂u (sv1 ∂f ∂s (sv1 + (1 − s)v2 . ·) ds = f (v1 .2) ∗ J ∗ (v1 (t).g. respectively.j−1 ) + 2 (Wij ) − Wi. Theorem 5. t) ds ∂u ∗ . Energy conservation requires exact integration of the right-hand t ˙ ˙ side f (or at least that 0 (U . ·) ds (v1 − v2 ) The continuous dual problem is then deﬁned as the following system of ODEs: (6. Remark 5. Assume that the same time-steps are used for every pair of positions and corresponding ¯ velocities. with K(t) = 1 V (t) 2 and P (t) = P (U (t)).. Multiplying (5. we have + [Wi ]i. v2 (t). we ﬁrst deﬁne the dual linearized problem and then derive a representation formula for the error in terms of the dual and the residual. The proof is completed noting that the same analysis applies with T replaced by any ¯ other synchronized time-level t. i. Choosing the test function as v = W = U − V in (4.2) u ˙ v ˙ = v F (u) = fu (v) fv (u) = f (u.6) (f (u.3). V ) dt = 0 ¯ t 1 ˙ (V. The proof extends to the fully discrete scheme.2. − (6.j−1 + 2 (Wij ) − (Wi. If the righthand side f is monotone. we have (5. and we note that J(v1 . 5. + (1 − s)v2 . We shall prove that the mdG(q) method is B-stable (see [3]). U.4) K(t) = 1 x(t) ˙ 2 2 Noting that + [Wi ]i.e. denotes the transpose. to get ¯ t 0 ˙ ˙ (U .j−1 Wi. 6.1. ˙ Similarly.j−1 − 2 − 1 1 2 2 . ·) − f (v2 . Proof. T ].

j−1 ϕi (ti.6 below may be of use in an actual implementation. We emphasize that all of the estimates derived in Theorems 6.g (e) = = = ij ij ij Iij Iij Iij dt. ˙ Iij Iij so that ij Iij −ei ϕi dt ˙ = = ij [ei ]i. We can now prove a posteriori error estimates for the mcG(q) and mdG(q) methods. ·))ϕi dt. j=1 Cqij −1 kij i=1 [qi ] N qi max[0. .j−1 .5) e(T ) = i=1 j=1 Ri (U. kij ). we have |f (x) − π [q] f (x)| = ≤ 1 q! x x0 Proof. (ei + fi (u. dt. 6. .1 and the Galerkin orthogonalities.j−1 ) ˙ ˙ (Ui − fi (U.3. j = 1. t) = Ui (t) − fi (U (t).Rn ) = 0 v dt. Theorem 6.RN ) = i=1 j=1 Ri (U.j−1 ϕi (ti.10) E2 E3 E4 E5 = = = = = = N Mi i=1 j=1 Iij Ri (U. which completes the proof. such that (6.1).T ] {Cqi −1 ki i ri } . Theorem 6. g) dt = 0 i=1 j=1 Ri (U. The quantities E4 and E5 may be used for qualitative estimates of error growth.T ].j−i ij ei ϕi dt. ˙ 0 Thus. ·)ϕ) dt T −ei ϕi dt + 0 (−J(u. then N Mi Iij (6.5 and 6. . We now apply this theorem to represent the error in various norms.j−1 ) . N . ·)(ϕi − πk ϕi ) N Mi j=1 Iij |Ri (U.j−1 ) T (e. If ϕT = e(T )/ e(T ) and g = 0.j−1 ) ij [Ui ]i. ϕ) dt (f (u. ·))ϕi dt + [Ui ]i.j−1 ) Ri (U.9). Mi . ·) − fi (U. t) via the dual solution ϕ(t). ·)e. t). We thus have Cqi = Cqi (t) = Cqij for t ∈ Iij . ·)||ϕi − πk ϕi | i=1 qij +1 [q ] N Mi rij sijij .4) T N Mi Iij Corollary 6. . Assume also that U is right-continuous at T . .3) with right-hand side g(t) and initial data ϕT .[0. Iij i 1 q+1 1 k 2q q! k |f (q+1) (y)| dy. the errors of the mcG(q) or mdG(q) approximations. U. then there is a constant Cq . We typically use E2 or E3 to adaptively determine the time-steps and E0 or E1 to evaluate the error. assuming exact quadrature and exact solution of the discrete equations. |LϕT . t) = ˙ U (t) − f (U (t). LϕT . ϕT ) + T (e.1.j−1 ϕi (ti.j−1 ) − ei (t− )ϕ(tij ) + ˙ i. i = 1.6) e L1 ([0.T ]. The basis for the error analysis is the following error representation.e.j−1 ) . Let U be a piecewise polynomial approximation of the exact solution u of (1. ·)ϕi dt + [Ui ]i. If f ∈ C q+1 ([a. The estimates come in a number of diﬀerent versions. k = b−a. ·) 0 ij f (q+1) (y)(y − x0 )(q) dy b a − f (U. We ﬁrst prove the following interpolation estimate. and deﬁne the residual of the approximate solution U as R(U. Integrating by parts. U. ϕT ) + (e. we get −ei ϕi dt = ei (t+ )ϕ(ti..8) and (6.g (e)| = E0 ≤ E1 ≤ E2 ≤ E3 ≤ E4 |LϕT .1) and thus in particular the mcG(q) and mdG(q) approximations.j−1 ϕi (ti.1 N maxi.g (e)| ≤ E2 ≤ E5 . ·) − fi (U. we have using (6.2. (4. ·). dt . Galerkin errors. Using Taylor’s formula with the remainder in integral form. Then the error e = U − u satisﬁes (6.4) and (4. [q]. expressing the error of an approximate solution U (t) in terms of the residual R(U. g) 0 dt = = = = T (e. As before. depending only on q.2) T (e. we have Note that since we allow the polynomial degree to change between diﬀerent components and between diﬀerent intervals. i. and let ϕ be the solution to (6.g (e) = (e(T ). then N Mi Iij (6. −ϕ ˙ 0 ij ij ij − J ∗ (u. . ·)ϕi dt + [Ui ]i. ·))ϕi dt + [Ui ]i.3. . ϕ) dt. By the deﬁnition of the dual problem.2.j−1 ) . where π [q] f (x) is the qth-order Taylor expansion of f around x0 = (a+b)/2. If ϕT = 0 and g(t) = e(t)/ e(t) .j−1 ϕi (ti. We stress that the result of the theorem is valid for any piecewise polynomial approximation of the solution to the initial value problem (1.2 q S Cq−1 k R(U. . ·) L2 (RN ×[0. ranging from the very sharp estimate E0 containing only local quantities to the more robust estimate E5 containing only global quantities. with LϕT .j−1 ϕi (ti. Corollary 6. The mcG(q) method satisﬁes the following estimates: (6. ϕ) dt ˙ Iij −ei ϕi dt + ˙ −ei ϕi dt + ˙ Iij Iij T (f (u.9) where E0 E1 (6. i=1 Si √ q S [q].g (e) ≡ (e(T ). ·)ϕi dt + [Ui ]i.7) |f (x) − π [q] f (x)| ≤ Cq k q+1 1 k b a |f (q+1) (y)| dy ∀x ∈ [a. Proof.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1887 1888 ANDERS LOGG 6.j−1 ϕi (ti. g) 0 − (e(T − ).j−1 ) . ϕT ) + LϕT . deﬁned on the open intervals of the partitions ∪j Iij as ˙ Ri (U.4. ϕT ) + − (e(T ).T ] {Cqi −1 ki ri } . t). . T we let · denote the Euclidean norm on RN and deﬁne v L1 ([0. To obtain expressions for the Galerkin errors.j−1 ϕi (ti. ·)ϕi dt + [Ui ]i. and Cq = 1/(2q q!). Lemma 6.T ]) . ϕ) dt ˙ 0 T (e. b]. t ∈ (ki. b]).5. the interpolation constant will change in the same way. Error representation. we use two ingredients: the error representation of Theorem 6.

2 dt.T ] {Cqi −1 ki i ri } N i=1 N i=1 N i=1 N i=1 [qij ] Mi j=1 kij sij (q ) Mi qi max[0.2 T 0 |ϕi |Ri (U. ·) for t ∈ Iij .T ] {Cqi −1 ki ri } N 0 ϕ √ q maxi. |LϕT .11) Si [qi ] [q ] si i (t) = [q ] sijij Iij = = = 1 kij T 0 S [q].e. we can choose a better interpolant. ·)| denotes the vector-valued function with components |R|i = |Ri | = |Ri (U.g (e)| = ij Iij .j−1 (ϕi (ti. The proof of the estimates for the mdG(q) method is obtained similarly.4.T ]) ϕ[q] L2 (RN ×[0. we have N Mi Iij E0 ≤ i=1 j=1 |Ri (U. Using the error representation of Theorem 6. ·)(ϕi − πk ϕi ) dt = E0 . we obtain an extra factor kij in the error estimates.g (e)| ≤ E2 ≤ E5 . Continuing from E2 . i.4). ri (t) = rij .MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1889 for t ∈ Iij .g (e)| = i=1 j=1 Ri (U.[0. (qij ) 1890 ANDERS LOGG with Cq as in Lemma 6.j−1 rij sijij ¯ [q +1] . ·) L2 (RN ×[0.g (e)| = E0 ≤ E1 ≤ E2 ≤ E3 ≤ E4 Choosing πk ϕi as in Lemma 6. q max[0. ij Iij |Ri (U. q Cqi ki i +1 ri .j−1 ) − πk ϕi (t+ )) = E0 . we have T 1/2 T 1/2 ϕ(q) dt.12) |LϕT .4 on every interval Iij . By the triangle inequality.1 . |LϕT . Continuing. ·))i = Cqij −1 kij Ri (U. i. (Cq−1 k q R(U. ·)(ϕi − πk ϕi ) dt + [Ui ]i. 1/2 [q ] sijij = = S [q].j−1 ) − πk ϕi (t+ )) .14) |LϕT .[0. ·) = |Ri (U. we use the error representation of Theorem 6.5. ·)|si T (Cq−1 k q |R(U..g (e)| ≤ Cq−1 k q R(U. Proof. noting that the jump terms disappear since U is continuous. 0 dt s[q] so that 2 dt ≤ ϕ(q) 0 2 dt . ki (t) = kij . ·) s[q] dt 0 1/2 1/2 T T Cq−1 k q R(U. ·)|.j−1 |.T ] {Cqi −1 ki ri } 0 |ϕi | dt [q ] q Si i max[0.j−1 πk ϕi | dt + |[Ui ]i. where πk ϕ is any test space approximation of ϕ.T ] i=1 Ri (U. ·)(ϕi − πk ϕi )| dt = E1 .15) rij = ¯ = = = = = = ij Iij √ q S [q+1]. E3 ≤ T (qi ) N | dt i=1 0 |ϕi √ T qi (q) dt maxi.T ]) = E5 .T ] {Cqi −1 ki i ri } = E3 . ·)|. s[q] ) dt 0 T Cq−1 k q R(U. in view of Lemma 6. ·)| dt i=1 j=1 Cqij −1 kij sij Iij T [qi ] N qi dt i=1 0 Cqi −1 ki |Ri (U. Expressions qij such as Cq−1 k q R are deﬁned componentwise. Noting now that s is the L2 -projection of |ϕ(q) | onto the piecewise constants on the partition. and where πk ϕ is any test space approximation of the dual solution ϕ. As in the proof for the continuous method.j−1 ||ϕi (ti.j−1 ) − πk ϕi (t+ )|.T ] {Cqi −1 ki i ri } E0 dt E1 E2 E3 E4 E5 with (6. we have N Mi Iij |LϕT . ﬁnally. ·)||ϕi − qij +2 N Mi i=1 j=1 Cqij kij [q +1] N Si i max[0.1 and the Galerkin orthogonality (4.2 Cq k q+1 R(U. completing the proof. ¯ ¯ S [q+1]. kij 1 ¯ Ri (U. ¯ = ≤ As an alternative we can use Cauchy’s inequality in a diﬀerent way. ·)| dt [q ] 1 kij Iij |ϕi (qij ) | dt and (6. ·) 2 dt s[q] 2 dt 0 0 1 kij Iij |Ri (U.T ] {Cqi −1 ki ri } j=1 Iij |ϕi ij | T (qi ) qi max[0.4. q maxi. The mdG(q) method satisﬁes the following estimates: (6. 1 kij T 0 |ϕ | dt.j−1 .1 N maxi. ·)(ϕi − πk ϕi ) dt + [Ui ]i.T ] {Cqi −1 ki i ri } N S [q]. we have E2 = = = = ≤ ≤ qij +1 [q ] N Mi rij sijij i=1 j=1 Cqij −1 kij qij [qij ] N Mi |Ri (U. ·)| + |[Ui ]i.[0.j−1 (ϕi (ti.13) where (6. Theorem 6.j−1 |.1 = E4 . we have E2 ≤ = = = and. and rij (6.T ] Cqi ki i +1 ri . we have E1 ≤ = ij ij Cqij −1 kij q ij ij Cqij −1 kij Iij |Ri (U.[0. Proof. q +1 rij sijij = E2 . i.9) to get Ri (U. where |R(U. i.T ]) . Thus. ·)| Iij (qi ) ϕ(q) | dt. ·)| dt + 1 |[Ui ]i.6. ·) L2 (RN ×[0.1 and the Galerkin orthogonality (4. kij and we otherwise use the notation of Theorem 6. Since in the discontinuous method the test functions are on every interval of one degree higher order than the test functions in the continuous method.

the ﬁrst steps in Theorems 6. k Iij Iij More precise estimates may be used if needed. This is possible. This is only a convenient way to obtain the interpolation constant. Although Theorem 6. πk ϕ) dt T − πk ϕ) dt + ˜ 0 (R. ·)πk ϕi dt Iij Mi C ¯ j=1 kij |ϕij ||Rij | ¯ where {Si }N are the same stability factors as in the estimate for the computational i=1 error and (6.22) RQ = ij 1 kij ˜ Iij [0] fi (U. A similar estimate holds for the mdG(q) method. ·)πk ϕi dt ≤ i=1 N Mi ¯ 1 Iij Ri (U.4 we obtain E0 ≤ ≤ ≤ + ij Iij |Ri (U. and we have an order 2q estimate for ˜ − in terms of f (2q) . Computational errors. notice that (6. When evaluating the expressions E0 or E1 .j−1 ||ϕi (ti. (6. N i=1 Mi j=1 N i=1 ˙ if the quadrature is exact for U v when v is a test function. πk ϕ) dt + ˜T − 0 T 0 (f (U.4) and (4.4. we evaluate the computational residuals and multiply with the computed stability factors. πk ϕ) dt i=1 j=1 Ri (U. the situation is similar with the computational residual now deﬁned as (6. ij Cqij kij = E1 For the mdG(q) method. 6.6 below we discuss a more convenient choice of interpolant. In section 6. since by the Galerkin orthogonality we have N Mi Iij Thus.4. if the time-steps are diﬀerent for diﬀerent components. The value of the constant thus depends on the speciﬁc way the residual is measured. Continuing now in the same way as for the continuous method. If the corresponding discrete equations are not solved exactly. Assuming now that ϕ varies slowly on each subinterval. ·) dt − Iij fi (U.5 are valid for one of the terms.18) RC = ij 1 kij Ri (U. the mean values on ¯ the local intervals). We now extend our analysis to take into account also quadrature errors. we may replace Cq by a ij smaller constant Cq . . the ﬁrst step in the proof of Theorem 6. we have for the mcG(q) method (6. and we deﬁne the discrete or computational residual as (6. we divide the interval into 2m ij parts and use the quadrature on every interval. 6. Remark 6. ϕ) dt 0 T (R.6 are not. ·). say. namely (6.23) RQm = 1 m C2 (k/2m )2q+1 = 2m(−2q) Ck 2q = 2−2q RQm−1 . ·) dt . ·). we have E2 ≤ E3 ≤ E4 and E2 ≤ E5 .21) ˜T − 0 T 0 (f (U. ·)πk ϕi dt = 0 for all test space interpolants πk ϕ.16) EC = ≈ ≤ N Mi j=1 Iij Ri (U. The error estimates of Theorems 6. We denote integrals evaluated by quadrature with ˜ .9). The ﬁrst term of this expression was estimated in Theorem 6. we estimate the remaining extra term as follows: (6. We now make a few comments on how to estimate the quadrature residual. πk ϕ) 0 ˜ T (R. ·)||ϕi − πk ϕi | dt + |[Ui ]i.18) is evaluated using quadrature). πk ϕ) 0 T dt − ˜ 0 (R. If the residual is no longer orthogonal to the test space.5 and 6.5 is the subtraction of a test space interpolant. π ϕ) k 0 dt dt + T (R. there will be an additional contribution to the total error. ·) dt .20) LϕT .17) ¯[0] Si = j=1 T kij |ϕij | ≈ ¯ 0 |ϕi | dt = Si [0] is a stability factor. summing up the result. If. which may be nonzero even if f is linear. we add and subtract this term to get to the point where the implications of Theorem 6. ·) i=1 j=1 kij |ϕij | kij N ¯[0] C i=1 Si maxj |Rij |. and 2q so we make the assumption RQ ∝ kij ij . Starting from the error representation as before. Focusing on the continuous method. The third term is the quadrature error.6 are based on the Galerkin orthogonalities (4. πk ϕ) dt = ≈ ij ˜ Iij − Iij fi (U. instead of using the standard quadrature ij rule over the interval with quadrature residual RQ0 . The Lobatto quadrature of the mcG(q) method is exact for polynomials of degree less than or equal to 2q − 1. ·) dt where ϕ is a piecewise constant approximation of ϕ (using. To estimate the quadrature error.5 and 6. ·)| dt + |[Ui ]i.5.j−1 | kij Iij |ϕi | dt ij Cqij kij Iij qij +2 [q +1] rij sijij ¯ = E2 . Remark 6. ϕ 0 T (R.1 is still valid. If we replace k1 Iij |Ri | dt by maxIij |Ri |.19) RC = ij 1 kij − (ξijq − ξij0 ) − Iij fi (U.2. Quadrature errors. ϕ − πk ϕ) 0 T (R.j−1 )| qij +1 (qij +1) 1 |Ri (U.1.g (e) T (R. ·)πk ϕi dt N i=1 Q ¯ ij kij ϕij Rij ≤ ¯[0] Si maxj |RQ |. the interpolant πk ϕ does not have to be chosen as in Lemma 6. Mi (6.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1891 1892 ANDERS LOGG By Lemma 6. to estimate the computational error. we will get a diﬀerent quadrature residual. ij dt = Ri (U.5 and the second term is the computational error discussed previously (where ˜ denotes that in a real implementation. ϕ 0 = = = = dt + − πk ϕ) dt + T (R. ·) dt = 1 kij (ξijq − ξij0 ) − fi (U. is the quadrature residual.j−1 ) − πk ϕi (ti.

Proof. . if f is a polynomial of degree q on [−1. fi = fi (U (t). . 1] as Pq (x) = 1 q 2 q q!2q D ((x − 1) ). Mi . t) is linear and all components have the same timesteps and order. we have 0= Iij l Ri (U. . . . N .e. If then f is orthogonal to the subspace spanned by {(x + 1)p }q . . . . . Then every Ri (U. we have I = = = = 1 Pq (x)+Pq+1 (x) (x + 1)p dx x+1 −1 1 1 Dq ((x2 − 1)q + x(x2 − 1)q )(x + 1)p−1 dx q!2q −1 1 1 q 2 q p−1 dx q!2q −1 D ((x + 1)(x − 1) )(x + 1) 1 p 1 q−p 2 q D ((x + 1)(x − 1) )Dp (x + 1)p−1 q!2q (−1) −1 2 q (6. With such a choice of interpolant. . . . which holds especially for v(t) = (t − ti.11.24) |RQm | ≤ 1 |RQm − RQm+1 |. however. i = 1. Since the conditions assumed in the statement of the lemma guarantee that the residual is a polynomial of degree qij on every interval Iij . . . The following lemmas give us an idea of how to choose the interpolant.28) I= −1 Qq (x)(x + 1)p dx = 0 for p = 1. ·) of the mdG(q) residual is a Radau polynomial of order qij on Iij for j = 1. 1]. .6. ·) is the qij th-order Legendre polynomial on Iij . For the mdG(q) method the only diﬀerence is that the basic quadrature rule is one order better. 2 q q {Qq (x). ·) is a polynomial of degree qij on Iij . we ﬁrst note some basic properties of Radau polynomials. Since {(x + 1)p }q p=1 are linearly independent on [−1. ·)v dt = Iij Ri (U. ·) of the mcG(q) residual is a Legendre polynomial of order qij on Iij . Note ﬁrst that by assumption the residual Ri (U. .26) EG = i=1 j=1 Ri (U. Assume now that f is a polynomial of degree q on [−1. Also for the discontinuous method there is a reformulation in terms of approximations of the residual.. ·)(ϕi − πk ϕi ) ≥ 0 (or ≤ 0) on every local interval Iij . 1 − 2−1−2q ˜ for all v ∈ P qij −1 (Iij ). To prove the corresponding results for the discontinuous method. we may estimate quadrature residuals and thus the quadrature error. we must have f = cQq for some p=1 constant c. we would have (6. so that Ri (U. ·) is orthogonal to P qij −1 (Iij ). ·) is the L -projection of Ri (U. .9. . then every component Ri (U. alternatively. We now present an approach to estimating the quantity πk ϕ) dt by direct evaluation. then every component Ri (U.. then f is a Radau polynomial. integrating by parts. since D ((x + 1)(x − 1) ) is zero at −1 and 1 for l < q. . ·)v dt + [Ui ]i. On every interval Iij the residual component Ri (U. t) and fi is linear or. Proof. ˜ Lemma 6. since |R | ≤ |R |RQm+1 | = |RQm − RQm+1 | + 2−2q |RQm |. q. .j−1 ∀v ∈ P qij (Iij ). alternatively. we have Iij ˜ Ri (U. .MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1893 Qm 1894 2 ANDERS LOGG where we have dropped the ij subindices. Conversely. Evaluating EG .10. . for which the jump terms disappear. ·)(ϕi − πk ϕi )| dt with αij = ±1. ·)|Iij is the L2 (Iij )-projection onto P qij (Iij ) of Ri (U. f = f (U (t). . ·)(ϕi − πk ϕi ) dt = αij i=1 j=1 Iij |Ri (U. N . 1] and orthogonal to the Radau polynomial Qq . 1] and has the 1 property (6.25) |RQm | ≤ 1 |RQm − RQm+1 |. The following lemma restates this property in terms of approximations of the residual. Then the qth-order Radau polynomial. . ·)|Iij is the L2 (Iij )-projection onto P qij (Iij ) of Ri (U. . In this way we avoid introducing interpolation constants and computing derivatives of the dual. By the Galerkin orthogonality. Since Ri (U. ·)|Iij is a Legendre polynomial of degree qij .27) N Mi Iij N Mi dx = 0. for j = 1. for i = 1. (x + 1) . We can write the qth-order Legendre polynomial on [−1. Rescaling to [−1. .. i. (x + 1).9 that the residual Ri (U. is to choose πk ϕ such that Ri (U. . . Starting now with N Mi Iij (6. Even if the rather strict conditions of this lemma do not hold. (x + 1) } form a basis for P ([−1. and the proof is complete. ·)|Iij . t) = fi (Ui (t). 1]. If. −1 f (x)(x + 1)p dx = 0 for p = 1.7. q. ϕ − 0 πk ϕ a suitably 6. . . Thus. EG = i=1 j=1 Ri (U. Lemma 6.28). ·). it is clear that on every such interval it is the qij th-order Legendre polynomial (or a multiple thereof).. i. Lemma 6. Mi . 1]). if we want to prevent cancellation. N . so that (6. we have the estimate (6. fi = fi (U (t). it follows from Lemma 6. i. q. 1] with the property (6. Note. ˜ Lemma 6.e.j−1 v(t+ ) i.e. t) and fi is linear or. . Qq (x) = (Pq (x) + Pq+1 (x))/(x + 1). for i = 1. we realize that the best possible choice of interpolant. ·)(ϕi − πk ϕi ) dt for the continuous method. Let Pq be the qth-order Legendre polynomial on [−1. 1 − 2−2q Qm −R Qm+1 |+ ˜ Proof. . that although we do not explicitly compute any derivatives of the dual. ·)v dt = 0 Thus. the regularity assumed in section 6. Ri (U. Thus.j−1 )p with p = 1. ·)|Iij . Let R be the local L2 -projection of the mdG(q) residual R onto ˜ the trial space. by computing the integrals at two or more dyadic levels. t) is linear and all components have the same timesteps and order. If.1 for the dual solution is still implicitly required for the computed quantities to make sense. ·) must be a Radau polynomial on Iij . f = f (U (t). we can say something similar. Mi .28). instead of 2q we have 2q + 1. Ri (U. . . Proof. Let R be the local L2 -projection of the mcG(q) residual R onto ˜ the trial space. ˜ j = 1. i. . . .e. Lemma 6. . ·) onto P qij (Iij ) on Iij . with ϕ a computed dual solution and chosen interpolant. .8. . has the following property: 1 T (R(U. . t) = fi (Ui (t).

7 5.T ] [0] [0] . N .. .9 6 2 |LϕT .7. To get rid of the jump terms that are present in the error representation for the discontinuous method.33) |LϕT .6 5. the computational error. This means that if the dual can be approximated well enough by a polynomial of degree q. EC and the quadrature error. Mi .. for polynomials of degree ﬁve. t− )||ϕi (tij ) − πk ϕi (t− )|. such that (6. .g (e)| ≤ Si i=1 [qi ] q ¯ ¯ max {Cqi −1 ki i ri } + Si max |RC | + Si max |RQ | .. in principle. note that there are “computational” counterparts also for the estimates of type E3 in Theorems 6. For the discontinuous method.. .6 we have the following (approximate) error estimate for the mcG(q) method: N (6. tij )| Iij kqij |ϕi − πk ϕi | ij qij N ˜ − i=1 Si maxj=1. ·)(ϕi − πk ϕi ) dt. The total error is composed of three parts—the Galerkin error. Since the integrands are. ·)||ϕi − πk ϕi | dt Iij qij − 1 ij Cqij kij |Ri (U. Then the dual should be interpolated by a polynomial of degree q −1. ij ij Fig. we may choose to interpolate the dual exactly at those As an example. ·) onto P qij (Iij ) on Iij .5 and 6. Then every Ri (U. ·) is a Radau polynomial on Iij . the product is a polynomial with known properties.2 5.6 5. . There is now a simple way to compute the integrals Iij Ri (U.T ] [0. Assume that the polynomial order of the method on some interval is q for the continuous method. EQ : (6. Notice that the jump terms for the discontinuous method have disappeared. ·) −2 −3 5 x 10 −10 5.4 t 5.T ] [0. ij dt ˜ with Si = 0 k1i |ϕi − πk ϕi | dt for the continuous method and similarly for the q i discontinuous method.1. we have freedom to interpolate at exactly q points. .Mi Cqij kij |Ri (U. Finally. This is illustrated in Figure 6.g (e)| = ij Iij Ri (U. This leaves q degrees of freedom. ·)(ϕi − πk ϕi )| dt. From this information about the residual.g (e)| ≤ EG + EC + EQ . The Legendre-polynomial residual of the mcG(q) method (left) and the Radaupolynomial residual of the mdG(q) method (right).7 5. the product Ri (U. ·)(ϕi − πk ϕi )| dt = Cqij kij |Ri (U.1 5. for both the mcG(q) method and the mdG(q) method (but the interpolants are diﬀerent). methods of order 10 and 11.j−1 )p with 1 ≤ p ≤ q. EG . namely |LϕT .MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 3 x 10 −10 1895 1896 ANDERS LOGG 2 1 0 −1 PSfrag replacements points where the residual is zero. ·)v dt = 0 (6. As a result. we should interpolate the dual with a polynomial of degree q.11) Radau polynomials.e. . respectively. 0 −2 −4 −6 PSfrag replacements −8 with αij = ±1. . We then choose to interpolate the dual at the q points within the interval where the Radau polynomial is zero. ·)(ϕi − πk ϕi ) dt = αij ij Iij |Ri (U. it follows from the Galerkin orthogonality that ˜ Ri (U.e. ·) −10 5 5. ·)v dt = Ri (U. 6. we want to interpolate the dual at the beginning of every interval. The total error.29) Ri (U. ˜ Proof. we have freedom to interpolate at exactly q + 1 points. we now choose the interpolant.3 5. There are then constants Cq (which can be computed numerically). i. i = 1. i i [0. Since Ri (U.31) |Ri (U.g (e)| ≤ = ≤ T ˜ j = 1.5 and 6. we may choose the interpolant in such a way that we have (6. choosing estimate E3 of Theorems 6. ·) is the L2 -projection of Ri (U.8 5.8) Legendre polynomials on the local intervals and that the mdG(q) residuals are (in the sense of Lemma 6. From Lemma 6.9 6 |Ri (U.3 5. . ·)|Iij is a Radau polynomial of degree qij . products of two polynomials for which we know the positions of the zeros.30) Iij Ri (U.6.. i.2 5.4 t 5.8 5. depending on the order and the method..e. Since a qth-order Legendre polynomial has q zeros on the interval. Iij Iij for any v(t) = (t − ti.9 it then follows that ˜ Ri (U. 6.1. ·)(ϕi − πk ϕi ) does not change sign on the interval.32) |LϕT .1 5. i. We thus know that the mcG(q) residuals are (in the sense of Lemma 6. tij )|. .

12 that T |SΦ (T ) − Sϕ (T )| ≤ C RΦ dt Sϕ (T ).e. so that |SΦ (T ) − Sϕ (T )| = = = ≤ ANDERS LOGG for the mdG(q) method we have (6. Derivation of the methods.e. or E2 of Theorems 6.j−1 . By Corollary 6.5) n=0 ξn 1 k k 0 [q−1] ˙ λ[q] (τ (t))λm−1 (τ (t)) dt = n k 0 f λm−1 (τ (t)) dt. qij − 1 (A.5 and 6. The true global error may thus be estimated in terms of computable stability factors and residuals. [9]. deﬁned by (A. With C deﬁned as above it now follows by Lemma 6. .g.35). Appendix A. Modelling errors could also be similarly accounted for since these are closely related to quadrature errors. with s0 = 0 and sq = 1. (sn − s0 ) · · · (sn − sn−1 )(sn − sn+1 ) · · · (sn − sq ) q We can then express Ui on Iij in the form (A.3. Now. .34) N |LϕT . We expect the estimate for the Galerkin error..j−1 .4) qij Theorem 6. We then have the following estimate: (6. This section contains some details left out of the discussion of section 4. with data ϕ(t) = 1 speciﬁed at time t. . deﬁned as T Φ−ϕ T RΦ 0 Φ − ϕ ) dt ≤ L1 ([0. In [28] we prove the following lemma. ω. A. The mcG(q) method. and let ω be the dual of the dual. and quadrature errors also include numerical round-oﬀ errors (included in the computational error). EG . Then the following estimate holds for the relative error of the stability factor SΦ (T ): T ξijn Iij n=0 d λ[qij ] (τij (t)) λ[qij −1] (τij (t)) dt = m dt n Iij fi (U (t). We conclude this section by proving a computable a posteriori error estimate for the dual problem. To compute the stability factors used in the error estimates presented above. . 1]. . keeping in mind that.j−1 (6. . 1].MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1897 1898 dual. Proof. with ξij0 = ξi. RN )-error of the (A. computational errors. Even sharper estimates are obtained using estimates E0 .36) ω(t) ≤ Sϕ (T − t) ∀t ∈ [0. t)λ[qij −1] (τij (t)) dt.T ] (6. k]. and we thus face the problem of estimating the error in the stability factors. To demonstrate how relative errors of stability factors can be estimated using the same technique as above. Let Φ be a continuous approximation of the dual solution with residual RΦ .3) [q−1] Ui (t) = n=0 [q ξijn λn ij ] (τij (t)). m (6. we solve the dual problem numerically.35) Sϕ (T ) = sup ϕ(T ) =1 0 ϕ dt q q and let {λn }q n=0 be the {sn }n=0 Lagrange basis functions for P ([0. such that for m = 0. We thus seek to determine the coeﬃcients {ξn }q n=1 with ξ0 given. This can be done in many ways.1 to represent the L1 ([0.j−1.3) as qij follows: Find {ξijn }n=0 . we use the error representation of Theorem 6. T ]. 0 and the proof is complete. i. tij − ti.12. RN )-error of Φ in terms of the residual of Φ and the dual of the dual.g (e)| ≤ Si i=1 [qi +1] q ¯[0] ¯[0] max Cqi ki i +1 ri + Si max |RC | + Si max |RQ | .37) |SΦ (T ) − Sϕ (T )|/Sϕ (T ) ≤ C RΦ dt. T ].3.2) for a computed approximation Φ of the dual solution ϕ. Remark 6.qi.. A good choice for the cG(q) method is the Lobatto points of [0. T ]. in that both errors can be seen as arising from integrating the wrong right-hand side. We also have to take into account quadrature errors when evaluating (6. we drop the ij subindices and assume that the time-interval is [0. q we have q and for many problems we may take C = 1. Lemma 6. although not visible. i. e. ¯ i i [0. and assume that Sϕ (t)/Sϕ (T ) is bounded by C on [0.T ]. 1]. . 1]. E1 . .T ] [0. 0 To simplify the notation. λ[q] (s) = n (s − s0 ) · · · (s − sn−1 )(s − sn+1 ) · · · (s − sq ) . we have an expression for the L1 ([0. T ]. (A. we compute the relative error for the stability factor Sϕ (T ). An a posteriori error estimate for the dual. To rewrite the local problem in a more explicit form.1..8. Let ϕ be the dual solution with stability factor Sϕ (t). to be quite sharp.38) T 0 T ( 0 Φ dt − T 0 ϕ dt T Φ−ϕ 0 T (RΦ .13. To estimate the relative error of the stability factor. 1]) on [0.T ] [0. [q−1] . such that for m = 1. from which the estimate follows. ω(T 0 These estimates containing Galerkin errors. see.Rn ) dt − ·)) dt = ω(T − ·) dt.1) [q] τij (t) = t − ti. let {sn }q n=0 be a set of nodal points on [0. while EC and EQ may be less sharp. all other components are present in f . 6. let τij be the linear mapping from the interval Iij to (0. and choosing the λm as test functions we can formulate the local problem (4.6.

8) bm = 0 f λm−1 (τ (t)) dt − am0 ξ0 . . let A[q] be the (q+1)×(q+1) matrix A[q] = (amn ) with inverse A[q] = (¯mn ). a Then. This completes the proof. Going back to the Galerkin orthogonality (4. . .j−1 . . k]. . m m m = 1.j−1. this amounts to showing that if 1 0 or simply q (A. [q] q i. . so that the value of n=1 amn an0 must be −1. qij . then ξn = ξ0 for n = 1.6) n=1 (A. .2. . . . The weight functions may be computed analytically for small q. mn ˙ U v dt = 0 ∀v ∈ P q−1 ([0. The mdG(q) method. .20) q − ξijm = ξij0 n=0 a[q] λ[q] (0) + ¯mn n Iij [q wmij ] (τij (t)) fi (U (t). Following Lemma A.18) and a[q] = mn 0 [q] [q] ˙ λ[q] (t)λ[q] (t) dt + λn (0)λm (0) n m k (A..1.1 below. 1]. Assume the interval to be [0. q. 1] since {λn }q n=0 is a nodal basis for P ([0. . [q] (A. t) dt. To simplify the notation. .e. . q. mn q (A. we get the following set of equations for determining {ξijn }n=0 : (A.13) sq = 1.16) amn an0 = −1.17) n=0 a[q] ξn = bm . .15) [q] wm = n=1 a[q] λn−1 . switching back to the full notation. q. t) dt. qij . m Proof. This follows by taking v = U . ξn = ξ0 for n = 1.11) ξijm = ξij0 + Iij [q wmij ] (τij (t)) fi (U (t). the end-point of every subinterval is a nodal point for the basis functions. where 1 ˙ with U ∈ P q ([0. The value is independent of f so we may take f = 0. 1]). For the mcG(q) method. ¯[q] q − ξn λ[q] (0) − ξ0 n [q] λm (0) + n=0 q n=1 ξn n=0 1 k k 0 [q] ˙ λ[q] (τ (t))λm (τ (t)) dt = n k 0 f λ[q] (τ (t)) dt.10) [q] {wm }q m=1 q are given by [q−1] (A. . (A. ﬁnd qij {ξijn }n=0 . a[q] ξn = bm . qij .14) qij qij − [q ξijn λn ij ] (0) − ξij0 [q λmij ] (0) + (A. t) dt. . (A. Thus. [q] [q] ¯ Now. qij With this ansatz. t)λmij ] (τij (t)) dt where the weight functions (A.19) b[q] = m 0 − f λ[q] (τ (t)) dt + ξ0 λ[q] (0). . where (A. 1]). m = 0. . and where the initial condition m=1 ⊂ P is speciﬁed by ξi00 = ui (0) for i = 1. such that (A. q we have (A. [q] [q] [q−1] ¯ a We explicitly compute the inverse A[q] = (¯mn ) of the matrix A[q] = (amn ). .7) and k a[q] = mn 0 [q−1] ˙ λ[q] (t)λm−1 (t) dt n where the diﬀerence is that we now have q + 1 degrees of freedom on every interval. since we no longer have the continuity requirement for the trial functions. U = U0 on [0. . we have q−1 for certain weight functions {wn }q (0. . We thus seek to determine the coeﬃcients {ξn }n=0 such that for m = 0. ¯mn m = 1. 1]). 1]. . ξijn Iij n=0 n=0 d [q λ[qij ] (τij (t)) λmij ] (τij (t)) dt dt n = Iij [q fi (U (t). .qi. . we have q − for m = 0. Lemma A. . we drop the subindices q ij again and rewrite to [0. this relation may be somewhat simpliﬁed.qi. . then U is constant on [0. We now make the same ansatz as for the continuous method. . We make the assumption that the nodal points for the nodal basis functions are chosen so that (A. . . N . m = 1. .4).. i.9) ξijm = −ξ0 amn an0 + ¯[q] n=1 Iij [q wmij ] (τij (t)) fi (U (t). . We thus want to prove that if f = 0.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1899 1900 ANDERS LOGG or simply q A. .j−1. . we get q i. 1).e. the value at the right end-point of the previous interval. The mcG(q) method thus reads as follows: For every local interval Iij . where we use ξij0 to denote ξi. switching back to the full notation. and for general q they are easy to compute numerically. qij . [q] q ¯ Thus. .j−1 .12) 1 Ui (t) = n=0 [q ξijn λn ij ] (τij (t)).e. .. . with ξij0 = ξi.

SIAM J. [q] wm = n=0 amn λn . Math. 1987. For the mdG(q) method.chalmers. [8] K. Numer. [17] D. also available online from http:// www. Numer. Kirby. M. New Astronomy. NA Group Report 98/20. 8.D.. pp. Accurate parallel integration of large sparse systems of diﬀerential equations... SIAM J. and L. SIAM J. Numer. Math. Johnson. Cambridge University Press. Parallel treesph. KTH. High resolution schemes for conservation laws with locally varying time steps. London. Global error control for the continuous Galerkin ﬁnite element method for ordinary diﬀerential equations. Eriksson. Math.phi. ¯[q] [q] As for the continuous method. Eriksson and C. 6 (1996). Comp. Loy. Numerical Solution of Ordinary Diﬀerential Equations.html. Ruprecht-Karls-Universit¨t. Hansbo. pp. 321–336. Ziantz. 1991. 32 (1995). 908–926. 277– e 297. Comput. manuscript. Sci. 25 (1988). Butcher. 1–48. Kungl. SIAM J. Johnson. Hairer and G. 1998. Methods Engrg. D. A note on energy conservation for hamiltonian systems using continuous time ﬁnite elements. Anal. Wanner. Sci. Comput. Since the value of the expression is independent of f we can take f = 0. [20] J. [30] A. RAIRO Mod´l. 113–124. 19 (1985). Comput. Adaptive local reﬁnement with octree load balancing for the parallel solution of three-dimensional conservation laws. Math..21) [q] {wn }q n=0 q are given by m = 0. [9] K. . Anal. [11] K. We thus want to prove that if f = 0. Numer. [6] C.. o Sweden. Stockholm. and S. J. Solving Ordinary Diﬀerential Equations. n-body simulations of late stage planetary formation with a simple fragmentation model. [14] K. 1 1 2 1 d (U 0 dt − U (0− ))2 dt 1 ˙ ˙ so that [U ]0 = 0.chalmers. I. . 1998. Cambridge University Press.. Johnson. 35 (1998). 22 (2001). 1987. 132 (1998). Solving Ordinary Diﬀerential Equations. B. [7] M. G¨teborg. Cambridge. Eriksson. Publ. Num´r. Agnor. thesis. SIAM J.html. Szepessy. R. SIAM J. SIAM J.Sc. pp. pp. C. Logg. Anal. Logg. Springer-Verlag. Stockholm. Math. pp.. and the proof is [U ]0 = 0 and U complete. 1). UK. Petzold. Hansbo. Hairer and G. Naturwissenschaftlich-Mathematischen Gesamtfakult¨t. J. 1). 17 (2001).phi. Larsson. P. Adaptive ﬁnite element methods for parabolic problems IV: Nonlinear problems. 815–852. [2] U. [23] P.se/preprints/abstracts/preprint-2000-02. Eriksson.2..1. 32 (1995).. Adaptive Finite Element Methods for Parabolic Problems III: Time Steps Variable in Space. 455–473. Lemma A. Dav´. By the Galerkin orthogonality. [3] J. with U ∈ P q (0. pp. 2 (1997). . pp. Math. pp. Stiﬀ and DiﬀerentialAlgebraic Problems. [24] C. Shampine. Wanner. 1994. Eriksson and C. Estep. 1998. Berlin. Sanders. UK. Tempone. R. 1729–1749. and C. assume that the interval is [0. Numer. Szymanski. Computational Diﬀerential Equations. [12] K. As in the proof for the mcG(q) method. 863–869. U is constant and equal to U (0− ). a a [26] A. Discontinuous Galerkin methods for ordinary differential equations.chalmers. Estep. Johnson. Soc. 2256–2281.chalmers. [25] O. Dahlquist. 43–77. preprint. Adaptive Approximation of Differential Equations Based on Global and Local Errors. and C. thesis. Nonstiﬀ Problems. we have 1 [U ]0 v(0) + 0 ˙ U v dt = 0 ∀v ∈ P q (0. Anal. Ascher and L. Logg. [19] D. and F. R. Comput. pp. Hager. A Multi-Adaptive ODE-Solver. 2000.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs I 1901 1902 ANDERS LOGG where the weight functions (A. . Johnson. This gives 0 (U )2 dt = 0. http://www. Anal. this may be somewhat simpliﬁed. Error estimates and adaptive time-step control for a class of one-step methods for stiﬀ ordinary diﬀerential equations. Osher and R. t) dt for certain weight functions {wn }q ⊂ P q (0.. Chalmers University of Technology. Moon. Eriksson and C.. and L. A posteriori error bounds and global error control for approximation of ordinary diﬀerential equations. G¨teborg.. Oxford University Computing Laboratory. also available online from http:// o www.. Williams. Eriksson and C. [18] D. RAIRO Mod´l. pp. version 1.2. Multi-adaptive Galerkin methods for ODES II: Implementation and applications. 139–152. [31] J. John Wiley. Logg. 706– 740. 14.. n=0 REFERENCES [1] S. Zourakis. Kessel-Deynet. 47 (1997). 1750–1763. Shephard. and G. Estep. Dawson and R.phi. 32 (1995). Thom´e. The Numerical Analysis of Ordinary Diﬀerential Equations. A. No. Johnson. [28] A. 1315–1325. Cambridge. we have q amn λn (0) = 1. Num´r. Tekn. 28 (1994). then the solution U is constant. Comm.22) − ξijm = ξij0 + [q] Iij [q wmij ] (τij (t)) fi (U (t). 1). 105–158. Numer. Acta Numer. Johnson.se/tanganyika/ (10 May 2001). 28 (1991). SIAM. Eriksson and C. [10] K. P. M. [4] G. 611– e e 643. 32 (1995). Introduction to adaptive methods for diﬀerential equations. Adaptive ﬁnite element methods for parabolic problems VI: Analytic semigroups. Stability and Error Bounds in the Numerical Integration of Ordinary Diﬀerential Equations. Springer Ser. 1995. [29] A. Models Methods Appl. pp. [22] E. Chichester. Delfour. 1996. 141–151. [34] L. 1995. and V. J. . D. French. II. Adaptive ﬁnite element methods for parabolic problems I: A linear model problem. Numerical approximations to nonlinear conservation laws with locally varying time and space grids. in Acta Numerica. Makino and S. Astron. pp. o [5] R. Adaptive ﬁnite element methods for parabolic problems II: Optimal error estimates in L∞ L2 and L∞ L∞ . ICARUS. [13] K. 1999. Anal. Johnson. Tanganyika. Philadelphia. W. Computer Methods for Ordinary Diﬀerential Equations and Diﬀerential-Algebraic Equations. Sci. Parallel Distrib. Teresco. Eriksson. Flaherty. Springer Ser.. Johnson. 41 (1983).html (25 February 2001). TRITA-NA-0006 NADA. Sweden. Oxford. . Now take v = U . Estep and R. Heidelberg. Logg. Springer-Verlag. SIAM J. ﬁnd qij {ξijn }n=0 . 535–568. Department of Mathematics. SIAM J.-S. http://www. M. 36 (1981). Time discretization of parabolic problems by the discontinuous Galerkin method. Anal.se/preprints/abstracts/preprint-2000-03.. pp. qij we have (A. Comput. Chalmers University of Technology. Johnson. Numer. On a hermite integrator with Ahmad–Cohen scheme for gravitational many-body problems. Alexander and C. . Math. pp. Hernquist. [15] K. Ber¨cksichtigung ionisierender Strahlung im Smoothed-Particleu Hydrodynamics-Verfahren und Anwendung auf die Dynamik von Wolkenkernen im Strahlungsfeld massiver Sterne. Aarseth. H¨gsk Handl. Anal. The mdG(q) method thus reads as follows: For every local interval Iij . q. ¯[q] [q] n=0 Proof. Dubinski. such that for m = 0. Estep and D. Japan.. pp. . [21] E. pp. e e pp. Sweden. Anal. Numer. [27] A. Multi-Adaptive Error Control for ODES. 1]. Adaptive ﬁnite element methods for parabolic problems V: Long-time integration. pp. we have 0 = = ˙ ([U ]0 )2 + 0 U (U − U (0− )) dt = ([U ]0 )2 + 1 1 + − 2 − 2 2 (U (0 ) − U (0 )) + 2 (U (1) − U (0 )) . [33] S. Taking v = U − U (0− ). Ph. Comp. 44 (1992). e [16] K. Since then both ˙ = 0 on [0. Chalmers Finite Element Center Preprint 2001–09. Berlin. 1]. Trochu.se/preprints/abstracts/ preprint-2000-09.. Multi-Adaptive Galerkin Methods for ODES I: Theory & Algorithms. C. 130 (1959).phi. Chapman and Hall. Runge-Kutta and General Linear Methods. Hansbo. [32] K. pp. . submitted.

4. Here we recall that each component Ui (t) of the approximate solution U (t) is a piecewise polynomial of degree qi = qi (t) on a partition of (0. and so we may think of choosing the new time-step as the (geometric) mean value of the previous time-step and the time-step given by (2. we have to choose the proper data for the dual problem to obtain a meaningful error estimate. 2003.3).2). and a number of time-dependent PDEs.1) within a given tolerance TOL for the error e(t) = U (t) − u(t) in a given norm · . We refer to [10] for a detailed description of the multi-adaptive methods. noting that (2. u0 .html † Department of Computational Mathematics. we discuss adaptive algorithms for global error control and iterative solution methods for the discrete equations. global error control. and T > 0 a given ﬁnal time. (ii) solve the dual problem and compute stability factors and stability weights.SIAM J. we may try replacing (2. . component Ui (t) is thus a polynomial of degree qij . features of the implementation Tanganyika. Key words. .2.chalmers. SIAM J. and computational results for a variety of ODEs. For (2. (2. Although this seems simple enough.1) u(t) ˙ u(0) = = f (u(t). A strategy for adaptive error control. p ∗ Received by the editors May 23. We also give a short description of the implementation Tanganyika. SCI.. We have also used standard PID (or just PI ) regulators from control theory with the goal of satisfying (2. Sci. T ] → RN is a given bounded function that is Lipschitz continuous in u. In this section we describe how to use the a posteriori error estimates presented in [10] in an adaptive algorithm. individual time-steps.3) with (2. pp.1).2) to determine the individual time-steps. SE–412 96 G¨teborg. 65L70. o or. 2. taking the logarithm with Ci = log(TOL/(N Si )). 1. Lorenz. accepted for publication (in revised form) May 1. multi-adaptivity. ·) = Ui − f (U. adaptivity. We now discuss these issues. the solar system.5) Si kijij rij = TOL/N.org/journals/sisc/25-4/38973.3). The adaptive algorithm may then be expressed as follows: Given a tolerance TOL > 0. meaning that the resulting time-step sequences are comparable to what can be obtained with more advanced regulators. COMPUT. if the time-step on an interval is small (and thus also is the residual). the time-step for the next interval will be large. To avoid the implicit dependence on kij for rij in (2.j−1 . then stop. published electronically December 5.1) is sharper than (2. rij is a local measure of the residual Ri (U. Comput. We therefore try to be a bit more conservative when choosing the time-step to obtain a smoother time-step sequence.1. local time-steps. Logg. . t ∈ (0. Introduction. 2. For one thing. pp. Regulating the time-step. iterative solution methods for the discrete equations. Furthermore. . {Si } are stability factors (including interpolation ˙ constants). make a preliminary guess for the stability factors and then (i) solve the primal problem with time-steps based on (2. T ] into Mi subintervals of lengths kij = tij − ti. Continuing the discussion of the multi-adaptive Galerkin methods mcG(q) and mdG(q) presented in [A. and where we have pij = qij for mcG(q) and pij = qij + 1 for mdG(q). 65L50. Adaptivity. Sweden (logg@math. 65L80 DOI. 1879–1902]. f : RN × (0.4) to work.4) introduces unwanted oscillations in the size of the time-step.3) kij = TOL/N Si rij 1/pij . 2003. This works surprisingly well for many problems.se). continuous Galerkin. (iii) compute an error estimate E based on (2. Vol.siam. solar system. No. 65L20. (2. presented in [10]. we present adaptive algorithms for global error control. there are some diﬃculties involved. of the form N Mi We use (2. since the residual depends implicitly on the time-step. 65L60.2) e ≤ Si max kijij rij . 65L05. to a variety of problems chosen to illustrate the potential of multi-adaptivity. 2001. T ]. 65L07. so that (2. (iv) if E ≤ TOL. Before presenting the examples. 1119 .j−1 . where u : [0. 10. ·) of the approximate solution U (t). i=1 j p where {sij } are stability weights. presented in [10]. mdG(q). discontinuous Galerkin. go back to (i). which should then be chosen as (2. The goal of the algorithm is to produce an approximate solution U (t) to (1. In this paper we apply the multi-adaptive Galerkin methods mcG(q) and mdG(q). the time-steps on adjacent intervals need to be approximately the same. Examples include the Lorenz system. Throughout this paper.4). tij ]. 2. 24 (2003). t). j = 1.3) may be diﬃcult. On the interval Iij = (ti. Burger AMS subject classiﬁcations. mcG(q). ODE.1) to evaluate the resulting error at the end of the computation. Mi . and if not.1137/S1064827501389734 N (2.1) e ≤ kijij i=1 j=1 p +1 rij sij Following this strategy. 25.j−1 1/pij . T ] → RN . choosing the time-steps based on (2.6) pij log kij + log rij = Ci . Chalmers University of Technology. we solve the ODE initial value problem (1. The adaptive algorithm is based on the a posteriori error estimates. http://www.4) kij = TOL/N Si ri. 1119–1141 c 2003 Society for Industrial and Applied Mathematics 1120 or ANDERS LOGG MULTI-ADAPTIVE GALERKIN METHODS FOR ODES II: IMPLEMENTATION AND APPLICATIONS∗ ANDERS LOGG† Abstract. u0 ∈ RN is a given initial condition. applications. We use (2.

i. as well as diﬀerent and varying time-steps. the dual—or at least the stability factors—seems to be quite insensitive to the choice of data for many problems so that it is. 2.. . A simple strategy. the error representation gives only 0 ≤ TOL. starting from the last element in the time-slab.j−1 )/(tij − ti.1).1). we present a simple explicit strategy. In practice.2. i. If the data for the dual problem are incorrect. We do this in two steps. which then in turn becomes the last component. τij (sn ij ] )). as described in Figure 3. {sn ij }n=0 are quadrature points. and τij . the error estimate may also be incorrect: with ϕT (or g) orthogonal to the error. Choosing data for the dual. however.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1121 1122 ANDERS LOGG o with maximal time-steps {kij }. These iterations are then repeated from beginning to end until convergence.2). ˜ ˜ ˜ Another possibility is to take ϕT = 0 and gi (t) = δin for control of the average error in component n.5. and continuing forward to the ﬁrst element in the time-slab. Solving the discrete equations. qij . the system composed of the element equations (3. lacking a strategy for when to increase the order and when to decrease the time-step. and since all other components step with diﬀerent time-steps. ϕT ) + 0 (e. for the component itself and all other needed components. m = 1.4. and we only know values for component l up to time tl < ti . Note that component Ui (t) is coupled to all other components through the righthand side fi = fi (U. and optimize the choice of time-steps and orders with respect to the computational time required for achieving a certain accuracy. This naturally leads to the following strategy: (3. As discussed in [10]. and in which we never go back to correct mistakes. On every time-slab. All unknown values. First. by direct ﬁxed point iteration. Eventually (or after one step). this component catches up with one of the other components. Thus. This type of regulator performs a little better than the o simple approach described above. 2. The equations are conveniently written in ﬁxed point form. to update a certain component on a speciﬁc interval. One is by dyadic partitioning.1). and then compute new values for these coeﬃcients from (3. we will have to repeat this procedure at a number of control points. the strategy is to extrapolate Ul (t) from the interval containing tl to time ti .3. The method is thus q-adaptive (or p-adaptive) in the sense that the order can be changed. qij . Conversely. we would like to use the best possible values of the other components. . This means that we have to know the solution for all other components in order to compute Ui (t). In what order should the components now make their steps? Clearly. g) dt were derived. At this stage.1) by direct ﬁxed point iteration. e. as deﬁned in [10]. An iterative method. it seems at ﬁrst very diﬃcult to solve the discrete equations (3. For control of the l2 -norm of the error at ﬁnal time. The time-slab can be constructed in many ways. if for component i we need to know the value of component l at some time ti .. however. we have to know Ui (t) to compute the solutions for all other components. in which we compute new time-steps for all components. or by some other method as described below. We now describe how to extend this explicit timestepping strategy to an iterative process.1. based (3. integrals included in the formulation of the two methods mcG(q) and mdG(q) have to be evaluated using numerical quadrature. Diﬀerent choices of data ϕT and g for the dual problem give diﬀerent error estimates. 3. we make an initial guess for the values of qij {ξijm }m=1 .1) with the multi-adaptive Galerkin methods. To extend the explicit strategy described in the previous section to an iterative method. .1. 3. where estimates for the quantity T LϕT . .1) for every element within the time-slab. The discrete equations for the mdG(q) method are similar in structure and so we focus on the mcG(q) method.g (e) = (e(T ). This corresponds to ﬁxed point iterating once on the discrete equations (3. which is reached when the computational residuals. in which the discrete equations are solved to within a prescribed tolerance. according to the order of Ul (t) on that interval. 3. This gives an explicit time-stepping method in which each component is updated individually once. In practice. {wmn }m=1. Lundh. so we may apply ﬁxed point iteration directly to (3. One way to choose time-steps and orders could be to solve over some short time-interval with diﬀerent time-steps and orders. To control the resulting quadrature error.1).1) ξijm = ξij0 + kij n=0 q −1 −1 [q [qij wmn ] fi (U (τij (s[qij ] )).. ξijm = ξij0 for m = 1.2) The last component steps ﬁrst. and S¨derlind [6]. and the procedure continues according to the strategy (3. . on all elements are small enough. Adaptive order. are interpolated or extrapolated from their latest known values.j−1 ). i. 1]: τij (t) = (t − ti. we need to be able to go back and redo iterations if necessary.n=0 are weights. provided the parameters of the regulator are well tuned. repeating the procedure until convergence. the one closest to t = T . as described in [10]. and moves forward in time. This means that we should always make a step with the component that is closest to time t = 0. We do this by arranging the elements—we think of an element as a component Ui (t) on a local interval Iij —in a time-slab. the one closest to t = 0. . The simplest choices are g = 0 and (ϕT )i = δin for control of the ﬁnal time error of the nth component. .g. we have to solve a large system of equations. ·). we take g = 0 and ϕT = e(T )/ e(T ) with an approximation e of the error e. . the nonlinear discrete algebraic equations for the mcG(q) method (including numerical quadrature) to be solved on every local interval Iij take the form qij maps Iij to (0.e.. q-adaptivity.e.2). in fact. based on estimates of the quadrature error presented in [10]. This contains a number of elements. n ij where {ξijm }m=1 are the degrees of freedom to be determined for component Ui (t) [qij ] qij [q ] qij on interval Iij . We solve this system of equations iteratively. Adaptive quadrature. The time-slab. the polynomial orders have to be chosen in an ad hoc fashion for every interval. The formulations of the methods include the possibility of individual and varying orders for the diﬀerent components. which implicitly deﬁne the solution. If we suspect that the problem will change character. In this section we discuss how to solve the discrete equations that we obtain when we discretize (1. possible to guess the data for the dual. following (3. 3. 2.e. and then we extend this strategy to an iterative method. a minimum of N elements. the quadrature rule can be chosen adaptively. following work by S¨derlind [15] and Gustafsson. As an initial simple strategy we may try to solve the system of nonlinear equations (3. namely.3.

The price we have to pay is that we have in general no common nodes. After iterating through the time-slab a few times.4.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1123 1124 ANDERS LOGG PSfrag replacements 0 T PSfrag replacements rag replacements 0 T Fig. Another possibility is a rational partition of the time-slab. choose the time-step as a fraction K/2n . the values have been computed using extrapolated values of many of the other elements. We will not discuss here the implementational and data structural aspects of the algorithm—there will be much to keep track of and this has to be done in an eﬃcient way—but we will give a brief T PSfrag replacements 0 T Fig. on all elements have decreased below a speciﬁed tolerance for the computational error. choose the largest time-step K as the length of the new time-slab. K/3. In this way we stay close to the original. general formulation of the multi-adaptive methods.1). Top: a dyadic partition of the time-slab.3. as compared to dyadic partitioning. In this way we increase the set of possible time-step selections. For the elements at the front of the slab (those closest to time t = T ). bottom: a partition used in the time-crawling approach. i. K/2. such as the one in Figure 3. but the number of common nodes shared between diﬀerent components is decreased. 3. and then. Assume that in some way we have formed a time-slab. 3. for every component. we focus below on unconstrained time-step selection. Although dyadic or rational partitioning is clearly advantageous in terms of easier bookkeeping and common nodes. The advantage of such a partition are that the time-slab has straight edges. The strategy now is to leave behind only those elements that are fully covered by all .. corresponding to the solution of the discrete equations (3.1. 0 on residuals and stability properties. We choose the largest individual time-step K as the length of the time-slab. K/4. and the edges of the time-slab are no longer straight. where the only restriction on the time-steps is that we match the ﬁnal time end-point T . and that the components have many common nodes.2. The disadvantage is that the choice of time-steps is constrained. A third option is to not impose any constraint at all on the selection of timesteps—except that we match the ﬁnal time end-point. The time-steps may vary also within the time-slab for the individual components. starting with the last element and continuing to the right. The time-crawling approach. and so on. The construction of the time-slab brings with it a number of technical and algorithmic problems.e. We make iterations on the time-slab. and time-steps for the remaining components are chosen as fractions of this large time-step.2. account of how the time-slab is formed and updated. 3. middle: a rational partition. We illustrate the three choices of partitioning schemes in Figure 3. Diﬀerent choices of time-slabs. for every time-slab there is a common point in time t (the end-point of the time-slab) which is an end-point for the last element of every component in the time-slab. We refer to this as the time-crawling approach. The last component steps ﬁrst and all needed values are extrapolated or interpolated. the computational (discrete) residuals. indicating convergence.

7. On every element we then want to solve (3. with (3. but still has some advantages of the full Newton’s method.8) θ= 1 ∂f 1 − kij ∂ui i so that we may view the simpliﬁed Newton’s method as a damped version.e. Otherwise the strategy is to decrease the time-steps whenever needed for stability reasons. and incorporating new elements at the front of the time-slab.j−1 − kij fi (U (tij ). For the general mcG(q) or mdG(q) method. In order to apply Newton’s method we write (3. those closest to time t = 0). 1 − kij ∂ui will be a small local matrix of size q × q for the mcG(q) method i and size (q + 1) × (q + 1) for the mdG(q) method. The time-slab is thus crawling forward in time rather than marching. depending on the solution strategy for these equations. 3. i. the same analysis applies.j−1 + kij fi (U (tij ).3) Uij = Ui.5) V n+1 = V n − (F (V n ))−1 F (V n ). with the right-hand side evaluated at V n .3).j−1 − kij fi ∂f 1 − kij ∂ui i Fig. However. which is especially important in our setting.3) as (3. Using a diagonal Newton’s method as in the current implementation of Tanganyika.7) n+1 n n n Uij = Uij − θ(Uij − Ui. Diagonal Newton. We now note that we can rewrite this as (3. decreasing the size of the time-slab (cutting oﬀ elements at the end of the time-slab. Typically this results in an oscillating sequence of time-steps where . To avoid this.1) on each time-slab. but we may expect to meet diﬃculties for stiﬀ problems. 3. and we need to use a more implicit solution strategy.6) n+1 n Uij = Uij − n Uij − Ui. Consider for simplicity the case of the multi-adaptive backward Euler method. In a stiﬀ problem the solution varies quickly inside transients and slowly outside transients. The time-slab used in the time-crawling approach to multi-adaptive time-stepping (dark grey).j−1 + kij fi ) other elements.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1125 1126 ANDERS LOGG i. Remark 3. We do not need to store the Jacobian and we do not need linear algebra. of the original ﬁxed point iteration. rag replacements 0 T We now simply replace the Jacobian with its diagonal so that for component i we have (3. Both mcG(q) and mdG(q) are implicit methods since they are implicitly deﬁned by the set of equations (3. 3. Outside the transients the diagonal Newton’s method handles stiﬀ problems of suﬃciently diagonal nature.e. with damping θ. These are then cut oﬀ from the time-slab.4) F (V ) = 0 with Fi (V ) = Uij − Ui. We form the new time-slab by requiring that all elements of the previous time-slab be totally covered within the new time-slab.1. 3. tij ). we have to form a new time-slab. the mdG(0) method with end-point quadrature. Explicit or implicit..3.6. however. For accuracy the time-steps will be adaptively kept small inside transients and then will be within the stability limits of an explicit method. one can impose the requirement that the time-slabs should have straight edges. This will contain the elements of the old time-slab that were not removed. Light grey indicates elements that have already been computed. while outside transients larger time-steps will be used. In this case. but this is costly in terms of memory and computational time. and so on. we obtain a method of basically explicit nature. tij ) and Vi = Uij .5. Newton’s method is then (3. Applying a full Newton’s method. the resulting fully discrete scheme may be of more or less explicit character. and a number of new elements. when we have more degrees of freedom to solve for on every local ∂f element. An implementation of the method then contains the three consecutive steps described above: iterating on an existing time-slab. Even if an element within the time-slab is totally covered by all other elements. the values on this element still may not be completely determined. This gives an eﬃcient code for many applications. we increase the range of allowed time-steps and also the convergence rate. or if this element is based on yet another element that is not totally covered.. We still obtain some of the good properties of the full Newton’s method. if they are based on the values of some other element that is not totally covered. In this way we know that every new time-slab will produce at least N new elements. We thus look for a simpliﬁed Newton’s method which does not increase the cost of solving the problem. N (see Figure 3. which then decreases in size. For stiﬀ problems the time-step condition required for convergence of direct ﬁxed point iteration is too restrictive. as compared to direct ﬁxed point iteration.j−1 − kij fi ) = (1 − θ)Uij + θ(Ui. Before starting the iterations again. The individual damping parameters are cheap to compute. since the size of the slab may often be much larger than the number of components. The stiﬀness problem.

1. 5. these are all computable by standard techniques in numerical analysis.. cGqElement. When solving the dual. rx − y − xz. and r = 28.9.2) and ﬁnd that the error is about the same and constant for both methods. In this section.e. This is an ODE in itself that we can solve using the same solver as for the primal problem.1. For the multi-adaptive method. in the sense that the resolution needed to compute the solution will be completely determined by the fast oscillations of the smallest mass. We then compute the solution with individual time-steps. we can solve the discrete equations directly without any iterations.se/tanganyika/. The pertinent question is then the number of small stabilizing time-steps per large time-step. In order to solve this ODE. σ = 10. For demonstration purposes. In Tanganyika. This makes the computation of the dual solution expensive.” With our perspective this is reﬂected by stability factors with rapid growth in time.1). where N is the size of the system. We analyze this question in [3] and show that for certain classes of stiﬀ problems it is indeed possible to successfully use a stabilized explicit method of the form implemented in Tanganyika. we need to know the Jacobian of f evaluated at a mean value of the true solution u(t) and the approximate solution U (t). Structure and implementation. The Lorenz system. To demonstrate the potential of the multi-adaptive methods.1. we consider a dynamical system in which a small part of the system oscillates rapidly. and choosing ki = 100k0 for the other components (knowing that the frequency of the oscillations √ scales like 1/ m). The cpu time increases somewhat. b = 8/3. As N increases. as we can for reasonably small systems. ErrorControl. The C++ language makes abstraction easy. e. Purpose. We now give a short description of the implementation of the multi-adaptive methods. however. and the Jacobian must be computed numerically by diﬀerence quotients if it is not explicitly known. 10% may be disastrous for the primal. Preparations. we also have to solve the continuous dual problem to obtain error control. as in Figure 5.phi. The purpose of Tanganyika [12] is to be a working implementation of the multi-adaptive methods. Although somewhat messy to compute.g. The problem is to accurately compute the positions (and velocities) of the N point-masses attached with springs of equal stiﬀness.2. To compare the multi-adaptive method with a standard method. y(0). and so on. including Solution. 4. A simple test problem. we present numerical results for a variety of applications. 5. A more extensive account can be found in [11]. the dual problem is linear. we thus choose the time-steps a priori to ﬁt the dynamics of the system. 3. then we expect the dynamics of the system to be dominated by the smallest mass. 4. If U (t) is suﬃciently close to u. We consider now the famous Lorenz system. which means that anyone can freely review the code. 4. which allows the implementation to follow closely the formulation of the two methods. For this particular problem the gain of the multi-adaptive method is thus a factor N . the dual problem does not have to be solved with as high a precision as the primal problem. If we choose one of the masses to be much smaller than the others. the total number of time-steps and local function evaluations remains practically constant as we increase N . Applications. Tanganyika. The solver is implemented as a C/C++ library. and the cpu time increase linearly for the standard method. Tanganyika. m1 = 10−4 and m2 = m3 = · · · = mN = 1. 5.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1127 1128 ANDERS LOGG a small number of large time-steps are followed by a small number of stabilizing small time-steps. The solution u(t) = (x(t). the primal solution must be accessible. which we will assume. which has been used to obtain the numerical results presented below. 3. these numbers are computed at the startup of the program and stored for eﬃcient access. We repeat the experiment for increasing values of N (see Figure 5. Component. xy − bz. ˙ x y ˙ z ˙ = = = σ(y − x). choosing the time-steps ki = k0 for the position and velocity components of the smallest mass. etc. 5. as we expect. see. say. which is acceptable. Fig. We discuss some of the problems in detail and give a brief overview of the rest. z(0)) = (1. Element. N M = i=1 Mi . There are many “magic numbers” that need to be computed in order to implement the multi-adaptive methods. Solving the dual problem. dGqElement. y(t). and the number of local function evaluations. chalmers. Second.1. [13]. which needs small stabilizing wing ﬂaps to follow a smooth trajectory.8. Galerkin. Error control can. so that by considering a large-enough system. The code is open-source (GNU GPL [1]). the number of local function evaluations (including also residual evaluations). the gain is arbitrarily large. using the mcG(1) method. although not nearly as much as for the standard method. . In addition to solving the primal problem (1. z(t)) is very sensitive to perturbations and is often described as “chaotic. Our solver Tanganyika thus performs like a modern unstable jet ﬁghter. If we can aﬀord the linear algebra.2. on the other hand. see [5]. which may be taken into account when implementing a solver for the dual.. we ﬁrst compute with constant time-steps k = k0 using the standard cG(1) method and measure the error. since the increasing size of the time-slabs introduces some overhead. we approximate the (unknown) mean value by U (t). Diﬀerent objects and algorithms are thus implemented as C++ classes. the total number of time-steps. 0. such as quadrature points and weights. 0). whereas for the dual this only means that the error estimate will be oﬀ by 10%. the cpu time needed to obtain the solution. (5.1) with the usual data (x(0). A mechanical system consisting of N = 5 masses attached with springs. the total number of steps. be obtained at a reasonable cost: for one thing. i. a relative error of. Comments are welcome. which is available at http://www. TimeSlab. the polynomial weight functions evaluated at these quadrature points.

For the lower-order methods.2.5 4 3 2 1 0 rag replacements 1 0. These errors accumulate at a rate determined by the growth of the stability factor for the computational error (see [10]). e(T ) 4 2 0 20 40 60 80 100 2 x 10 5 x 10 5 7 1. Starting with the cG(12) method. and number of function evaluations as function of the number of masses for the multi-adaptive cG(1) method (dashed lines) and the standard cG(1) method (solid lines). Error. and so mcG(q) becomes cG(q)—but on higher-order methods and the precise information that can be obtained about the computability of a system from solving the dual problem and computing stability factors. this stability factor grows exponentially for the Lorenz system and reaches a value of 1016 at ﬁnal time T = 50. The focus in this section is not on multi-adaptivity—we will use the same time-steps for all components. The computational challenge is to solve the Lorenz system accurately on a timeinterval [0. On the left is a plot of the time variation of the three components.1 for all components. We investigate the computability of the Lorenz system by solving the dual problem and computing stability factors to ﬁnd the maximum value of T . 40]. function evaluations steps .4 solutions obtained with diﬀerent methods and constant time-step k = 0. T ] with T as large as possible. In Figure 5.5 0 20 40 60 80 100 20 40 60 80 100 Fig. total number of steps. it is clear that the error decreases as we increase the order. we present in Figure 5.3. cG(5) to cG(11). we note that in every time-step a small round-oﬀ error of size ∼ 10−16 is introduced if the computation is carried out in double precision arithmetic. cpu time. As we shall see below. however. and so at this point the accumulation of round-oﬀ errors results in a large computational error.3 is shown a computed solution which is accurate on the interval [0. As an illustration. To explain this. On the right is the trajectory of the Lorenz system for ﬁnal time T = 40. 5. 5.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II x 10 8 −5 1129 1130 50 ANDERS LOGG 50 20 cpu time / seconds 6 ∞ 15 40 45 40 10 e(T ) 4 30 35 2 5 20 0 5 10 15 20 30 0 5 10 15 20 U 10 z 0 10 20 30 40 25 4 x 10 4 x 10 10 6 3 function evaluations 0 20 8 6 4 2 0 15 −10 10 steps 2 rag replacements 1 PSfrag replacements −20 5 0 5 10 15 20 5 10 15 20 −30 x 10 8 −5 t 0 −20 −10 0 x 10 20 70 cpu time / seconds 6 ∞ 60 50 40 30 20 10 0 20 40 60 80 100 Fig. computed with the multi-adaptive cG(5) method. the error does not decrease as we increase the order.

such as 0 10 20 30 40 50 60 70 80 90 100 T cG(12) cG(14) Sfrag replacements cG(5) cG(6) cG(7) cG(8) cG(9) cG(10) cG(13) (5. corresponding to computational and quadrature errors as described in [10]. 5. as function of time for the Lorenz system. The stability factor grows exponentially with time. which for the Lorenz system turns out to be quite sharp and which is simpler to compute since we do not have to compute the maximum in (5. but not as fast as indicated by an a priori error estimate. The stability factor for computational and quadrature errors.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 20 1131 1132 ANDERS LOGG cG(5) 0 −20 0 20 10 20 30 40 50 60 70 80 90 100 10 16 10 14 cG(6) 0 −20 0 20 10 10 20 30 40 50 60 70 80 90 100 12 cG(7) Sfrag replacements −20 0 20 10 20 30 40 50 60 70 80 90 100 ¯ S [0] (T ) PSfrag replacements 0 10 10 10 8 cG(8) 0 −20 0 20 10 10 20 30 40 50 60 70 80 90 100 6 cG(9) 0 −20 0 20 0 −20 0 10 20 30 40 50 60 70 80 90 100 10 20 30 40 50 60 70 80 90 100 10 4 cG(11) cG(12) cG(13) cG(14) cG(15) cG(10) 10 2 10 0 0 20 5 10 15 20 T 30 35 40 45 50 cG(11) 0 −20 20 Fig. we have T 0 −20 20 (5. 0 0 −20 20 T T 0 10 20 30 40 50 60 70 80 90 100 where ϕ(t) is the solution of the dual problem obtained with ϕ(T ) = v (and g = 0).4.5 we plot the growth of the stability factor for q = 0. 5. Letting Φ(t) be the fundamental solution of the dual problem.2) S [q] (T ) = max v =1 ϕ(q) (t) dt. 0 10 20 30 40 50 60 70 80 90 100 0 −20 20 5. using a constant time-step k = 0. Solutions for the x-component of the Lorenz system with methods of diﬀerent order.2).1. We now investigate the computation of stability factors for the Lorenz system.4) S [q] (T ) ∼ Aq eAT . cG(15) . ¯ This gives a bound S [q] (T ) for S [q] (T ). In Figure 5. An a priori error estimate indicates that the stability factors grow as (5. Stability factors.1. Dotted lines indicate the point beyond which the solution is no longer accurate.5.2.3) 0 10 20 30 40 50 60 70 80 90 100 max v =1 0 Φ(q) (t)v dt ≤ max Φ(q) (t)v dt = 0 v =1 0 ¯ Φ(q) (t) dt = S [q] (T ). For simplicity we focus on global stability factors. 0 −20 0 10 20 30 40 50 60 70 80 90 100 Fig.

As initial conditions we take the values at 00.9) EC ≈ 10T /3 1 1 10−16 = 10T /3−16 . which is (approximately) the mean distance between the Sun and Earth. min kij min kij Fig. we expect numerical errors as well as stability factors to grow quadratically. we can reach 10 times further. which is a particularly important n-body problem of the form (5.6). where we have S [0] (T ) ≈ 101000 .3. obtained from numerically computed solutions of the dual problem. concerning how far the system is computable with correct initial data and correct model.) 5.2. The point is that although the stability factors grow very rapidly on some occasions.3. the Moon. 5. This initial data should be correct to ﬁve or more digits. Investigating the predictability of the solar system. Conclusions. In view of this. mi is the where xi (t) = mass of body i. and the Sun over a period of 50 years. Since errors in initial data grow linearly.00 Greenwich mean time on January 1. including the Sun. A simple approximation of this growth rate.8) RC (t) = i 1 kij U (tij ) − U (ti. is (5. (With quadruple precision we would be able to reach time T = 100. we ﬁnd that the solar system is computable on the order of 500 years. which is similar to the available precision for the masses of the planets. To predict the computability of the Lorenz system. 1 −16 .T ] C [0] C . obtained from the United States Naval Observatory [2]. With time-steps kij = 0. such as near the ﬁrst ﬂip at T = 18. we estimate the growth rate of the stability factors. Part of the dual of the solar system with data chosen for control of the error in the position of the moon at ﬁnal time. the time coordinates per year. where the computational residual R is deﬁned as (5. we compute the trajectories for Earth.6) ¯ S [q] (T ) ≈ 10q+T /3 . 2000. with initial velocities (x1 (t). Predictability. ·) dt . With this normalization. We thus conclude by examination of the stability factors that it is diﬃcult to reach beyond time T = 50 in double precision arithmetic.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1133 1134 1000 800 600 400 200 ANDERS LOGG where A is a bound for the Jacobian of the right-hand side for the Lorenz system.2. the Moon. kij 10 0 −200 −400 −600 −800 −1000 0 1 2 3 4 5 From the a posteriori error estimates presented in [10]. Computability. we solve the dual problem and compute stability factors.2.3.10) EC ≈ 10T /3−15 . given the precision in initial data. and G is the gravitational constant.11) ¨ mi xi = j=i Gmi mj (xj − xi ). 5. the gravitational constant is 4π 2 . In order to predict the accumulation rate of errors. obtained by ﬁtting a high-degree polynomial to the values of December 1999. the growth is not monotonic. we cannot compute more than a few years. and the masses per solar mass. and so errors in initial data grow linearly with time. 5.7) EC ≈ S (T ) max R [0. |xj − xi |3 denotes the position of body i at time t. Assuming the initial data is correct to ﬁve or more digits. and so already at time T = 45 we have EC ≈ 1 and the solution is no longer accurate. We now consider the solar system.6. This means that for every extra digit of increased precision. and certainly not to T = 50.1. the question is how far we can accurately compute the solution. x2 (t). we ﬁnd that the computational error can be estimated as (5. The solar system.j−1 ) − Iij t 6 7 8 9 10 With 16 digits of precision a simple estimate for the computational residual is which gives the approximation (5. To touch brieﬂy on the fundamental question of the computability of the solar system. and the nine planets. We normalize length and time to have the space coordinates per astronomical unit. which already at T = 1 gives S [0] (T ) ≈ 1022 . ¯ S [q] (T ) ≈ 4 · 10(q−3)+0. we would not be able to compute even to T = 1. The stability factors thus eﬀectively grow at a moderate exponential rate. A simple estimate is A = 50.5) or just (5. x3 (t)) i i i . 5. Including also the Moon.37T ϕ PSfrag replacements fi (U. The dual solution grows linearly backward in time (see Figure 5. AU.1 as above we then have (5. comparing diﬀerent methods.

To begin with. This is an example of a Hamiltonian system for which the error growth is neither linear nor quadratic. the linear growth ﬂattens out as the error reaches the limit. This is in accordance with earlier observations [4. we require that corresponding position and velocity components use the same time-steps. we thus cannot expect to have linear error growth. it will be outrun on a long enough interval by the cG(1) method. and thus also the velocity.001 with cG(1).5 t 3 3. we may think of the error introduced at every time-step by an energyconserving method as a pure phase error. and so at every time-step the Moon is pushed slightly forward along its trajectory (with the velocity adjusted accordingly). is incorrect.5 0 10 20 30 40 50 −0.7 we plot the errors for the 18 components of the solution. which has linear accumulation of errors (for this particular problem).5 0 10 20 30 40 50 −4 −4 t 0 1 2 t 3 4 5 x 10 5 −4 cG(2) 5 x 10 −3 dG(2) 10 −1 PSfrag replacements 10 −5 0 10 20 −5 −3 t 30 40 50 0 10 20 t 30 40 50 k 0 rag replacements 10 −2 e 0 0 0. but the position relative to Earth. Since a pure phase error does not accumulate but stays constant (for a circular orbit). For the dG(1) solution.3. we have to be much more careful than if we want to compute to a point just before t . we could instead reach T ∼ 106 .5 2 2. together with the multi-adaptive time-steps. The growth of the error over 5 years for the Earth–Moon–Sun system computed with the mcG(2) method.5 4 4.3.5 1 1. the error reaches a maximum level of ∼ 0. Examining the solutions obtained with the dG(1) and dG(2) methods. 10−18 . as here. cG(2). grow quadratically and thus overestimate the error growth for this particular problem. dG(1). we see that the error grows quadratically. Fig. the position of which is still very accurate. recalling that the (m)cG(q) methods conserve energy [10]. the error grows quadratically. Decreasing tol to. we see that the error seems to grow linearly for the cG methods. Solving with the multi-adaptive method mcG(2) (see Figure 5. Notice also that even if the higher-order dG(2) method performs better than the cG(1) method on a short time-interval. and dG(2). 7] for periodic Hamiltonian systems. The conclusion is that if we want to compute accurately to a point beyond t . 5. computed for k = 0. This eﬀect is also visible for the error of the cG(1) solution. This is not evident from the size of residuals or local errors. The error in position for the Moon is much smaller. The growth of the error over 50 years for the Earth–Moon–Sun system as described in the text.7. This means that the Moon is still in orbit around Earth. This ﬁgure contains much information.5 5 Fig. the error grows as 10−4 T 2 and we are able to reach T ∼ 100. say.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1135 1136 4 x 10 −3 ANDERS LOGG All components 4 x 10 −5 cG(1) 0. Computing with diﬀerent timesteps for all components.5 for the velocity components of the Moon.5 dG(1) Position of the Moon 2 2 e 0 0 e 0 e 0 1 2 3 4 5 0 −2 −2 −0. as we expect. 2 Keeping ki ri ≤ tol with tol = 10−10 as here.8).8. . We saw in [10] that in order for the mcG(q) method to conserve energy. In Figure 5. The stability factors. 5. 5. The error thus grows quadratically until it reaches a limit. Multi-adaptive time-steps. however.5 0. In an attempt to give an intuitive explanation of the linear growth. We investigated the passing of a large comet close to Earth and the Moon and found that the stability factors increase dramatically at the time t when the comet comes very close to the Moon. the many small phase errors give a total error that grows linearly with time.

2 0 0 0. ˙ .10. which use small time-steps. More work is thus required to compute the multi-adaptive solution.8 1 x x 5 4 5 4 k1 PSfrag replacements 2 1 0 k2 0 0. x Fig.12) u1 − u1 ˙ u2 − u2 ˙ = = −u1 u2 . Computing on a space grid consisting of 16 nodes on [0. we present a computation in which we combine multi-adaptivity with the possibility of moving the nodes in a space discretization of a time-dependent PDE. T = 100. with x0 = 0.6 0. T ] with = 0.5. 1) × (0.6 0. 5.2 0 0 0. increasing the size of the domain to 32 nodes on [0. and the reason is the overhead resulting from additional bookkeeping and interpolation in the multiadaptive computation. adding extra degrees of freedom does not substantially increase the cost of solving the problem.8 1 U2 0. there is a lot to gain by using small time-steps only in this area.1 seconds on a regular workstation. we ﬁnd that the time-steps are small only close to the reaction front. 1. Burger’s equation with moving nodes.7 seconds. However. and homogeneous Neumann boundary conditions at x = 0 and x = 1 models isothermal autocatalytic reactions (see [14]) A1 + 2A2 → A2 + 2A2 . since the main work is done time-stepping the components. x < x0 . whereas the multi-adaptive solution is computed in 3. The concentrations of the two species U1 and U2 at time t = 50 as function of space (above) and the corresponding time-steps (below). The two parts of the plots represent the components for the two species A1 (lower parts) and A2 (upper parts).4 0. x ≥ x0 .2 and u2 (x.2 0. The reaction then propagates to the right until all of substance A1 is consumed and we have u1 = 0 and u2 = 1 in the entire domain. the solution is computed in 2.8 U1 0. 2] and keeping the same parameters otherwise.6 0.2 1 0.00001.4 0.8 ANDERS LOGG 1. 5. (5.6 0. Indeed. Solving Burger’s equation.0 seconds.4 seconds. A propagating front problem. Computing on the same grid with the multi-adaptive method (to within the same accuracy).9 and 5.4 0. we ﬁnd that the solution is computed in 3. A space-time plot of the solution (above) and time-steps (below) for the propagating front problem.4 0.2 0. see Figures 5. As a ﬁnal example. resulting in a decrease in the concentration u1 and an increase in the concentration u2 . 5.8 1 x Fig.6 0.4 0. 1] (resulting in a system of ODEs with 32 components).6 0. 5. To verify this. the computation using equal time-steps now takes 5. 2 u1 u2 2 on (0.4. 0) = 0. 0).8 1 3 3 2 1 0 0 0.10. we compute the solution to within an accuracy of 10−7 for the ﬁnal time error with constant time-steps ki (t) = k0 for all components and compare with the multi-adaptive solution.2 0.2 1 0.2 0. The reaction front propagates to the right as does the domain of small time-steps. The system of PDEs (5.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1137 1138 1. we ﬁnd the solution is now more localized in the domain and we expect the multi-adaptive method to perform better compared to a standard method. with time going to the right. An initial reaction where substance A1 is consumed and substance A2 is formed will then occur at x = x0 .4 0.1.9. Solving with the mcG(2) method. In the same way as previously shown in section 5. 0) = 1 − u1 (x. It is clear that if the reaction front is localized in space and the domain is large.13) u + µuu − u = 0. We choose the initial conditions as u1 (x.

and t = T . Phys.3 0.usno.4 0.12. 1) × (0.4 0.se/preprints/. 10 (2000). t = T /2. Sweden. Estep.1 0.4 0 1 0. (1. 28 (1988). Models Methods Appl.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1 1139 1140 1 ANDERS LOGG U (x) 0.11 and 5. and with µ = 0.11. Solving with the mdG(0) method.2 0.3.5 0..org/. pp. [7] M. we make the ansatz N (5. pp.5 0.4 0. Johnson. Logg. Lundh.9 1 x Fig. http://www. in the direction of the convection.se/preprints/. 5. 1142–1157. Explicit time-stepping for stiﬀ ODEs. Estep and C. Also available online from o http://www. Math.5 0.2 0.1 rag replacements 0 0 0.9 1 0 0 0.1 0.2 0. Math. Preprint 2000-02. Sweden. = 0.3 0. Fig. and the {ϕi (·. [8] A.4 0.9 1 0.14) u0 (x) = sin(πx/x0 ). [2] USNO Astronomical Applications Department. 6. and G. Allowing individual time-steps within the domain. Also available online o from http://www.7 0. Chalmers University of Technology. pp. 5. 2000. [5] D. A Multi-Adaptive ODE-Solver. for which memory usage becomes an important issue. G¨teborg.navy. the nodes move into the shock. M. Gustafsson. BIT.5 0. 270–287. G¨teborg. Comput.9 1 0. Future work. Angew.. 0 0 ≤ x ≤ x0 ..3 0. and A. [4] D. Future work will include a more thorough investigation of the application of the multi-adaptive methods to stiﬀ ODEs.5 PSfrag replacements x 0.7 0. Sci. pp.15) U (x. on (0.6 0.5 t 0 0.1 0.2 0.8 0.1 0. Chalmers University of Technology.7 0. Models Methods Appl. Johnson.3 U (x) 0. Chalmers Finite Element Center. REFERENCES [1] GNU Project Web Server. µu). A pi stepsize control for the numerical solution o of ordinary diﬀerential equations. Multi-Adaptive Error Control for ODEs.9 0. t)}N are piecewise linear basis functions in space for any i=1 ﬁxed t. Larson.6 0.8 0.mil/. SIAM J. we ﬁnd the solution is a shock forming near x = x0 . S¨ derlind.7 0. as well as the construction of eﬃcient multi-adaptive solvers for time-dependent PDEs. . where the {ξi }N are the individual components computed with the multi-adaptive i=1 method.phi. and x0 = 0. Eriksson. T ] with initial condition (5. Logg.001. The computability of the Lorenz system.chalmers. 8]).. t) = i=1 ξi (t)ϕi (x. 2000. so what we are really solving is a heat equation with multi-adaptive time-steps along the streamlines.chalmers. and moving the nodes of the space discretization in the direction of the convection. pp.12. Logg.5 0. [6] K.8 0 1 0 0. C.1. 25 (2003). Error growth and a posteriori error estimates for conservative Galerkin approximations of periodic orbits in Hamiltonian systems. [3] K. Sci.6 0. http://aa. 46 (1995).6 0.8 0. [9] A.gnu. 1277–1305.7 0. Sci. The solution to Burger’s equation as function of space at t = 0. this paper serves as a starting point for further investigation of the multi-adaptive Galerkin methods and their properties. The rate of error growth in Hamiltonian-conserving integrators.2 0. see Figures 5. 8 (1998). Chalmers Finite Element Center.phi. Node paths for the multi-adaptive moving-nodes solution of Burger’s equation. Math.6 U (x) 0.8 0. elsewhere.5 0. G. Z. t). Preprint 2000-03.3 0. 407–418. Together with the companion paper [10] (see also [9. 31–46.

D. Chalmers University of Technology. [11] A. 11 (1998). Numerical Recipes in C. pp. 1996. Sci.MULTI-ADAPTIVE GALERKIN METHODS FOR ODEs II 1141 [10] A. o [15] G. Cambridge. Also available online from http://www.. 2nd ed. S.phi.com. Adaptive Finite Element Methods for Reactive Flow Problems. Flannery. and B.se/tanganyika/.se/preprints/. Logg. Chalmers University of Technology. G¨teborg. Ph. 24 (2003). Solving diﬀerential equations o on parallel computers. 1879–1902. SIAM J.chalmers. S¨ derlind. G¨teborg. Vetterling. Department of Mathematics. Sweden.2. W. pp. Sandboge. [14] R. Comput. The automatic control of numerical integration. 2001. [13] W. Sweden. Version 1. UK. Cambridge University Press. Teukolsky.. o 2001. http://www.chalmers. thesis. Tanganyika. The Art of Scientiﬁc Computing. Chalmers Finite Element Center. CWI Quarterly. Logg. Logg. Press.nr. 1992. Also available online from http://www.phi. [12] A. 55–74. Multi-adaptive Galerkin methods for ODEs I. . Preprint 2001-10. Multi-Adaptive Galerkin Methods for ODEs II: Applications.

We denote the length of a time slab by K n = Tn − Tn−1 . we only give a quick overview of the notation: Each component Ui (t). Notation. Individual partitions of the interval (0. and the length of the subinterval is given by the local time step k ij = tij − ti. for approximate (numerical) solution of ODEs of the form (1. 1.j−1 < tij ≤ Tn }. we refer to [4. including strong stability estimates for parabolic problems. Outline of the paper. 2004. T ] → RN is the solution to be computed. T ] into M i subintervals. Anders Logg. ˙ u(0) = u0 . Department of Computational Mathematics.2. we prove a posteriori error estimates. by proving (relevant) ﬁxed point iterations assuming the time steps are suﬃciently small. discontinuous Galerkin.j−1 . existence. Date: March 15. mcG(q) and mdG(q). we return to the a priori error analysis of the multi-adaptive methods. t). . The stability estimates derived in this paper will then be essential. SE–412 96 G¨teborg. The proof is constructive and mimics the actual implementation of the methods. we have N = 6 and M = 4.1) u(t) = f (u(t).1) is a piecewise polynomial on a partition of (0. T ] is partitioned into blocks between certain synchronized time levels 0 = T 0 < T1 < . The multi-adaptive ODE-solver Tanganyika. . through which the time steps are adaptively determined from residual feed-back and stability information. Multi-adaptivity. In the companion paper [7]. mcgq. N . we prove existence and stability of discrete solutions.1. The mcG(q) and mdG(q) methods are based on piecewise polynomial approximation of degree q on partitions in time with time steps which may vary for diﬀerent components Ui (t) of the approximate solution U (t) of (1. For a detailed presentation of the multi-adaptive methods. . continuous Galerkin.j−1 tij Tn−1 Kn Tn T Figure 1. of the approximate m(c/d)G(q) solution U (t) of (1. In this paper. 1. Chalmers University of Technology. mdgq. o 1 t 0 kij ti. The ﬁrst part of this paper is devoted to proving existence of solutions for the multi-adaptive methods mcG(q) and mdG(q). 5]. i = 1. Ui |Iij is a polynomial of degree qij and we refer to (Iij . u0 ∈ RN a given initial condition. This paper is the third in a series devoted to multi-adaptive Galerkin methods. T ] → RN a given function that is Lipschitz-continuous in u and bounded. We also refer to the entire collection of intervals I ij as the partition T . Introduction This is part III in a sequence of papers [4. i where u : [0. local time steps. including the dual methods mcG(q) ∗ and mdG(q)∗ obtained by interchanging trial and test spaces. parabolic. strong stability. obtained by solving a dual linearized problem. and their dual versions mcG(q)∗ and mdG(q)∗ . We prove existence and stability of solutions for the multiadaptive Galerkin methods mcG(q) and mdG(q). email : logg@math. In part I and II of our series on multi-adaptive Galerkin methods. Key words and phrases. Iij PSfrag replacements 1. Here. t ∈ (0. a priori error estimates.2 ANDERS LOGG MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III: EXISTENCE AND STABILITY ANDERS LOGG Abstract.se.chalmers.1). presented in [5]. . dual methods. ODE. thus repeats the proof of existence each time it computes a new solution. we shall assume that the interval (0. tij ]. Sweden. . This is illustrated in Figure 1. . 5] on multi-adaptive Galerkin methods. individual time steps. which we later use together with special interpolation estimates to prove a priori error estimates for the mcG(q) and mdG(q) methods in part IV [7]. and f : R N × (0. Elements between common synchronized time levels are organized in time slabs. Furthermore. < TM = T . In this example. T > 0 a given ﬁnal time. We refer to the set of intervals Tn between two synchronized time levels Tn−1 and Tn as a time slab: Tn = {Iij : Tn−1 ≤ ti. Subinterval j for component i is denoted by I ij = (ti. On each subinterval I ij .j−1 . . T ]. Ui |Iij ) as an element. T ] for different components.

. and V is the space of (possibly discontinuous) piecewise polynomials of degree q − 1 on the same partition. similar to the deﬁnition of the continuous method: Find U ∈ V with U (0 − ) = u0 . the residual is orthogonal to the test space on each local interval. we deﬁne the trial space V and the test space V as (2.3) Iij We refer to (2. mcG(q).7) in the form (2.9) φ(T ) = ψ.3). T ). ψ ∈ RN is a given initial condition.j−1 v(ti.1) in the following way: Find U ∈ V with U (0) = u0 . where the initial condition is speciﬁed for i = 1. we prove stability estimates.4) as the Galerkin orthogonality of the mcG(q) method. t) ds ∂u . such that (2. we deﬁne the trial and test spaces by (2. Mi . . including general exponential estimates for mcG(q).j−1 ) given. For the a posteriori analysis. (2. an appropriate mean value of the transpose of the Jacobian of the right-hand side f (·. . j = 1.j−1 i=1 j=1 ˙ Ui vi dt = Iij 0 T (f (U. 2. i = 1. We now deﬁne the mdG(q) method for (1. we deﬁne the residual R ˙ of the approximate solution U by Ri (U. For the mdG(q) method. ·)v dt = 0 ∀v ∈ P qij −1 (Iij ). . t) = 0 ∂f (sπu(t) + (1 − s)U (t). j = 1. where P q (I) denotes the linear space of polynomials of degree q on an interval I. If now for each local interval I ij we take vn ≡ 0 when n = i and vi (t) = 0 when t ∈ Iij . v) dt ˆ ∀v ∈ V .7) [Ui ]i. v) dt = 0 T where the initial condition is speciﬁed for i = 1. V is the space of continuous piecewise polynomials of ˆ degree q = qi (t) = qij ≥ 1.2) as a sequence of successive local problems for each component: For i = 1. mcG(q) ∗ .j−1 Ri (U. . . Mi . N . . ﬁnd Ui |Iij ∈ P qij (Iij ) with Ui (ti.j−1 = Ui (t+ ) − Ui (t− ) denotes the jump in Ui (t) across the i. N by U i (0) = ui (0). . M i . . j = 1. . Multi-adaptive Galerkin and multi-adaptive dual Galerkin 2. t ∈ Iij . . on the partition T . that is. . mdG(q). N by U i (0− ) = ui (0). . t) = Ui (t) − fi (U (t). such that (2.j−1 . g : [0. t). T ])]N : vi |Iij ∈ P qij (Iij ). we can rewrite the global problem (2. . . ﬁnd Ui |Iij ∈ P qij (Iij ).8) [Ui ]i.j−1 vi (t+ ) + i. U. . The motivation for introducing the dual problem is for the a priori or a posteriori error analysis of the multi-adaptive methods. T ] → RN of the continuous dual backward problem ˙ −φ(t) = J (πu. . t) evaluated at πu(t) and U (t).5) ˆ V = V = {v : vi |Iij ∈ P qij (Iij ).j−1 . . i = 1.1) in the following way.j−1 node t = ti. N . The discrete dual solution Φ : [0. where [Ui ]i. and 1 ˙ Ui v dt = Iij fi (U. .6) N Mi [Ui ]i. .j−1 i. j = 1. t ∈ [0. . . . ∀v ∈ P qij (Iij ).2. . ·)v dt ∀v ∈ P qij (Iij ). The mdG(q) method in local form. mdG(q). .3) as (2. deﬁned on the inner of each local interval Iij . Multi-adaptive continuous Galerkin. . where πu is an interpolant or a projection of the exact solution u of (1. . N }. We now deﬁne the mcG(q) method for (1. ·) denotes the RN inner product. and strong stability estimates for parabolic problems for the mdG(q) and mdG(q)∗ methods. ·). . j = 1. such that T that is.1. we formulate a continuous dual problem [4]. both trial and test functions are (possibly discontinuous) piecewise polynomials of degree q = qi (t) = qij ≥ 0. In other words. In terms of the residual. . . . . . ˆ V = {v : vi |Iij ∈ P qij −1 (Iij ). t ∈ Iij . and mdG(q)∗ . t).8) as the Galerkin orthogonality of the mdG(q) method. . . where (·. . t) = ˙ Ui (t) − fi (U (t). we can rewrite (2. and rewrite (2. . 2. corresponding to (2. 2. .MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 3 4 ANDERS LOGG In the second part of this paper. . . reads: For i = 1. . Mi . .1) V = {v ∈ [C([0. U. T ] → RN is a given function. . such that (2.3.j−1 ) + Iij ˙ Ui v dt = Iij fi (U. . T ] → R N is a Galerkin approximation of the exact solution φ : [0. We refer to (2. Mi . on the partition T . that is. Multi-adaptive discontinuous Galerkin. We deﬁne the mdG(q) solution U ∈ V to be left-continuous. t)φ(t) + g(t). Note that the residual has two parts: one interior part R i and the jump term [Ui ]i. To formulate the ˆ mcG(q) method. . ·). In the same way as for the continuous method. . The dual problem. v) dt ˆ ∀v ∈ V . ·)v dt ∀v ∈ P qij −1 (Iij ).j−1 v(t+ ) + i. (2. For the a priori analysis [7]. We deﬁne the residual R of the approximate solution U by R i (U. N }. i = 1. ·)v dt = 0 Iij (f (U. we formulate a discrete dual problem in terms of the dual multi-adaptive methods mcG(q) ∗ and mdG(q)∗ . N }. . (2. Note that by the chain .2) 0 ˙ (U .10) J (πu. .4) Iij Ri (U.1).

1]). 1]). ·) − f (πu. j > 1. and mdG(q)∗ solutions deﬁned in the previous section. ·)v. If for m = 1.12) 0 (v.3). we interchange the trial and test ˆ spaces of mcG(q). mcG(q) ∗ .j−1 Φi (t+ ) + i. . 1] with t = 0 and t = 1 as two of its qij + 1 ≥ 2 nodal points. . j = 1. for m. . . Multi-adaptive dual discontinuous Galerkin. n Lemma 3. . Existence of solutions To prove existence of the discrete mcG(q). Multi-adaptive dual continuous Galerkin. d we have 0 p(t)tm dt = 0. d n−1 be a Proof. and τij (t) = (t − ti.1.j−1 ). ˆ With the same deﬁnitions of V and V as in (2. . Then. Integrating by parts. . such that (2.g (v) ≡ (v(T ).11) J(πu. ui (0). v) dt. [q ] q n=0 ξijn λn ij (τij (t)). Φ) + Lψ. . U. U. we have 1 0 ˙ U v dt = 0 1 f v dt ∀v ∈ P q−1 ([0. N . n = 1. . ·)Φ + g. [q ] [vi ]i.16) i=1 j=1 −[Φi ]ij vi (t− ) ij − Iij ˙ Φi vi dt = 0 T Ui (t) = (J (πu. .1) in ﬁxed point form reads: For qij i = 1.1).1. det A = 0 and det B = 0. Φ) dt + Lψ. 1]. Proof. Multi-adaptive Galerkin in ﬁxed point form. we deﬁne the mdG(q)∗ ˆ method for (2. A component Ui (t) of the solution is given on Iij by qij (2. ·)Φ + g. [q ] 3.1) with ξij0 = [q ] q (J (πu. Dropping indices for ease of notation and rescaling to the interval [0. 2. . If for m = 1. . d implies n=1 x = 0. n n n=1 xn m+n = 0 for m = 1. 0 pq dt = 0 but pq ≥ 0 on [0.qi.15) can alternatively be expressed in the form N Mi ij ij where {wn ij }n=1 ⊂ P qij −1 ([0. if the time steps are suﬃciently small. d xn m+n−1 = 0 for m = 1.g (v). which proves that det A = 0. . . we formulate ﬁxed point iterations for the construction of solutions. d. Thus. d. For the discontinuous method. 2. 1]) is the standard Lagrange basis on [0. which is introduced to make the dimension of the test space equal to the dimension of the trial space. where T (2. d implies x = 0. and let n B be a d × d matrix with elements Bmn = m+n . n=1 d m . 1].j−1 )/(tij − ti. ·). ·)(U − πu) = f (U. . let 1 again p(t) = d xn ntn−1 . The proof is thus constructive and gives a method for computing solutions (see [5]). Notice the extra condition that the test functions should vanish at t = 0. To prove that A is nonsingular.13) Lψ. g) dt.14) i=1 j=1 −[Φi ]ij vi (tij ) − Iij ˙ Φi vi dt = 0 T To rewrite the methods in explicit ﬁxed point form.2. which proves that det B = 0. . Mi . Lemma 3. 1] take q(t) = m=1 ym t 1 and pq ≥ 0. mdG(q). wqij ≡ 1. 3. for all v ∈ V with v(0) = 0. we thus ˆ deﬁne the mcG(q)∗ method for (2. . . (2.j−1 i=1 j=1 T ξi. mcG(q) ∗ . . ψ) + 0 (v. Then. . . .5).MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 5 6 ANDERS LOGG rule. we introduce a simple basis for the trial and test spaces and solve for the degrees of freedom on each local interval. [q ] vi Φi dt = ˙ Iij 0 (J(πu. ·)v.j−1 . . we have (2. U. We start by proving the following simple lemma.9) in the following way: Find Φ ∈ V with Φ(T + ) = ψ. such that (3. With the same deﬁnitions of V and V as in (2. The mcG(q) method for (1. 0 p(t)t n it follows that p ≡ 0. t) dt. In the formulation of the dual method of mcG(q).9) in the following way: Find Φ ∈ V with Φ(T + ) = ψ. Thus. U. U. ﬁnd {ξijn }n=1 . . ij where {λn ij }n=0 ⊂ P qij ([0. Let A be a d × d matrix with elements A mn = m+n−1 . . Our starting point is the local formulation (2.4. v) dt. we note that the trial and test spaces are identical. .12) can alternatively be expressed in the form N Mi (2.j−1.15) N Mi ξijn = ξij0 + Iij wn ij (τij (t))fi (U (t). . such that p and q have the same zeros on [0. j = 1. . . To prove that B is nonsingular. Integrating by parts.g (v). we let p(t) = n=1 xn nt 1 m−1 dt = 0. (2. Φ) dt = ˙ 0 (J(πu.5. polynomial of degree d − 1 on [0. Existence then follows from the Banach ﬁxed point theorem. mdG(q) ∗ . 1] and so p ≡ 0. for all v ∈ V with v(0− ) = 0. such that T T (2.

If det 1 ˙ [q] [q−1] 0 λn λm−1 dt = 0. Iij [q ] (3. q.2. 1] with t = 1 as one of its qij + 1 ≥ 1 nodal points. [q ] U (0) = n=0 [q] ξn λ[q] (0) = ξ0 . .1. t) dt. Solving for (ξ1 . . and τij (t) = (t − ti. . . 1] with t = 0 as a nodal point. such that T wn ij (τij (t))fi (U (t). N . .j−1.qi. . we have 1 ξ0 + = det n m+n−1 n=1 ξn 0 1 ntn−1 dt = 0 1 − f dt + ξ0 . .j−1 ). by Lemma 3. Lemma 3. . q ξn n=1 0 ntn−1 tm dt = 0 1 f tm dt. ﬁnd {ξijn }n=0 . The result now follows by rescaling to Iij . In terms of with − ξij0 = [q ] q ξi. . .3). . . 1]). N . . . 1.1 has a solution.9) in ﬁxed point form reads: For qij −1 i = 1. . take v ≡ 1 in (2. q. since 1 for some constants {αn }q . The result now follows by rescaling to I ij . . where {wn }q ⊂ P q−1 ([0. j = 1. The remaining q degrees of freedom are then determined by q 1 Proof. q. we use (2. with U (1) = ξq if also t = 1 is a nodal point. [q ] ξn n=0 0 ˙ λ[q] λ[q−1] dt = n m f λ[q−1] dt. [q] {λn }q be n=0 [q] q n=0 ξn λn (t). . . .7) to obtain q − (ξ0 − ξ0 )λ[q] (0) + m n=0 [q] 1 ξn n=1 0 [q−1] ˙ λ[q] λm−1 dt = n 1 0 f λm−1 − ξ0 [q−1] 1 0 ˙ [q] [q−1] λ0 λm−1 dt. j = Mi . . we have n=0 − ξn = ξ 0 + 1 0 [q] wn f dt. . [q] n = 1. we obtain ξn = α[q] ξ0 + n [q] 1 0 [q] wn f dt. which by Lemma 3. . In particular. . . . 1 Lemma 3. . j = 1. . . ξn ). . To see that w q ≡ 1. q. the value at t = 0 is known from the previous interval (or from the initial condition). This gives q qij Ui (t) = n=0 [q ] q ξijn λn ij (τij (t)). For any other basis {λ n }q n=0 with [q] λn (0) = δ0n . det 0 [q−1] ˙ λ[q] λm−1 dt n = det 0 ntn−1 tm−1 dt = 0. . m = 1. . m = 1. . A component Ui (t) of the solution is given on Iij by Since the solution is continuous. m m = 0. . The mcG(q)∗ method for (2. . t) dt. we conclude that when [q] {λn }q is the Lagrange basis for a partition of [0. .2. q. m m = 0. ξn = ξ 0 + 0 [q] wn f dt. n = 0. By the same argument as in the proof of Lemma 3. . 1 0 a basis for and so P q ([0.4.1) in ﬁxed point form reads: For qij i = 1. ·) dt + Iij wn ij (τij (t))fi∗ (Φ(t). . this system can be solved for the degrees of [q] 1 With λn (t) = tn . . .2) − ξijn = ξij0 + − with U (1) = ξq = ξ0 + 0 f dt if t = 1 is a nodal point. q. . .3. In as similar way as in the proof of Lemma 3. . q − 1. . such that (3. . . q. we have U (t) = q 1 P q ([0. . 1]) and ξ0 is detern=1 n=1 [q] mined from the continuity requirement. . let {λ n }q n=0 be the Lagrange basis functions for a partition of [0. n = 1. For f ≡ 0 it is easy to see that the mcG(q) solution is constant and equal to its initial [q] value. 1]). . ξn ).MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 7 8 ANDERS LOGG with U ∈ Let now this basis. . It follows that αn = 1. n = 1. [q ] .j−1 . . . . [q] n = 0. wqij ≡ 1. 1]) is the standard Lagrange basis on [0. ﬁnd {ξijn }n=0 . ξn 0 ˙ [q] λn λ[q] dt = m 1 0 f λ[q] dt. . . ui (0). j > 1.3) ξijn = ψi + tij fi∗ (Φ. . 1]. we obtain a similar expression for the degrees of freedom by [q] a linear transformation. . . 1]). Mi . . and so 1 det 0 ntn−1 tm dt = det n m+n = 0. We thus obtain − ξn = α[q] ξ0 + n 1 0 [q] wn f dt. The mdG(q) method for (1. .j−1 )/(tij − ti. . ij ij where {wn ij }n=0 ⊂ P qij ([0. With λn (t) = tn . q. these 1 + q equations can be written in the form q 1 freedom (ξ1 . n ij where {λn ij }n=0 ⊂ P qij ([0. if we assume that λn (0) = δ0n .

5. . 1]) is the standard Lagrange basis on [0. PSfrag replacements vi (t) Summing up. . q. . Lemma 3.j−1 ] with vi ≡ 1 on [tij . j < Mi . noting that vi (ti. . . With 1 = tn−1 . we can solve for (ξ1 . A component Φi (t) of the solution is given on Iij . Solving for the degrees of freedom. wn ij (τij (t))fi∗ (Φ(t). 0 [q−1] λn−1 (t)mtm−1 mtn−1 tm−1 dt = det m m+n−1 = 0. fi∗ (Φ. 0 ti. take vn ≡ 0 when n = i and let vi be a continuous piecewise polynomial that vanishes on [0. 1]. q.1. ·) dt. If now det [q−1] λn−1 (t) 1 dt = 0.j−1 ti. .0 . n = 1. we then have Mi −[Φi ]il vi (til ) − l=j Iil ˙ Φi vi dt = T ti. Thus.j−1 ) = 0.4) [q−1] q−1 {λ n }n=0 + ξijn = ξijqij + Iij ˜ with Φij = ψi + [0. . vi = 0 on [tij . 1. ξq ) to (ξ0 . ξn ). We also relabel the degrees of freedom from (ξ 1 . q. ⊂ = 0. n = 1. ξq−1 ). . n = 1. N . . ti. Figure 2. . t) dt.l−1 = Φi (t+ )vi (ti. A component Φi (t) of the solution is given on Iij by qij −1 f ∗ (Φ. q. q.9) in ﬁxed point form reads: For qij i = 1. . . . Proof. ·) [q ] qij −1 {wn ij }n=0 P qij ([0. . to get −[Φi ]il vi (til ) − Iil t ˙ Φi vi dt = −[Φi ]il vi (til ) − [Φi vi ]til + − + Iil Φi vi dt ˙ Φi vi dt. ·)vi dt. . .l−1 ) − Φi (t+ )vi (til ) + i. n = 1. it follows that α n = 1. when {λ n }q−1 is the n=0 [q] standard Lagrange basis for a partition of [0. . . ·)Φ + g. and τij (t) = (t − ti. [q] We integrate by parts. [q ] q [q ] for all v ∈ with v(0) = 0 and v(1) = 1. 1]. ﬁnd {ξijn }n=0 . The result now follows by rescaling to I ij . .j−1 By a linear transformation. ·) = J (πu.4. ·)Φ + g. since wn (1) = m=1 [q] αn = 1. . since each wn is a linear combination [q] [q] of the functions {tm }q . q. where {λn ij [q −1] qij −1 }n=0 ⊂ P qij −1 ([0.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 9 [q ] wn ij (0) 10 ANDERS LOGG 1 0 [q−1] λn−1 (t)mtm−1 where = J (πu. and so ˜ ξn = Φ(1) + 0 [q] 1 [q] wn f ∗ dt. .j−1 ). ·) = J (πu. . . n=1 we then have q 1 P q ([0.j−1 ). n = 1. Dropping indices and rescaling to the interval 1 0 ˜ Φv dt = Φ(1) + ˙ 0 1 f ∗ v dt. . Our starting point is the deﬁnition (2. we obtain [q] ˜ ξn = αn Φ(1) + 1 0 [q] wn f ∗ dt.j+1.4.j−1 )/(tij − ti. . 1]. it is easy to see that the mcG(q)∗ solution [q−1] is constant and equal to its initial value. For any 1 ≤ i ≤ N . ·)vi dt. . and τij (t) = (t − ti. ·)Φ + g. U. {wn ij }n=0 ⊂ P qij ([0. 1]). ψi . . . . The mdG(q)∗ method for (2. U. T ] and Φi (t+ i ) = ψi . 1]) with + ξijqij = ξn n=1 0 ˜ λn−1 (t) mtm−1 dt = Φ(1) + [q−1] 1 0 f ∗ tm dt. [q ] wn ij (1) = 1. . we obtain a similar expression for any other basis of P q ([0. We also conclude that wn (1) = 1. we have dt = det 0 det [q −1] ξijn λn ij (τij (t)).j−1 )/(tij − ti. T ]. j = Mi . . ˙ Iil i. 1]).j T or ˜ Φi vi dt = Φij + ˙ Iij Iij fi∗ (Φ. . . Φi (t) = n=0 by Lemma 3. ˙ M we have T −ψi + Iij Φi vi dt = ˙ ti. . ij where f ∗ (Φ. . we obtain T tij fi∗ (Φ. With f ∗ (Φ. ·)vi dt. see Figure 3. n = 0. For f ∗ ≡ 0. . For m = 1. 1]) and write Φ(t) = q ξn λn−1 (t). .l−1 il We note that wn (0) = 0. . ξi. . U. . . such that (3. moving the derivative onto the test function.14). . . . Let now be a [q−1] basis of P q−1 ([0.j−1 fi∗ (Φ. qij − 1. . The special choice of test function used in the proof of Lemma 3. . . 1]). . j = Mi .

1. y ∈ RN . w represents either u or φ(T − ·) and. .j−1 gijn (x) − gijn (y) = Tn−1 (fi (U. ·)) dt. depending only on the order and method. .2). t ∈ (0. the result follows Tn−1 − ˜ fi (U. ·) − fi (V. The mdG(q)∗ method is identical to the mdG(q) method with time reversed. correspondingly. proving existence of the discrete solutions. where A = A(t) is a piecewise smooth N × N matrix on (0. ˙ With w(t) = φ(T − t). by Corollary 3. (2. the result follows if we take [q] − ˜ − U (Tn−1 ) = U (Tn−1 ) and note that wq ≡ 1. ·) dt.1) for φ = φ(t) is then given by (4. converge to the unique solution of (2. then each of the ﬁxed point iterations. 1].1 converge. Proof. [q ] |ξijn − ηijn ||λn ij (t)| ≤ C x − y [q ] ∞. mcG(q)∗ .j−1 + Iij wn ij (τij (t))(fi (U. Stability estimates In this section. and mdG(q)∗ . ti. By Banach’s ﬁxed point theorem. Let x = (. . fi (U. Corollary 3. As before. . we prove stability estimates for the multi-adaptive methods and the corresponding multi-adaptive dual methods. we thus obtain g(x) − g(y) l∞ ≤ CC Lf K x − y l∞ . We now prove that for each of the four methods. mcG(q)∗ . ·) dt + Tn−1 Iij wn ij (τij (t))fi (U. Then.2. mdG(q). T ]. if we deﬁne U (Tn−1 ) = ui (0) + 0 3. Let V (t) be another trial space function on the time slab with degrees of freedom y = (. (2. For mcG(q). . ·) − fi (V. ·) dt. Theorem 3. T ). mdG(q). Proof. W represents either the discrete mc/dG(q) approximation U of u or the discrete mc/dG(q) ∗ approximation Φ of φ. . and (2.6).).j−1 ) and {wn ij } is a set of polynomial weight functions on [0. For mcG(q)∗ . τij (t) = (t − ti.15). and mdG(q)∗ methods can all be expressed in the form: For all Iij ∈ Tn . t ∈ (0. and ˙ so (4.6) If now (3.j−1 [q ] for t ∈ Iij .4). In the following discussion. 1]) is the standard Lagrange basis on [0. . [q ] where w0 = ψ and B(t) = A (T − t). . T ]. T ]. t) − f (y. With time reversed for the dual methods (to simplify the notation). Then. ·) dt.1. T ] ∀x. mdG(q). ≤ CLf K Noting now that |Ui (t) − Vi (t)| ≤ n U (t) − V (t) fi (U.2) ˙ −φ(t) + A (t)φ(t) = 0. ˜ − with a suitable deﬁnition of Ui (Tn−1 ). the ﬁxed point iterations of Corollary 3. respectively.12). ˙ u(0) = u0 . and mdG(q) ∗ . (3. ·)) dt ⊂ P qij ([0. The dual backward problem of (4. the mcG(q). ·) dt + Tn−1 Iij wn ij (τij (t))fi (U. We consider the linear model problem (4.3). mcG(q).) be the set of values for the degrees of freedom of U (t) on the time slab Tn of length Kn = Tn − Tn−1 ≤ K. (3. such that (3. . . . . ˙ w(0) = w0 . [q ] and so Tn g(x) − g(y) l∞ ≤ CLf Tn−1 U (t) − V (t) sup (Tn−1 . we can write the ﬁxed point iteration on the time slab in the form ˜ − ξijn = gijn (x) = Ui (Tn−1 ) + ti.1).MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 11 12 ANDERS LOGG by qij Φi (t) = n=0 [q ] qij {λn ij }n=0 [q ] ξijn λn ij (τij (t)). t) l∞ ≤ Lf x − y l∞ ∀t ∈ [0. and (3. 4.2). ηijn .Tn ] l∞ dt l∞ .7) KCq Lf < 1. Let Tn be a time slab with synchronized time levels T n−1 and Tn . ξijn . Proof. where Cq is a constant of moderate size. we have w(t) = −φ(T − t) = −A (T − t)w(t). ﬁnd {ξijn }. φ(T ) = ψ. (3. Fixed point iteration. . f (x. we conclude that the ﬁxed point iteration converges to a unique ﬁxed point if CC Lf K < 1.3) w(t) + B(t)w(t) = 0.5) ˜ − ξijn = Ui (Tn−1 ) + ti.j−1 )/(tij − ti.1.2) can be written as a forward problem for w in the form (4. t ∈ [0.1) u(t) + A(t)u(t) = 0. 1] with where t = 0 as one of its qij + 1 ≥ 1 nodal points. (Existence of solutions) Let K = max K n be the maximum time slab length and deﬁne the Lipschitz constant L f > 0 by (3.

3).8) (4. where “strong” indicates control of Aw (or w) in terms ˙ of (the l2 -norm of) the initial data w0 . n lp this means that L∞ ([Tm−1 . Theorem 4. and so the result K n Cq B L∞ ([Tn−1 .lp ) ≤ 1 for all m. On each local interval. we have the following standard strong stability estimates.Tn ].9) 0 T ξijn = wi (0) + 0 fi (W. with A a symmetric. ¯ By assumption. and so z(n) ≤ m=1 2C + n−1 2a(m)z(m). . Exponential stability estimates. mdG(q). and constant N × N matrix. (A discrete Gr¨nwall inequality) Assume that z. and z(n) ≤ C + n a(m)z(m) m=1 for all n. respectively. The stability estimates are based on the following version of the discrete Gr¨nwall inequality. 2 and so ti. is deﬁned by the following conditions: (πϕi )|Iij ∈ P qij (Iij ) interpolates ϕi at the left end-point t+ i. M. By Corollary 3. a : N → R o are non-negative. depending only on the highest order max q ij . and note that B = A = A .j−1 For the continuous problem (4. o Lemma 4. t ∈ (0. L∞ ([Tm−1 . for n = 1. if z(n) ≤ C + m=0 a(m)z(m) for n ≥ 1 and z(0) ≤ C. since 1 − a(n) ≥ 1/2. we have n−1 and so W (t) C w0 lp is bounded by Tn n Tm +C 0 BW lp dt = C w0 lp +C m=1 Tm−1 BW lp dt. . we have |Wi (t)| ≤ C|wi (0)|+C 0 n |(BW )i | dt. In the proof.7) satisﬁes for T > 0 and 0 < < T with · = · l2 .j−1 |ξijn | ≤ |wi (0)| + 0 tij (BW )i dt + Iij wn ij (τij (t))(BW )i dt Tn [q ] Proof. Tn ].j−1 of Iij ≤ |wi (0)| + C 0 |(BW )i | dt ≤ |wi (0)| + C 0 |(BW )i | dt. (1 − a(n))z(n) ≤ C + n−1 a(m)z(m).Tm ]. positive ˙ semideﬁnite. As before. M . it follows that z(n) ≤ o n−1 n−1 C exp m=0 a(m) .7).j−1 t Aw Aw dt ≤ dt ≤ 1 w0 2 . for n = 1. mdG(q). we use a special interpolant π. ·) dt. we write the problem in the form (4.lp ) Wm . 2. Then. .Tm ]. [q ] (4. See also Lemma 1 in [3] for a similar estimate. Here. the component (πϕ) i of the interpolant πϕ of a given function ϕ : [0.1. v = tAw. See [2] for a full proof.5) then (4.Tn ]. ˙ w(0) = w0 .MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 13 14 ANDERS LOGG lp 4. a(m) ≤ 1/2 for all m.2.Tm ]. (4. . such that (4.3).4) z(n) ≤ 2C exp m=1 2a(m) .lp ) ≤ Cq w0 lp exp m=1 Km Cq B L∞ ([Tm−1 . [q ] w(T ) 2 T T +2 0 (Aw. . Km Cq B follows by Lemma 4. . T ] → RN . It now folT lows that for all t ∈ [Tn−1 .6) n−1 ≡ (Cq /2) w0 lp + m=1 Km (Cq /2) B L∞ ([Tm−1 .1. n = 1.1 in [1].Tm ]. deﬁned on the partition T as follows. . and mdG(q)∗ methods in the form ti.3). . Proof. Then. we have ti. see [8]. 4 ξijn = wi (0) − 0 (BW )i dt − Iij wn ij (τij (t))(BW )i dt. Multiply (4. . T ]. By a standard discrete Gr¨nwall inequality. The result now follows if we m=1 take a(0) = z(0) = 0. We thus consider the problem: Find w : [0. there is a constant C q of moderate size. mcG(q) ∗ . (Strong stability for the continuous problem) The solution w of (4.. such that if (4. ¯ Wn ≤ C w 0 +C m=1 Km B n ¯ Proof. W L∞ ([Tn−1 . (Stability estimate) Let W be the mcG(q).1.lp ) Wm (4. and prove stability estimates for the mdG(q) and mdG(q)∗ methods.Tn ]. . We now prove an extension to multi-adaptive time-stepping of the strong stability estimate Lemma 6.lp ) .7) with v = w.10) 1 (log(T / ))1/2 w0 .lp ) ≤ 1. mcG(q) ∗ .2. 1 ≤ p ≤ ∞.1. ¯ With Wn = W L∞ ([Tn−1 . and v = t 2 A2 w. Theorem 4.1. we can write the mcG(q). . 2 Applied to the linear model problem (4. We consider now the parabolic model problem u(t) + Au(t) = 0. Stability estimates for parabolic problems. ·) dt + Iij wn ij (τij (t))fi (W. 4. T ] → RN . where Tn is smallest synchronized time level for which t ij ≤ Tn . w) dt = w0 2 .7) w(t) + Aw(t) = 0.lp ) . . or mdG(q)∗ solution of (4.

12) (4. . n = 2.1 in [1]. . . .j−1 + ij 1 − W (Tn ) 2 2 − 1 − W (Tn−1 ) 2 2 Tn + Tn−1 (AW. as illustrated in Figure 3. π(tAW )) dt = 0. since A mixes the components of W and as a result. such that (4. M. (Strong stability for the discrete problem) Let W be the mdG(q) or mdG(q)∗ solution of (4.j−1 | ij where · = · l2 .j−1 (t(AW )i )(t+ ) + i.11) Tn−1 Tn−1 (Av. With V the trial (and test) space for the mdG(q) method deﬁned in Section 2.j−1 ˙ ¯ Wi t(AW )i dt Iij (4. In the case of equal time steps for all components. for all functions v in the trial (and test) space V of the mdG(q) and mdG(q) ∗ methods. Noting that [Wi ]m = Wi (t+ ) − Wi (t− ) = 0 if component i has m m no node at time t = tm . Theorem 4. for some constant σ > 1.. .3. + Tn−1 ¯ (AW. With {tm } the ordered sequence of individual time levels {t ij }. AW (t− )) − (W (t− ).15) ij 2 1/2 ≤ C log T +1 K1 1/2 w0 . Instead. computed with the same time step and order for all components on the ﬁrst time slab T 1 . but this is not a valid test function. AW ) dt dt + Tn−1 (AW. the test function is chosen as v = Tn AW . π(tAv)) dt. see [7]. we + tm (W (t− ). i. To prove the basic stability estimate (4. W ) dt = 0. γ. . Note that we may computationally test the validity of (4. We make the following assumption on the partition T : Tn Tn P qij −1 (I take v = W in (4. Av) dt ≤ γ Tn−1 ¯ (Av.14) T 0 N ˙ W + AW dt + n=1 |[Wi ]i.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 15 16 ANDERS LOGG and πϕi − ϕi is orthogonal to ij ). we take v = π(tAW ). A[W ]m−1 ) 2 [Wi ]i. . Proof. For the proof of (4.15) to get 1 2 [Wi ]2 i.11) holds and that σKn ≤ Tn−1 . in the form [Wi ]m−1 tm (AW (t+ ))i + m−1 i m ˙ Wi tm (AW )i dt Im = m tm ([W ]m−1 . = m for all test functions v ∈ V .j−1 vi (t+ ) + i. such that (4. v) dt = 0. where γ ≥ 1 is a constant of moderate size if Av is not close to being orthogonal to V .13). because then πAv = Av since Av ∈ V if v ∈ V . The sequence {tm } of individual time levels. to obtain ¯ [Wi ]i.11). Figure 3. The estimate now follows by summation over all time slabs T n .j−1 ˙ Wi vi dt Iij Tn tm 2 Im d (W. there is a constant C = C(q. Then. In the proof of Lemma 6. PSfrag replacements T0 = 0T1 Tn−1 Tn TM = T (4. Tn ].. AW (t+ )) + m−1 tm ([W ]m−1 . W ) dt + i=1 j=1 Tn n=1 Tn−1 ˙ W 2 + AW 2 dt + n=1 Tn ij [Wi ]2 /kij ≤ C w0 2 . M . which is not possible in the multi-adaptive case. ij denotes the sum over all elements within the current time slab Tn . AW (t− )) . and where in all integrals the domain of integration does not include points where the integrand is discontinuous. .j−1 ij Tn W (T ) 2 T N Mi 2 [Wi ]2 i. ˙ where we have used the orthogonality condition of the interpolant for Wi ∈ P qij −1 (Iij ). we would like to take v = tAW in (4.13) M Tn M t0 t1 t2 . the mdG(q) (or mdG(q)∗ ) approximation W of w on a time slab Tn is deﬁned as follows: Find W ∈ V . tm ]. ¯ ¯ t = t(t) is thus the piecewise constant function that takes the value t m on (tm−1 . Assume that (4. σ). n = 2. +2 0 (AW. We follow the proof presented in [1] and make extensions where necessary. v i = Tn (AW )i ¯ may not be a test function for component W i .) We also introduce the left-continuous piecewise constant ¯ ¯ ¯ function t = t(t) deﬁned by t(t) = minij {tij : t ≤ tij }. where the sum is taken over all intervals I ij within the time slab Tn .12).15).7). m m m−1 m−1 2 . (This is the interpolant denoted [q] by πdG∗ in [6]. we rewrite the sum as a sum over all intervals (tm−1 . ¯ with π and t deﬁned as above.j−1 = w0 . tm ] within (Tn−1 . this estimate is trivially true.

π(tAW )) dt = m km (W (t− ). AW (Tn−1 )) m Tn for any β > 0. we thus have (4. A[W ]0 ) + 2K1 (w0 . The terms on the right-hand side of (4. it now suﬃces to prove that Tn For n > 1. 2γ −1 σ Tn σ+1 Tn AW Tn−1 2 dt ≤ Cq σ σ−1 Tn (W.j−1 Tn AW Tn−1 2 dt. AW (T − )) ≥ 0. AW (Tn−1 )) = 2 2 km (W (t− ). For the proof of (4. n=1 Tn Tn−1 AW 2 dt ≤ C w0 2 . + C q T1 0 AW dt. (4. and so − − − − Tn (W (Tn ). AW ) dt. T1 ]. using the notation km = tm − tm−1 . noting that T (W (T − ). We further estimate the right-hand side of (4. AW (t+ )) + ([W ]m−1 . we obtain the following bound for km (W (t− ). we note that tm (W (t− ).16) as follows: K1 (w0 .13). .17) for n = 1. we have Tn Tn−1 ¯ (AW. AW (t− )) = km (W (t+ ) − [W ]m−1 . AW (t+ )) + (1 + β −1 )([W ]m−1 .12). A[W ]0 ) + 1 w0 2 T1 + + + Summing over n > 1 and using the estimate (4. m−1 m−1 tm tm−1 (W (t− ). AW 0 2 ≤ Cq w0 2 . AW (Tn−1 )) +2 Tn−1 ¯ (AW. − m−1 m−1 2 m − Collecting the terms. π(tAW )) dt = T1 0 T1 T1 + AW 2 (AW. AW (t− )): m−1 m−1 σkm (W (t+ ). A[W ]m−1 ) m−1 m−1 m−1 ≤ km (1 + β)(W (t+ ). AW (T1 )) + T1 T1 = 1/Cq . AW (Tn )) − Tn−1 (W (Tn−1 ). ≤ σ − 1 Im where we have again used an inverse estimate. for W on I m . Tn−1 since π(AW ) = AW on [0. A[W ]m−1 ). m−1 m−1 For n = 1.16) − − − − tm ([W ]m−1 .11). T 1 ]. AW (t− )). T (W (T − ). A(W (t+ ) − [W ]m−1 )) m−1 m−1 m−1 m−1 = km (W (t+ ). AW (t− )) m m m−1 m−1 2 m = m where we have also used the assumption T n−1 ≥ σKn .17) − − T1 (W (T1 ). π(AW )) dt = T1 0 dt. where the same time steps and orders are used for all components. AW (t− )) m m m−1 m−1 2 2 km (W (t− ). With we thus obtain the estimate (4. AW (t− )) − (W (t− ). it follows by the assumption (4. AW (Tn )) − (W (Tn−1 ). AW (t− )) − (W (t− ). AW ) dt ≤ Cq 1 + T1 w0 2 . A[W ]m−1 ) . AW (t− )) m−1 m−1 2 Tn−1 Tn − − − − (W (Tn ).19) ij [Wi ]2 /kij ≤ C i. Choosing β = 1/(σ − 1).16) are now estimated as follows: km (W (t− ). π(tAW )) dt ≥ γ −1 Tn Tn−1 Tn−1 Tn AW 2 (4. From the assumption that σKn ≤ Tn−1 for n > 1. AW (t− )). which we write as M Tn where we have used an inverse estimate for AW on [0. A[W ]0 ) + w0 2 + K1 AW (0+ ) ≤ T1 ([W ]0 . AW (0+ )) 1 2 ≤ T1 ([W ]0 . AW ) dt + σkm ([W ]m−1 . A[W ]0 ) − K1 (W (0 ). that Tn Tn−1 ¯ (AW.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 17 18 ANDERS LOGG where. AW (T − )) + T1 0 T1 AW Cq σ σ−1 T 2 dt + 2γ −1 σ σ+1 M Tn Tn n=2 Tn−1 AW σ/2 σ−1 2 dt 2 ≤ Cq w0 2 2 + (W. AW (Tn )) − Tn−1 (W (Tn−1 ). A[W ]m−1 ) + Tn (W (Tn ). AW (0 )) ≤ T1 ([W ]0 . AW (0 )) + 2K1 (w0 . A[W ]m−1 ) m−1 m−1 σ−1 Cq σ (W. and thus Tn Tn−1 ¯ (AW. π(tAW )) dt ≥ γ −1 σ σ+1 Tn Tn−1 AW 2 dt.18) dt and Tn−1 ˙ W dt ≤ C Tn AW Tn−1 2 dt. we obtain by (4. A[W ]m−1 ) − 2(W (t+ ). Aw0 ) = K1 ([W ]0 . AW (t+ )) + σkm ([W ]m−1 . it follows that σkm ≤ σKn ≤ Tn−1 ≤ tm .

with a similar estimate for AW .j−1 /kij on each local interval Iij in (4.j−1 (AW )2 dt i kij t − ti.j−1 ˙ 2 Wi dt = − kij t − ti.18).14).15).j−1 ˙ 2 Wi dt kij ≤ n=1 Kn /Tn Tn n=1 ij ≤ Cq ij Iij t − ti.j−1 ij ij ˙ (Wi + (AW )i ) [Wi ]i.j−1 ˙ 2 Wi dt kij 1/2 ≤ .13). we take vi = (t − ti. where we have again used Cauchy’s inequality twice.j−1 )Wi /kij on each local interval Iij in (4. using (4.j−1 |2 /kij Tn n=1 ij n=1 M ij M 1/2 where we have used Cauchy’s inequality twice. to prove (4.18).j−1 /kij dt Iij ≤ ij Iij ˙ (Wi + (AW )i )2 dt 1/2 ij [Wi ]2 /kij i. ﬁrst on L 2 (Iij ) and then on ˙ l2 .j−1 ˙ 2 Wi dt kij 1/2 ≤ n=1 Kn /Tn n=1 T Tn Tn−1 1/2 ˙ W 2 dt ≤ ij Iij t − ti. To prove (4.j−1 |2 ≤ |[Wi ]i. |[Wi ]i.13) to get M Tn M ˙ W dt = n=1 M Tn Kn /Tn Tn /Kn Tn−1 1/2 M ˙ W dt Tn 1/2 n=1 Tn−1 ij Iij ij ≤ ij Iij t − ti.19). The proof is now complete.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 19 20 ANDERS LOGG ˙ To prove (4. This also proves (4. which gives [Wi ]2 /kij = − i. 1+ T1 1 dt t C w0 ≤ C (log(T /K1 ) + 1)1/2 w0 .j−1 1/2 .19) follows. we take vi = [Wi ]i. We thus have [Wi ]2 /kij ≤ 2 i. noting that 1/2 1/2 M M Kn Tn |[Wi ]i. we obtain Tn Tn−1 ˙ W 2 dt = ij Iij ˙ Wi2 dt ≤ Cq ij Iij t − ti. . Using an inverse estimate for Wi2 . and so (4.j−1 ˙ Wi dt (AW )i kij Iij 1/2 Iij Finally.j−1 ij Tn Tn−1 ˙ W 2 Tn dt + 2 Tn−1 AW 2 dt. which gives t − ti.j−1 | /kij 2 1/2 ≤ Cq ij Iij Tn−1 which proves (4.15). we use Cauchy’s inequality with (4. AW dt.j−1 (AW )2 dt i kij 1/2 ij Iij t − ti.j−1 (AW )2 dt i kij (AW )2 dt = Cq i Tn ≤ C(log(T /K1 ) + 1)1/2 w0 .18).

[6] Rep. 1879–1902. [3] C. Electronic Journal of Diﬀerential Equations. and A. No... 11 (2000).MULTI-ADAPTIVE GALERKIN METHODS FOR ODES III 21 References [1] K. 25 (1988). (2004). 25 (2003). Comput. pp. C. pp. [7] . Comput. Submitted to SIAM J. 28.. Adaptive computational methods for parabolic problems.. To appear in Encyclopedia of Computational Mechanics. Johnson. Sci. SIAM J. [2] K. . Multi-adaptive Galerkin methods for ODEs IV: A priori error estimates. [4] A. 2004. pp. Multi-adaptive Galerkin methods for ODEs II: Implementation and applications. Niamsup and V. Numer. 2004–02. Eriksson and C. Anal. Logg. Adaptive ﬁnite element methods for parabolic problems I: A linear model problem. pp. Multi-adaptive Galerkin methods for ODEs I. 24 (2003). Tech. Phat. N. SIAM J. SIAM J. . Numer. pp. Johnson. Sci. [8] P. Eriksson. Chalmers Finite Element Center Preprint Series. Johnson. Interpolation estimates for piecewise smooth functions in one dimension. Logg. (2004). SIAM J. Numer. 1–17. Error estimates and adaptive time-step control for a class of one-step methods for stiﬀ ordinary diﬀerential equations. 1 (1991). Anal. 1119–1141.. 908–926. 43–77. [5] . Asymptotic stability of nonlinear control systems described by diﬀerence equations with multiple delays. Anal.

2

ANDERS LOGG

1.1. Main results. The main results of this paper are a priori error estimates for the mcG(q) and mdG(q) methods respectively, of the form MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV: A PRIORI ERROR ESTIMATES

ANDERS LOGG

(1.2) and (1.3)

e(T ) e(T )

lp

≤ CS(T ) k 2q u(2q)

L∞ ([0,T ],l1 ) ,

lp

≤ CS(T ) k 2q+1 u(2q+1)

L∞ ([0,T ],l1 ) ,

Abstract. We prove general order a priori error estimates for the multi-adaptive continuous and discontinuous Galerkin methods mcG(q) and mdG(q). To prove the error estimates, we represent the error in terms of the residual of an interpolant of the exact solution, and a discrete dual solution. The estimates then follow from interpolation estimates, together with stability estimates for the discrete dual solution. For the general non-linear problem, we obtain exponential stability estimates, using a Gr¨nwall argument, and for a parabolic model problem, o we show that the stability factor is of unit size.

for p = 2 or p = ∞, where C is an interpolation constant, S(T ) is a (computable) stability factor, and k 2q u(2q) (or k 2q+1 u(2q+1) ) combines local time steps k = (kij ) with derivatives of the exact solution u. These estimates state that the mcG(q) method is of order 2q and that the mdG(q) method is of order 2q + 1 in the local time step. We refer to Section 5 for the exact results. For the general non-linear problem, we obtain exponential estimates for the stability factor S(T ), and for a parabolic model problem we show that the stability factor remains bounded and of unit size, independent of T (up to a logarithmic factor). 1.2. Notation. For a detailed description of the multi-adaptive Galerkin methods, we refer the reader to [4, 5, 8]. In particular, we refer to [4] or [8] for the deﬁnition of the methods. The following notation is used throughout this paper: Each component Ui (t), i = 1, . . . , N , of the approximate m(c/d)G(q) solution U (t) of (1.1) is a piecewise polynomial on a partition of (0, T ] into M i subintervals. Subinterval j for component i is denoted by I ij = (ti,j−1 , tij ], and the length of the subinterval is given by the local time step k ij = tij − ti,j−1 . This is illustrated in Figure 1. On each subinterval I ij , Ui |Iij is a polynomial of degree qij and we refer to (Iij , Ui |Iij ) as an element. Furthermore, we shall assume that the interval (0, T ] is partitioned into blocks between certain synchronized time levels 0 = T 0 < T1 < . . . < TM = T . We refer to the set of intervals Tn between two synchronized time levels Tn−1 and Tn as a time slab: Tn = {Iij : Tn−1 ≤ ti,j−1 < tij ≤ Tn }. We denote the length of a time slab by K n = Tn − Tn−1 . 1.3. Outline of the paper. The outline of the paper is as follows. In Section 2, we ﬁrst discuss the dual problem that forms the basic tool of the a priori error analysis, and how this diﬀers from the dual problem we formulate in [4] for the a posteriori error analysis. We then, in Section 3, derive a representation of the error in terms of the dual solution and the residual of an interpolant of the exact solution. In Section 4, we present interpolation results for piecewise smooth functions proved in [7, 6]. We then prove the a priori error estimates in Section 5, starting from the error representation and using the interpolation estimates together with the stability estimates from [8]. Finally, in Section 6, we present some numerical evidence for the a priori error estimates. In

1. Introduction This is part IV in a sequence of papers [4, 5, 8] on multi-adaptive Galerkin methods, mcG(q) and mdG(q), for approximate (numerical) solution of ODEs of the form (1.1) u(t) = f (u(t), t), ˙ u(0) = u0 , t ∈ (0, T ],

where u : [0, T ] → RN is the solution to be computed, u0 ∈ RN a given initial condition, T > 0 a given ﬁnal time, and f : R N × (0, T ] → RN a given function that is Lipschitz-continuous in u and bounded. The mcG(q) and mdG(q) methods are based on piecewise polynomial approximation of degree q on partitions in time with time steps which may vary for diﬀerent components Ui (t) of the approximate solution U (t) of (1.1). In part I and II of our series on multi-adaptive Galerkin methods, we prove a posteriori error estimates, through which the time steps are adaptively determined from residual feed-back and stability information, obtained by solving a dual linearized problem. In part III, we prove existence and stability of discrete solutions. In the current paper, we prove a priori error estimates for the mcG(q) and mdG(q) methods.

Date: March 15, 2004. Key words and phrases. Multi-adaptivity, individual time steps, local time steps, ODE, continuous Galerkin, discontinuous Galerkin, mcgq, mdgq, a priori error estimates. Anders Logg, Department of Computational Mathematics, Chalmers University of Technology, SE–412 96 G¨teborg, Sweden, email : logg@math.chalmers.se. o

1

MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV

3

4

ANDERS LOGG

Iij PSfrag replacements

where we note that J is now evaluated at a mean value of πu and U . We will use the notation f ∗ (φ, ·) = J (πu, U, ·)φ + g, to write the dual problem (2.3) in the form (2.4) ˙ −φ(t) = f ∗ (φ(t), t), φ(T ) = ψ. t ∈ [0, T ),

i

t 0 kij ti,j−1 tij Tn−1 Kn Tn T

We refer to [8] for the exact deﬁnition of the discrete dual solution Φ. We will also derive a priori error estimates for linear problems of the form (2.5) u(t) + A(t)u(t) = 0, ˙ u(0) = u0 , t ∈ (0, T ],

Figure 1. Individual partitions of the interval (0, T ] for different components. Elements between common synchronized time levels are organized in time slabs. In this example, we have N = 6 and M = 4. particular, we solve a simple model problem and show that we obtain the predicted convergence rates. 2. The dual problem In [4], we prove a posteriori error estimates for the multi-adaptive methods, by deriving a representation for the error e = U − u, where U : [0, T ] → N is the computed approximate solution of (1.1), in terms of the residual R ˙ R(U, ·) = U − f (U, ·) and the solution φ : [0, T ] → R N of the continuous linearized dual problem (2.1) ˙ −φ(t) = J (u, U, t)φ(t) + g(t), φ(T ) = ψ, t ∈ [0, T ),

with A(t) a bounded N × N -matrix, in particular for a parabolic model problem with A(t) a positive semideﬁnite and symmetric matrix . For the linear problem (2.5), the discrete dual solution Φ is deﬁned as a Galerkin solution of the continuous dual problem (2.6) ˙ −φ(t) + A (t)φ(t) = g, φ(T ) = ψ, t ∈ [0, T ),

which takes the form (2.4) with the notation f ∗ (φ, ·) = −A φ + g. 3. Error representation In this section, we derive the error representations on which the a priori error estimates are based. For each of the two methods, mcG(q) and mdG(q), we represent the error in terms of the discrete dual solution Φ and an interpolant πu of the exact solution u of (1.1), using the special inter[q] [q] polants πu = πcG u or πu = πdG u deﬁned in Section 5 of [7]. The error representations are presented in the general non-linear case, and thus apply to the linear problem (2.5), with corresponding dual problem (2.6), in particular. We write the error e = U − u as (3.1) e = e + (πu − u), ¯

**with given data g : [0, T ] → RN and ψ ∈ RN , where
**

1

(2.2)

J (u, U, t) =

0

∂f (su(t) + (1 − s)U (t), t) ds ∂u

.

To prove a priori error estimates, we derive an error representation in terms of the residual R(πu, ·) of an interpolant πu of the exact solution u, and a discrete dual solution Φ, following the same approach as in [3] and [1]. The discrete dual solution Φ is deﬁned as a Galerkin solution of the continuous linearized dual problem (2.3) ˙ −φ(t) = J (πu, U, t)φ(t) + g(t), φ(T ) = ψ, t ∈ [0, T ),

where e ≡ U − πu is represented in terms of the discrete dual solution and ¯ the residual of the interpolant. An estimate for the second part of the error, πu − u, follows directly from an interpolation estimate. In Theorem 3.1 below, we derive the error representation for the mcG(q) method, and then derive the corresponding representation for the mdG(q) method in Theorem 3.2. Theorem 3.1. (Error representation for mcG(q)) Let U be the mcG(q) solution of (1.1), let Φ be the corresponding mcG(q) ∗ solution of the dual problem (2.4), and let πu be any trial space approximation of the exact solution u of (1.1) that interpolates u at the end-points of every local interval.

MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV

5

6

ANDERS LOGG

Then,

T T

**since Φ is a test function for U . e e Lψ,g (¯) ≡ (¯(T ), ψ) +
**

0

(¯, g) dt = − e

0

(R(πu, ·), Φ) dt,

With a special choice of interpolant, πu = π cG u and πu = πdG u respectively, we obtain the following versions of the error representations. Corollary 3.1. (Error representation for mcG(q)) Let U be the mcG(q) solution of (1.1), let Φ be the corresponding mcG(q) ∗ solution of the dual [q] problem (2.4), and let πcG u be an interpolant, as deﬁned in [7], of the exact solution u of (1.1). Then,

T

[q]

[q]

where e ≡ U − πu. ¯ Proof. Since e(0) = 0, we can choose e as a test function for the discrete ¯ ¯ dual. By the deﬁnition of the mcG(q) ∗ solution Φ (see [8]), we thus have

T T

˙ (e, Φ) dt = ¯

0 T 0

(J(πu, U, ·)¯, Φ) dt + Lψ,g (¯), e e

T

**and so, by the deﬁnition of J, we have e Lψ,g (¯) =
**

0 T

e Lψ,g (¯) =

0

(f (πcG u, ·) − f (u, ·), Φ) dt.

[q]

˙ (e − J(πu, U, ·)¯, Φ) dt = ¯ e

0

˙ (e − f (U, ·) + f (πu, ·), Φ) dt ¯

T

**Proof. The residual of the exact solution is zero and so, by Theorem 3.1, we have
**

T

=

0

(R(U, ·) − R(πu, ·), Φ) dt = −

0

(R(πu, ·), Φ) dt,

Lψ,g (¯) = e

0 T

(R(u, ·) − R(πcG u, ·), Φ) dt (f (πcG u, ·) − f (u, ·), Φ) dt +

T [q] T

[q]

since Φ is a test function for U . Theorem 3.2. (Error representation for mdG(q)) Let U be the mdG(q) solution of (1.1), let Φ be the corresponding mdG(q) ∗ solution of the dual problem (2.4), and let πu be any trial space approximation of the exact solution u of (1.1) that interpolates u at the right end-point of every local interval. Then,

T

=

0

(

0

d [q] (u − πcG u), Φ) dt, dt

**where we note that (
**

0

d [q] (u − πcG u), Φ) dt = 0, dt

[q]

e e Lψ,g (¯) ≡ (¯(T ), ψ) +

0 N Mi

(¯, g) dt e Ri (πu, ·)Φi dt ,

Iij

by the construction of the interpolant π cG u (Lemma 5.2 in [7]). Corollary 3.2. (Error representation for mdG(q)) Let U be the mdG(q) solution of (1.1), let Φ be the corresponding mdG(q) ∗ solution of the dual [q] problem (2.4), and let πdG u be an interpolant, as deﬁned in [7], of the exact solution u of (1.1). Then,

T

=−

i=1 j=1

[πui ]i,j−1 Φi (t+ ) + i,j−1

where e ≡ U − πu. ¯ Proof. Choosing e as a test function for the discrete dual we obtain, by the ¯ deﬁnition of the mdG(q)∗ method (see [8]),

N Mi

e Lψ,g (¯) =

0

(f (πdG u, ·) − f (u, ·), Φ) dt.

[q]

[¯i ]i,j−1 Φi (t+ ) + e i,j−1

i=1 j=1

T

˙ ei Φi dt = ¯

Iij 0

(J(πu, U, ·)¯, Φ) dt + Lψ,g (¯), e e

Proof. The residual of the exact solution is zero, and the jump of the exact solution is zero at every node. Thus, by Theorem 3.2,

N Mi

Lψ,g (¯) = e

i=1 j=1

ij [ui − πdG ui ]i,j−1 Φi (t+ ) + i,j−1

[q ]

**and so, by the deﬁnition of J, we have
**

N Mi

Iij

(Ri (u, ·) − Ri (πdG u, ·))Φi dt

[q]

Lψ,g (¯) = e

i=1 j=1 N Mi

[¯i ]i,j−1 Φi (t+ ) + e i,j−1

T

T

˙ ei Φi dt − ¯

Iij 0

(J(πu, U, ·)¯, Φ) dt e

=

0

(f (πdG u, ·) − f (u, ·), Φ) dt,

[q]

[q]

=

i=1 j=1 N Mi

**[Ui − πui ]i,j−1 Φi (t+ ) + i,j−1 [πui ]i,j−1 Φi (t+ ) + i,j−1
**

i=1 j=1

(Ri (U, ·) − Ri (πu, ·))Φi dt

Iij

where we have used the fact that πdG u interpolates u at the right end-point of every local interval, and thus that

N Mi

ij [ui (t+ ) − πdG ui (t+ )]Φi (t+ ) + i,j−1 i,j−1 i,j−1

[q ]

(

Iij

i=1 j=1

d [qij ] (ui − πdG ui ))Φi dt = 0, dt

=−

Ri (πu, ·)Φi dt ,

Iij

by the construction of the interpolant π dG u (Lemma 5.3 in [7]).

[q]

MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV 7 8 ANDERS LOGG 3. the local time steps kij are semi-uniform within each time slab. ∂fi = 0. In this section. we have (A1) and (A2) kij > α kmn . . ﬁrst for the general non-linear problem and then for linear problems. . . and refer to [7. In the derivation of the error representations. which means that the quadrature error is of order 2(q + 1) − 1 = 2q + 1.7) [dp /dtp (∂f /∂u) (x(t))]t l∞ ≤ f T n=0 p−n Cx [x(n) ]t l∞ . for p = 0. (A3) ∂t qij = qmn = q .l∞ ) l∞ l∞ [Ui ]i. and ¯ (4. .1.p D n v L∞ (T . ..j−1 i=1 j=1 Ri (U. we present the interpolation estimates. we need to make the following assumptions: Given a time slab T . for n = 1. We note that ϕi may be discontinuous within Iij . Interpolation estimates To prove the a priori error estimates. f and its derivatives are bounded. .1.1).1. we need to estimate the interpolation error πϕ i − ϕi on a local interval Iij .2. . Furthermore. We further assume that there is a constant ck > 0. which is generally the case with multi-adaptive timestepping.. Using assumptions (A1)–(A5). Note that assumption (A4) implies that each f i is bounded by f T . we have assumed that T noting that the dual problem nevertheless is non-autonomous in general. we assume that (A4) fi ¯ D q+1 (T ) < ∞. ·)Φi dt = 0 Iij and Dnv N the nth-order tensor given by N in the proof of Theorem 3. .5) for all D n v w1 · · · wn w1 . such that x(n) L∞ (T . 1). we need special interpolation estimates. . Φ) dt.9) ϕi = (J (πu. u)Φ)i = l=1 Jli (πu. Similarly for the mdG(q) method. if Iij contains a node for some other component. we obtain the following interpolation estimates for the function ϕ.. Φ) dt = 0 0 in the proof of Theorem 3. i = 1. For the mcG(q) method. This is illustrated in Figure 2.. 6] for the proofs. . we use Radau quadrature with q +1 nodal points. q − 1 and any given x : R → R N . which means that the quadrature error is of order 2(q + 1) − 2 = 2q and so (super-) convergence of order 2q is obtained also in the presence of quadrature errors. We summarize the list of assumptions as follows: the local orders qij are equal within each time slab. ·) − f (U. . we choose f (4. . we obtain additional terms of the form T 0 D n v w1 · · · wn = i1 =1 ··· in =1 T ∂nv n w 1 · · · w in . ·). A note on quadrature errors. . → R and p ≥ 0 by v w1 · · · wn D p (T ) (R(U. ∂xi1 · · · ∂xin i1 ¯ D q+1 (T ) . To derive a priori error estimates for the non-linear problem (1. based on the interpolation estimates of [7]. for some q ≥ 0 and some α ∈ (0. we have assumed that N Mi where · Dp (T ) is deﬁned for v : maxn=0. starting from the error representations derived in the previous section. . Typically. . In order to prove the interpolation estimates for the general non-linear problem. The general non-linear problem. with (4. such that (A5) (A1) (A2) (A3) (A4) (A5) kij f T ≤ ck .. i = 1. . In the presence of quadrature errors. these terms are nonzero. f is autonomous.. N. q . ¯ d /dt (∂f /∂u) (x(t)) ≤ f p p T Cx .l∞ ) . Furthermore. N. RN i = 1. . for each local interval Iij . ˜ (f (U. wn ∈ RN L∞ (T ) = ≤ Dnv L∞ (T . . . . Lobatto quadrature (with q + 1 nodal points) is used for the mcG(q) method. These estimates are proved in [6]. u)Φl .N fi l∞ such that ˜ where f is the interpolant of f corresponding the quadrature rule that is used. 4. N.j−1 Φi (t+ ) + i. assume that for each pair of local intervals Iij and Imn within the time slab. for p = 0. the local time steps kij are small. and so the 2q + 1 convergence order of mdG(q) is also maintained under quadrature.. . and for the mdG(q)method. We also assume that the problem (1. . . . . ·). .. where ϕi is deﬁned by N (4. As a result. p. .l∞ ) ≤ Cx . . we have used the Galerkin orthogonalities for the mcG(q) and mdG(q) solutions.6) p p ≥ maxi=1. .1) ¯ is autonomous. where Cx > 0 denotes ¯ n a constant. 4.

and ﬁnally for a parabolic model problem. ¯ . . . A priori error estimates Using the error representations derived in Section 3. then Φl may be discontinuous within Iij .16) ti. then there is a constant C = C(¯.l∞ ) . the local time steps kij are semi-uniform within each time slab. such that (B3) max A(p) L∞ (T . Linear problems. 5.18) ij πdG ij πcG Figure 2. Theorem 5. The estimates are derived ﬁrst for the general non-linear problem (1. See [6].l∞ ) . 5. ¯ qij = qmn = q . If assumptions (A1)–(A5) hold.j−1 Iij tij ϕi = (A Φ)i = l=1 Ali Φl . qij = q ≥ 2. c k . ¯ qij = q ≥ 1. where ϕi is now deﬁned by N (4. Proof. Lemma 4.l∞ ) . . ¯ for each local interval Iij within the time slab T . A and its derivatives are bounded. [q −1] L∞ (Iij ) ≤ Ckijij f qij +1 T Φ L∞ (T .11) ij πdG ij πcG [q −2] ϕi − ϕ i L∞ (Iij ) ≤ Ckijij q q −1 CAij Φ q L∞ (T .g (¯)| ≤ CS(T ) k q+1 uq+1 L∞ ([0.10) and (4.1. for some q ≥ 0 and some α ∈ (0.5).17) and (4. the local time steps kij are small. such that Φl (t) (B4) (B1) (B2) (B3) (B4) PSfrag replacements Φi (t) kij CA ≤ ck .l2 ) . we need to estimate the interpolation error πϕi − ϕi on a local interval Iij . c k .1) e ¯ |Lψ. qij = q ≥ 2. . then there is a constant C = C(¯.l∞ ) . p = 0. assume that A has q − 1 ¯ ¯ continuous derivatives and let CA > 0 be constant.l∞ ) . N. such that (5.2. q such that (4. 4. . ¯ ϕi − ϕ i L∞ (Iij ) ≤ Ckijij CAij q +1 Φ L∞ (T . and the stability estimates from [8]. assume that for each pair of local intervals Iij and Imn within the time slab. the interpolation estimates of the previous section.1).l∞ ) p+1 ≤ CA . (A priori error estimate for mcG(q)) Let U be the mcG(q) solution of (1. See [6]. α) > 0. q such that (4. For the linear problem (2.1. If assumptions (B1)–(B4) hold. i = 1. causing ϕi to be discontinuous within Iij . The general non-linear problem. we have (B1) and (B2) kij > α kmn . we obtain the following interpolation estimates for the function ϕ. . α) > 0. (Interpolation estimates for ϕ) Let ϕ be deﬁned as in (4. A (p) L∞ (T .9). We further assume that there is a constant c k > 0. (Interpolation estimates for ϕ) Let ϕ be deﬁned as in (4. for each local interval Iij within the time slab T .5). Using assumptions (B1)–(B4). there is a constant C = C(q) > 0. Proof. we make the following basic assumptions: Given a time slab T .T ]. Furthermore. the local orders qij are equal within each time slab.2. .MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV 9 10 ANDERS LOGG for all time slabs T . Then. we now derive our main results: a priori error estimates for general order mcG(q) and mdG(q).1). If some other component l = i has a node within Iij . We summarize the list of assumptions as follows: As for the general non-linear problem. then for the general linear problem (2.1. Lemma 4. ¯ [q −1] [q −2] ϕi − ϕ i ϕi − ϕ i L∞ (Iij ) ≤ Ckijij q q −1 f qij T Φ L∞ (T . q . 1). qij = q ≥ 1.16). . and let Φ be the corresponding mcG(q) ∗ solution of the dual problem (2.4).

ϕ − πdG ϕ)| dt T [q] [q−1] = 0 − u).l∞ ) .g (¯) = e i=1 j=1 N Mi Iij ij (πcG ui − ui )ϕi dt [q ] e Lψ.T ]. (q +1) ui ij L∞ (Iij ) M = 0 − u.4). ϕ − πcG ϕ)| dt |(k q−1 f q−1 [q] T (πcG u [q] [q−2] T e |Lψ.l2 ) f where i (t) = ¯ where the stability factor S(T ) is given by J [q] (πcG u. ϕ) dt.l∞ ) dt = n=1 Kn f Tn Φ L∞ (Tn .l∞ ) . if assumptions (A1)–(A5) hold and g = 0 in (2. ij ϕi ≡ 0 for qij = 1.1 in [7] and Lemma where we take πcG 4. By deﬁnition.l1 ) f 0 T Φ L∞ (T . 0 ij which proves (5.1). and let Φ be the corresponding mdG(q) ∗ solution of the dual problem (2.1. [q ] ¯ S(T ) = 0 f T Φ L∞ (T . we note that by deﬁnition. By Theorem 5. To prove (5. u.l∞ ) dt = n=1 Kn f Tn Φ L∞ (Tn . u. Proof. and where the [q] T S(T ) = 0 J (πdG u. there is a constant C = C(q) > 0. and u ¯ dt. (A priori error estimate for mdG(q)) Let U be the mdG(q) solution of (1.4). ·)Φ) dt.1). such that (5. By Theorem 5.g (¯)| ≤ e 0 T |(πcG u − u. q +1 kijij (q +1) ui ij L∞ (Iij ) for t ∈ Iij .g (¯)| ≤ C S(T ) k 2q u(2q) e 2q kij ij qij −1 T L∞ ([0. u. it now follows that |Lψ.l1 ) [q] −q T (ϕ − πdG ϕ))| dt L∞ (T .g (¯) = i=1 j=1 [q −2] ij (πdG ui − ui )ϕi dt [q ] = i=1 j=1 [q −2] ij ij (πcG ui − ui )(ϕi − πcG [q ] ϕi ) dt. α) > 0. and where the [q] T S(T ) = 0 J (πcG u.l∞ ) dt ¯ ≤ C k 2q+1 u(2q+1) f 0 T Φ ¯ ¯ = C S(T ) k 2q u(2q) L∞ ([0. and so. ·)Φ l2 dt.T ].3) |Lψ. then there is a constant C = C(q. π cG ui − ui is orthogonal to P qij −2 (Iij ) for each local interval Iij . if assumptions (A1)–(A5) hold and g = 0 in (2. α) > 0.T ]. it now follows that T |Lψ.2). πdG ui − ui is qij −1 (I ) for each local interval I . ·) − f (u.l1 ) .1 in [7] and Lemma 4.T ]. then there is a constant C = C(q. such that (5. u. Then. By Corollary 3. ·)(πcG u − u).1. To prove (5.T ]. u.l∞ ) dt = n=1 Kn f Tn Φ L∞ (Tn .T ]. recalling that [q] ϕ = J (πcG u. ck . (q +1) ui ij L∞ (Iij ) for t ∈ Iij . such that (5. we obtain Lψ.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV 11 12 ANDERS LOGG where (k q+1 u(q+1) ) ¯ i (t) = q +1 kijij stability factor S(T ) is given by more. k −q f T L∞ ([0.l2 ) .T ].4). ·)Φ l2 for t ∈ Iij . ·)Φ l2 dt.l1 ) . Further- M f T Φ L∞ (T . it now follows that ij where we take πdG ϕi = 0 for qij = 0.l∞ ) .1.1).g (¯)| ≤ 0 −(q−1) (ϕ T |(πdG u − u.1 in [7].2) ¯ (k 2q u(2q) ) ¯ ¯ |Lψ. k −(q−1) f T − πcG ϕ))| dt [q−2] = 0 |(k q f q T (πdG u − u). where f i (t) = ¯ the stability factor S(T ) is given by ¯ S(T ) = 0 T (q +1) ui ij L∞ (Iij ) for t ∈ Iij . N Mi Iij = i=1 j=1 [q −1] ij ij (πdG ui − ui )(ϕi − πdG [q ] [q −1] ϕi ) dt.4) ¯ ¯ |Lψ. where = Proof. [q−1] ¯ ≤ C k 2q u(2q) L∞ ([0. ck . ·)Φ. The estimate (5.4).1. ·).2. Further- ¯ where the stability factor S(T ) is given by ¯ S(T ) = 0 T M f T Φ L∞ (T . we note that as in the proof of Theorem [qij ] [q] T e 5.g (¯)| ≤ CS(T ) k q+1 uq+1 e ¯ ¯ (k q+1 u(q+1) ) i (t) L∞ ([0.l1 ) .g (¯)| ≤ C S(T ) k 2q+1 u(2q+1) e ¯ (k 2q+1 u(2q+1) ) T 2q +1 kij ij qij T L∞ ([0.g (¯) = e 0 T (f (πcG u.3) is obtained in the same way as we obtained the estimate (5. By Theorem 5. and where Theorem 5. .g (¯)| ≤ C k e q+1 q+1 T L∞ ([0. Φ) dt [q] [q] stability factor S(T ) is given by more.l∞ ) dt. Φ) dt = [q] (πcG u [q] T 0 (J(πcG u. J [q] (πcG u.g (¯) = 0 (πdG u − u. and so orthogonal to P ij ij N Mi Iij N Mi Iij Lψ. we obtain T Lψ. u.

6). ck . Then. Furthermore.5). (5. we have ψ l∞ ≤ 1. then there is a constant C = C(q. q +1 q +1 where (k q+1 u(q+1) )i (t) = ¯ stability factor S(T ) is given assumptions (B1)–(B4) hold and g = 0 in (2.l∞ ) dt = n=1 Kn CA Φ L∞ (Tn .10) e ¯ |Lψ. we obtain Lψ. we obtain the following versions of the a priori error estimates.T ] e Cq f [0. . u. ·)Φ l2 [0. We also make the choice g = 0. (A priori error estimate for mcG(q)) Let U be the mcG(q) solution of (2.l∞ ) [q] (πcG u. we obtain the following bound ¯ for the stability factor S(T ). f [0. (q +1) ui ij L∞ (Iij ) for t ∈ Iij .g (¯) = (e(T ). and where the for ψ = e(T )/ e(T ) l2 . it follows that e i L∞ (Iij ) ≤ ¯ CLψ.T ].T ].l∞ ) and so M ≤ CS(T ) k q+1 uq+1 ¯ L∞ ([0.1 and 5.2 for special choices of data ψ and g.2. we rewrite the estimates 5.g (¯) = e e ¯ e Iij |¯i (t)| dt and so ei L∞ (Iij ) ≤ CLψ. such that (5. Assume that Kn Cq f Tn ≤ 1 for all time slabs Tn .3.. and let Φ be the corresponding mcG(q) ∗ solution of the dual problem (2. . ψ) = |ei (T )|..T ].T ]. Then. Noting that e(T ) = e(T ). and where the T by S(T ) = 0 A Φ l2 dt.5) where f [0. We ﬁrst take ψ = 0. there is a constant C = C(q) > 0. where the stability factor S(T ) is given by S(T ) = eCq .T ] (T −Tn ) Tm ¯ ¯ for p = 2.l∞ ) [q] (πdG u. l∞ e .1. with Cq = Cq (q) > 0 the constant in Theorem 4.l∞ ) . With these choices of data.9) . such that (5. where the stability factor S(T ) is given by S(T ) = eCq 5. since πu(T ) = ¯ u(T ). α). (A priori error estimate for mdG(q)) Let U be the mdG(q) solution of (1. such that (5. Then.T ]. then there is a constant C = C(q.T ] e Cq f where the dt is taken as the = 1. α) > 0.6) e L∞ ([0.T ]. there is a constant C = C(q) > 0.T ].g (¯) by an inverse estimate. and take g = 0. Furthermore..T ]. By Theorem 4.l2 ) . u. we obtain M ¯ ¯ ≤ C S(T ) k 2q u(2q) L∞ ([0. if assumptions maximum (A1)–(A5) and the assumptions of Lemma 5. gi (t) = 0 for t ∈ Iij .l2 ) . such that l∞ e Cq f [0.T ] T Φ L∞ (Tn .g (¯) = (e(T ).1). if assumptions (A1)–(A5) and the assumptions of Lemma 5. Linear problems.l∞ ) dt [0. By the deﬁnition of e. and Lψ.l∞ ) ≤ CS(T ) k q+1 uq+1 ¯ L∞ ([0. (A priori error estimate for mcG(q)) Let U be the mcG(q) solution of (1. Finally.T ]. we have g L1 ([0. we obtain Lψ.T ] T T stability factor S(T ) = 0 J over ψ = 0 and g L1 ([0.T ] t (5.T ].MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV 13 14 ANDERS LOGG Using the stability estimates proved in [8].8) e L∞ ([0.T ] Corollary 5.T ] T .l1 ) .1 hold. ¯ S(T ) ≤ ψ = maxn=1. ¯ S(T ) = n=1 Kn f M Tn Φ L∞ (Tn .l2 ) . 1 kij t ∈ Iij .. M CA Φ L∞ (T . f [0. ck .1 in [8]. such that (5.T ].l1 ) . Note that for both choices of ψ.M f Tn .11) ¯ (k 2q u(2q) ) ¯ ¯ |Lψ.T ] T ¯ ¯ for p = 2.1. if where i (t) = ¯ stability factor S(T ) is given by ¯ S(T ) = 0 T (q +1) ui ij L∞ (Iij ) for t ∈ Iij . Then. Theorem 5.g (¯) + Ckijij e ui ij L∞ (Iij ) . l∞ e Cq f [0.1 of [8].l2 ) = g L1 ([0.7) e(T ) lp T stability factor S(T ) = 0 J over ψ = 0 and g L1 ([0. ck . With gn = 0 for n = i.l∞ ) = 1. Note that for this choice of g.T ] (T −Tn ) ≤ ψ ≤ ψ l∞ n=1 T l∞ 0 Kn Cq f Cq f [0. there is a constant C = C(q) > 0.l1 ) . e for ψi = sgn(ei (T )) and ψn = 0 for n = i.l∞ ) ≤ Cq ψ ≤ Cq ψ l∞ exp m=n+1 Cq f Km Cq f [0. then there is a constant C = C(q.T ].1 hold.6). and e gi (t) = sgn(¯i (t))/kij . ·)Φ l2 Proof. ψ) = e(T ) e l2 .g (¯)| ≤ C S(T ) k 2q u(2q) e 2q q −1 kij ij CAij L∞ ([0. such that (5. ∞.g (¯)| ≤ CS(T ) k q+1 uq+1 q +1 kijij L∞ ([0. Furthermore. e(T ) dt ≤ ψ lp ¯ ¯ ≤ C S(T ) k 2q+1 u(2q+1) L∞ ([0. α). where the dt is taken as the maximum = 1. Lemma 5.2. Corollary 5. ∞.1).

6).T ]. A Φ 0 l2 dt. To prove (5.T ].g (¯) = i=1 j=1 [q −2] N Mi Iij ij (ui − πdG ui )ϕi dt [q ] = i=1 j=1 ij ij (ui − πcG ui )(ϕi − πcG [q ] ϕi ) dt.1.6). we obtain T Lψ. there is a constant C = C(q) > 0.g (¯)| ≤ CS(T ) k q+1 uq+1 e ¯ q +1 L∞ ([0.12) is obtained in the same way as we obtained the estimate (5.l∞ ) dt = n=1 Kn CA Φ L∞ (Tn . By deﬁnition.l∞ ) dt = n=1 Kn CA Φ L∞ (Tn .l1 ) . and where M By Theorem 5. πdG ui − ui is orthogonal to P qij −1 (Iij ) for each local interval Iij .l1 ) [q] [q−1] [q] [q−1] = 0 q−1 |(k q−1 CA (πcG u − u). where the stability factor S(T ) = 0 A Φ l2 dt is taken as the maximum over ψ = 0 and g L1 ([0.T ].l∞ ) .T ].l1 ) .1 hold.l2 ) CA Φ L∞ (T . and let Φ be the corresponding mdG(q) ∗ solution of the dual problem (2.l∞ ) = 1. Then. we obtain error estimates in various norms.10). and so Proof. Furthermore. we obtain Lψ. such that (5. we note that by deﬁnition.l∞ ) dt.1. ϕ) dt. k −q CA (ϕ − πdG ϕ))| dt T L∞ ([0. (A priori error estimate for mcG(q)) Let U be the mcG(q) solution of (2. it now follows that e ¯ |Lψ. ∞.g (¯) = e i=1 j=1 N Mi Iij ij (ui − πcG ui )ϕi dt [q ] e Lψ. . and where the stability factor S(T ) is given by S(T ) = 0 A Φ l2 dt.T ]. we note that as in the proof of Theorem [qij ] [q] T e 5. A Φ) dt. The estimate (5. k −(q−1) CA T L∞ ([0.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV 15 16 ANDERS LOGG Proof.g (¯)| ≤ 0 |(πdG u − u. ¯ where the stability factor S(T ) is given by ¯ S(T ) = 0 T M CA Φ L∞ (T . Furthermore. By Theorem 5. it now follows that T By Theorem 5.l1 ) .5).T ]. ϕ − πdG ϕ)| dt T q −q |(k q CA (πdG u − u).g (¯)| ≤ 0 T [q] |(πcG u − u. it now follows that T e |Lψ. where the stability factor S(T ) is given by S(T ) = eCq CA T .15) e(T ) lp ¯ ¯ ≤ C S(T ) k 2q u(2q) L∞ ([0.1 in [7]. such that (5. α). π cG ui − ui is orthogonal to P qij −2 (Iij ) for each local interval Iij .3. Corollary 5.l1 ) (ϕ − πcG ϕ))| dt dt [q−2] = 0 ¯ ≤ C k 2q u(2q) CA Φ 0 L∞ (T . if assumptions (B1)– (B4) and the assumptions of Lemma 5.T ]. (A priori error estimate for mdG(q)) Let U be the mdG(q) solution of (2. ¯ We now use Lemma 5. [q ] ij which proves (5.T ]. ≤ CS(T ) k q+1 uq+1 ¯ T L∞ ([0. then there is a constant C = C(q.2.1 in [7] and Lemma 4. As for the non-linear problem.l∞ ) ¯ ≤ C k 2q+1 u(2q+1) CA Φ 0 L∞ (T .12) |Lψ. α) > 0.13). if assumptions (B1)–(B4) hold and g = 0 in (2. ϕ − [q] [q−2] πcG ϕ)| dt −(q−1) e |Lψ.l∞ ) . where i (t) = ¯ the stability factor S(T ) is given by ¯ S(T ) = 0 T ¯ (k 2q+1 u(2q+1) ) 2q +1 q kij ij CAij ui (qij +1) L∞ (Iij ) for t ∈ Iij . Φ) dt T = 0 (u [q] − πcG .2.g (¯)| ≤ C k q+1 uq+1 T L∞ ([0. we note that for special choices of data ψ and g for the dual problem. and so N Mi Iij N Mi Iij Lψ. = i=1 j=1 ij ij (ui − πdG ui )(ϕi − πdG [q ] [q −1] ϕi ) dt.14) e L∞ ([0.4. then there is a constant C = C(q. there is a constant C = C(q) > 0. such that (5.10). ¯ ¯ for p = 2. ¯ ¯ = C S(T ) k 2q u(2q) L∞ ([0.g (¯)| ≤ C S(T ) k 2q+1 u(2q+1) L∞ ([0.5).g (¯) = 0 (u − πdG u.T ].T ]. To prove (5.11).13) ¯ ¯ e |Lψ. such that (5. ck . in particular the l2 -norm at ﬁnal time. By Corollary 3.l2 ) . where ϕ = A Φ.1 to obtain a bound for the stability factor S(T ). ¯ where (k q+1 u(q+1) )i (t) = kijij ui (qij +1) L∞ (Iij ) T for t ∈ Iij . ck .l2 ) .l∞ ) Theorem 5.1 in [7] and Lemma 4.g (¯) = e 0 (A(u − [q] πcG u). Then.

and E = factor S(T ) is given by (5. For q = 0. that is.5). This condition corresponds to the condition σK n ≤ Tn−1 used in the strong stability estimate for the discrete dual problem in [8]. E = 0 > 0.16) e L∞ ([0. we have as before (C1) qij = qmn = q . σ) > 0. Theorem 5. ˙ (5. Then. we assume that A is invertible on (0. where C = C(q. using assumptions (C3)–(C6).MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV 17 18 ANDERS LOGG Corollary 5. ck .25) S(T ) ≤ C log T +1 KM 1/2 . . . Av) dt ≤ γ Tn−1 ¯ (Av. Parabolic problems.T ] [ki i=1 2q+1 2qi (t)+1 (t) (Aq u)i l2 (qi (t)+1) 2 L∞ (Iij (t)) ] +E = CS(T ) max k [0. We also assume that there is a constant σ > 1.T ] l2 + E. = 0 (Aq u − πdG Aq u. p ∞ 1 ≤ CS(T ) max k 2q+1 Aq u(q+1) ¯ [0. ¯ Furthermore. Then. ∞. we obtain the following analytical bound for S(T ).j−1 }.T ]. A1−q Φ) dt (Aq u − πdG Aq u.18). If Av is not close to being orthogonal to the trial space. where t = t(t) is the piecewise constant right¯ continuous function deﬁned by t(t) = minij {T − ti.2 that T e(T ) l2 = 0 T (u − [q] πdG u. A1−q Φ) dt T [q] = 0 + 0 T (πdG Aq u − Aq πdG u. such that ¯ ¯ (5. if assumptions (B1)– (B4) and the assumptions of Lemma 5. With ψ = e(T )/ e(T ) T l2 and g = 0. . We ﬁrst assume that there is a constant γ ≥ 1. then there is a constant C = C(q.T ]. T ]. To prove the a priori error estimate.l∞ ) ≤ CS(T ) k q+1 uq+1 ¯ T 0 L∞ ([0. such that (5. n = 1. A1−q Φ) dt [q] [q−1] [q] [q] (T − Tn ) Tn−1 (Av. where the stability factor S(T ) is given by S(T ) = eCq CA T . t ∈ (0.j−1 : t ≥ ti. for all trial functions v. T ]. T ) for q ≥ 2 and refer to this as assumption (C2). such that (C4) σKn ≤ (T − Tn ). it follows by Corollary 3. with A a positive semideﬁnite and symmetric N ×N matrix for all t ∈ (0. We further assume that all components use the same time step on the last time slab T M . AΦ) dt [q] = 0 [q] (Aq (u − πdG u). . α). we need to make the following assumptions. are needed for the strong stability estimate of [8]. A1−q Φ) dt [q] [q] = 0 T (Aq u − πdG Aq u + πdG Aq u − Aq πdG u.T ] N [q] l2 +E 1/2 = S(T ) max [0.l2 ) . Proof. there is a constant C = C(q). (C3)–(C6).18) u(0) = u0 .T ] Aq u(q+1) ¯ + E. The stability where (k 2q+1 Aq u(q+1) )i (t) = kij ij ¯ for q = 0. . The estimate is based on the error representation for the mdG(q) method presented in Section 3 and the strong stability estimate derived in [8].T ] i=1 q i [ki i ((Aq u)i − πdG (Aq u)i )]2 N [q ] +E 1/2 ≤ CS(T ) max t∈[0. .5.l ) . such that (C3) Tn Tn k −q (A1−q Φ − πdG A1−q Φ) [q−1] l2 dt. such that (5. . A1−q Φ − πdG A1−q Φ) dt + E. and assume that (C1) and (C2) hold. 5. where we have assumed that A is invertible for q ≥ 2. that is.T ]. Finally. (5.23) e(T ) l2 where the stability factor S(T ) = A Φ l2 dt is taken as the maximum over ψ = 0 and g L1 ([0. there is a constant C = C(q) > 0. (A priori error estimate for parabolic problems) Let U be the mdG(q) solution of (5. we assume that A is constant and refer to this as assumption (C6). u(t) + A(t)u(t) = 0. .24) S(T ) = 0 2q +1 (q +1) (Aqij u)i ij L∞ (Iij ) [q] q T q π [q] u. for t ∈ Iij .T ]. With S(T ) = T −q 1−q Φ − π [q−1] A1−q Φ) l2 dt. . (C5) kij = KM ∀ Iij ∈ TM .17) e(T ) l ≤ C S(T ) k 2q+1 u(2q+1) L ([0.4. we thus obtain dG 0 k (A e(T ) l2 ≤ S(T ) max k q (Aq u − πdG Aq u) [0. M − 1.3. n = 1. Additional assumptions. and prove an a priori error estimate for the mdG(q) method. all v discontinuous and piecewise polyno¯ ¯ mial with vi |Iij ∈ P qij (Iij ). We ﬁrst assume that q is constant within each time slab.l∞ ) = 1. Furthermore. We consider the linear parabolic model problem. (A priori error estimate for mdG(q)) Let U be the mdG(q) solution of (2. π(tAv)) dt. then γ is of moderate size. for each pair of intervals Iij and Imn within a given time slab. M − 1.1 hold. 1. A1−q Φ) dt for q (πdG A u − A dG 0 T ¯ ¯ for p = 2. γ.

For given k0 > 0.6). ki (t) = k0 /2 for i = 3. and so the estimate S(T ) ≤ C log [8].92 7. From the results presented in Figure 3. both for mcG(q) and mdG(q). S(T ) = 0 AΦ l2 dt ≤ C log T +1 KM T 1/2 10 0 .67 4 6 8 10 convergence p for mcG(q). For q = 0. We also present some results in support of assumption (C3). (6.96 4. = u1 + 2u3 − 4u5 . that T Aq u Table 1. = −u2 + 2u4 .1. and study the convergence of the error e(T ) l2 with decreasing k0 .82 9.94 6. then the problem is parabolic by deﬁnition. and ki (t) = k0 /4 for i = 5.99 2q 2 Table 1.92 2. and Table 2. = u1 − 2u3 . Numerical computation of the stability factor also directly reveals whether the problem is parabolic or not. The solution is given by u(t) = (sin t. . cos t + cos 2t. 2. q ≤ 5.3 in [8]. = −u1 .MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV 19 20 ANDERS LOGG Note that we use an interpolation estimate for which is straightforward since the exact solution u is smooth.10 – 2q + 1 1 3 5 7 9 11 Table 2. it follows directly by Theorem 4. 1. 0. 6. cos t + cos 2t+cos 4t). 10 −2 and for q = 1. using the strong stability estimate for the discrete dual solution Φ. Order of convergence p for mdG(q). we obtain T dG(0) cG(1) dG(1) cG(2) dG(2) cG(3) dG(3) S(T ) = 0 k −1 (Φ − πdG Φ) [0] l2 dt ≤ C 0 ˙ Φ l2 dt. if the stability factor is of unit size and does not grow. Order of 2 3 4 5 3. 4. sin t + sin 2t + sin 4t.3 in 10 −8 cG(4) dG(4) cG(5) dG(5) 10 −10 The stability factor S(T ) that appears in the a priori error estimate is obtained from the discrete solution Φ of the dual problem (2. and can thus be computed exactly by solving the discrete dual problem. it is clear that the predicted order of convergence is obtained.96 5.1) with mcG(q) and mdG(q). see [2]. the additional assumptions (C3)–(C6) needed to obtain the analytical bound for S(T ) are no longer needed. Numerical examples We conclude by demonstrating the convergence of the multi-adaptive methods in the case of a simple test problem. 1] with initial condition u(0) = (0.1) on [0. T KM +1 1/2 follows again by Theorem 4. 10 −12 10 −14 10 −16 10 −2 k0 10 −1 10 0 Figure 3. 6. 3). Convergence of the error at ﬁnal time for the solution of the test problem (6. 2. Allowing numerical computation of the stability factor. sin t + sin 2t. mdG(q) 0 1 2 3 4 5 p 0. 0. Convergence.87 9. Consider the problem u1 ˙ u2 ˙ u3 ˙ u4 ˙ u5 ˙ u6 ˙ = u2 . We conclude by estimating the stability factor S(T ) for q = 0. 1. = −u2 − 2u4 + 4u6 . 6. mcG(q) 1 p 1. we take ki (t) = k0 for i = 1. cos t. 10 −4 PSfrag replacements e(T ) l2 10 −6 using an interpolation estimate in combination with an inverse estimate.

25 (2003). As mentioned. Numer.4 0.5 −1.5 −0.2) Tn−1 Tn−1 (Av. π(t Av)) dt −0. . . [4] A. Anal. this may fail to hold if Av is close to orthogonal to the trial space. Av) (solid) ¯ and (Av. SIAM J. 1879–1902.1 0. 1 ¯ 0 (Av.7 0. 2004–03. Sub[8] mitted to SIAM J. Rep. Eriksson. SIAM J. Introduction to adaptive methods for diﬀerential equations.8 0. Comput. (1995). . Acta Numerica. pp. pp. Error estimates and adaptive time-step control for a class of one-step methods for stiﬀ ordinary diﬀerential equations.. Here. .4 0.. we plot C(Av. [5] . pp. 0 0. 1]. Numer. 25 (1988). C corresponds to Tn−1 in (6. Sci. Av) dt .3 0.2).8 0. Av) dt ≤ γ Tn−1 ¯ (Av.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES IV 21 22 0. Comput. we present an example in which C = 100 and γ = 1. Johnson. Tech. −0. 908–926.1 0. where interpolation is given by taking the right end-point value within each local interval. (2004).2 100 0 0 (6. [3] C. 2004. [2] K.2 0. .5 0. 24 (2003). M. SIAM J. The strong stability estimate Theorem 4. Johnson. Av)/(Av.8 1 −1 0. then π(Av) ≈ Av and (6. and randomize the piecewise constant function v on this partition. To appear in Encyclopedia of Computational Mechanics. we plot a component of the function Av (solid) and its interpolant π(Av) (dashed) for the partition discussed in the text. 2004–02. Multi-adaptive Galerkin methods for ODEs III: Existence and stability. π(tAv)) (dashed). Examining the quotient γ = max v ¯ ¯ where t = t(t) is the piecewise constant left-continuous function deﬁned by ¯ t(t) = minij {tij : t ≤ tij }.05.5. if every pair of components which are coupled through A use approximately the same step size.2) holds. (2004). 1119–1141. π(Av)7 6. Multi-adaptive Galerkin methods for ODEs II: Implementation and applications.9 1 Figure 4. π( t Av)).3 in [8].6 0. which is used in the proof of Theorem 5. On the other hand.2. we ﬁnd γ 1. Logg.9 1 0 0 0. Above right.7 0. Logg.6 0.1 0. .2 PSfrag replacements −0. 105–158. Left. Chalmers Finite Element Center Preprint Series. relies on assumption (C3).3 0.2 0. 2004. Chalmers Finite Element Center Preprint Series. D.4 PSfrag replacements (Av)7 .8 0. Johnson. we plot the cor¯ responding quotient C(Av..2 0.6 0.2 t 0. Rep. Estep. π(tAv)) dt.5. P. Adaptive computational methods for parabolic problems. . References [1] K. Hansbo. . ¯ with t(t) = minij {C + tij : t ≤ tij } for C large.7 0.4 2 We take ki (t) = 1/i for i = 1. Interpolation estimates for piecewise smooth functions in one dimension. and C. Sci.3 0.6 1. Estimates of derivatives and jumps across element boundaries for multi-adaptive [6] Galerkin solutions of ODEs. which for the dual problem (with time reversed) can be stated in the form Tn Tn 500 0. Eriksson. Multi-adaptive Galerkin methods for ODEs I. Numerical evidence for assumption (C3).9 1 n = 2. [7] . π(Av)7 0 0. for A given by 2 −1 0 0 0 0 0 0 0 0 −1 2 −1 0 0 0 0 0 0 0 0 −1 2 −1 0 0 0 0 0 0 0 0 −1 2 −1 0 0 0 0 0 0 0 0 −1 2 −1 0 0 0 0 . . 10 on [0.8 ANDERS LOGG (Av)7 . . and below right. . In Figure 4.4 t 0. Anal. pp. and A.6 400 300 200 0. We illustrate this in the case of the mdG(0) method. A= 0 0 0 0 −1 2 −1 0 0 0 0 0 0 0 0 −1 2 −1 0 0 0 0 0 0 0 0 −1 2 −1 0 0 0 0 0 0 0 0 −1 2 −1 0 0 0 0 0 0 0 0 −1 2 C 1 0 (Av. Tech. C..

Numerical examples are given for a series of well-known stiﬀ and non-stiﬀ test problems. In the current paper. where u : [0. explicit. we prove existence and stability of discrete solutions. which are used in part IV to prove a priori error estimates. The presented methodology has been implemented in DOLFIN [5]. . We are thus forced to take (much) smaller time steps than required to meet the given error tolerance. email : johanjan@math.2 JOHAN JANSSON AND ANDERS LOGG MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V: STIFF PROBLEMS JOHAN JANSSON AND ANDERS LOGG Abstract.4. mcG(q) and mdG(q). Ui |Iij ) as an element.2.1) u(0) = u0 . We ﬁrst discuss a few basic and well-known properties of ﬁxed point iteration in Section 2. 1.j−1 . 10]. In part III. T ] into M i subintervals. Introduction This is part V in a sequence of papers [7. mcgq.1). 1. The multi-adaptive solver in DOLFIN is based on the original implementation Tanganyika. through which the time steps are adaptively determined from residual feed-back and stability information. of the approximate m(c/d)G(q) solution U (t) of (1. In the current paper. 2004.1. In [3]. In particular.j−1 . we develop the methodology of multi-adaptive time-stepping for stiﬀ problems. For a detailed description of the multi-adaptive Galerkin methods. This is illustrated in Figure 1. Anders Logg. so-called stiﬀ problems. The mcG(q) and mdG(q) methods are based on piecewise polynomial approximation of degree q on partitions in time with time steps which may vary for diﬀerent components Ui (t) of the approximate solution U (t) of (1. The following notation is used throughout this paper: Each component Ui (t). we prove a posteriori error estimates. Multi-adaptivity. 1. T > 0 a given ﬁnal time. obtained by solving a dual linearized problem. we refer the reader to [7. this becomes evident when the adaptively determined time steps become too large for the ﬁxed point iteration to converge. we run into the same diﬃculties when we try to solve the system of equations given by an implicit method using direct ﬁxed point iteration. T ] → RN is the solution to be computed.chalmers. t).1) is a piecewise polynomial on a partition of (0. 8. where the damping factor α plays the role of the small stabilizing time steps. 9. Key words and phrases. T ] → RN a given function that is Lipschitz-continuous in u and bounded. The stiﬀness problem. Chalmers University of Technology. Implementation. . This is often referred to as the Date: April 13. stiﬀ problems. but has been completely rewritten for DOLFIN. < TM = T . 8. t ∈ (0. 9. individual time steps. tij ]. discontinuous Galerkin. . and f : R N × (0. we extend the ideas presented in [3] for the monoadaptive cG(1) method to general multi-adaptive time stepping. We denote the length of a time slab by K n = Tn − Tn−1 . we shall assume that the interval (0.se. there is a certain class of problems. N . we show that the technique of stabilizing time step sequences can be extended to adaptively stabilized ﬁxed point iteration on time slabs. for which standard explicit methods are not suitable. 10] on multi-adaptive Galerkin methods. Using sequences of stabilizing time steps. i = 1. On each subinterval I ij . As noted in [3]. mdgq. consisting of alternating small and large time steps. ˙ (1. 1. and the length of the subinterval is given by the local time step k ij = tij − ti. In particular. SE–412 96 G¨teborg. and then present our new . . we present a new methodology for the stabilization of explicit methods for stiﬀ problems. We refer to the set of intervals Tn between two synchronized time levels Tn−1 and Tn as a time slab: Tn = {Iij : Tn−1 ≤ ti. Furthermore. Notation. email : logg@math. Ui |Iij is a polynomial of degree qij and we refer to (Iij . T ]. Within the setting of multi-adaptive Galerkin methods. we refer to [7] or [9] for the deﬁnition of the methods. The new implementation is discussed in detail in [6]. Department of Computational Mathematics. 1.j−1 < tij ≤ Tn }. Subinterval j for component i is denoted by I ij = (ti. Sweden. o 1 stiﬀness problem. which typically happens outside transients. local time steps. based on the inherent property of the stiﬀ problem itself: rapid damping of high frequencies.se. . We develop the methodology of multi-adaptive time-stepping for stiﬀ problems. Outline of the paper. T ] is partitioned into blocks between certain synchronized time levels 0 = T 0 < T1 < . for approximate (numerical) solution of ODEs of the form u(t) = f (u(t). Johan Jansson.chalmers. presented in [8]. the C++ implementation of the new open-source software project FEniCS [2] for the automation of Computational Mathematical Modeling (CMM).3. an eﬃcient explicit method is obtained. continuous Galerkin. ODE. u0 ∈ RN a given initial value. In part I and II of our series on multi-adaptive Galerkin methods. The new algorithm is based on adaptively stabilized ﬁxed point iteration on time slabs and a new method for the recursive construction of time slabs. As noted already by Dahlquist [1] in the 1950s. .

e. en = I − α(I − g (ξ)) en−1 . this iteration converges to the unique solution x of (2. we present an algorithm for adaptively stabilized ﬁxed point iteration. and (2. and the adaptively stabilized ﬁxed point iteration on time slabs. 3. and thus dn = I − α(I − g (ξ)) dn−1 . Elements between common synchronized time levels are organized in time slabs. we obtain en = xn − x = g(xn−1 ) − g(x) = g (ξ)(xn−1 − x).2) converges to zero if g is bounded by C < 1.2) where I is the N × N identity matrix and the damping factor α is an N × N matrix to be determined. . we write F (x n ) = xn − g(xn ) in the form F (xn ) = (xn − xn−1 ) + (xn−1 − g(xn−1 )) + (g(xn−1 ) − g(xn )). and consider the problem of solving the equation or. we present numerical results for a sequence of stiﬀ test problems taken from [3].3) for n = 1. and thus (3. Given an initial guess x0 . we modify the basic iteration (2.2) RN → RN be a given diﬀerentiable function of the form F (x) ≡ x − g(x) F (x) = 0 By (2. we have N = 6 and M = 4. it now follows that we can measure either the residual F (xn ) or the increment dn to determine the convergence of the error en .5) F (xn ) = g (ξ)F (xn−1 ). It now follows by (3. This gives α = (I − g (xn−1 ))−1 = (F (xn−1 ))−1 . alternatively. and thus en = g (ξ)en−1 . Fixed point iteration Let F : (2. where we have replaced the unknown intermediate value ξ with the latest known value x n−1 . x = g(x) by ﬁxed point iteration.3). by (2. 2. Finally. (3. F (xn ) = I − (I − g (ξ))α F (xn−1 ).3) is recovered for α = I. and thus.j−1 tij Tn−1 Kn Tn T (2. For the increment dn ≡ xn − xn−1 . or.6). with x the solution of (2. (3. Individual partitions of the interval (0.3) We also note that x = (I − α)x + αg(x) if x = g(x). . To show the equivalent of (2. we then discuss two important parts of the multi-adaptive algorithm: the construction of multi-adaptive time slabs. since the Lipschitz constant is bounded by the derivative of g.5). based on measuring the convergence of the residual F (xn ) or the increment dn . and thus Similarly. the ﬁxed point iteration needs to be stabilized. . In this example. we similarly obtain dn = xn − xn−1 = g(xn−1 ) − g(xn−2 ) = g (ξ)(xn−1 − xn−2 ).6) and so the residual F (xn ) of (2.3) according to (3. To see this.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 3 4 JOHAN JANSSON AND ANDERS LOGG Iij PSfrag replacements i (2. and thus dn = g (ξ)dn−1 . we obtain dn = xn − xn−1 = (I − α)xn−1 + αg(xn−1 ) − (I − α)xn−2 − αg(xn−2 ) = (I − α)dn−1 + αg (ξ)(xn−1 − xn−2 ). In the next section. Note that (2. We will mainly consider the case of a diagonal or scalar α. (2. (2. and thus the error en satisﬁes en = xn − x = (I − α)xn−1 + αg(xn−1 ) − (I − α)x − αg(x) = (I − α)en−1 + αg (ξ)(xn−1 − x). By the Banach ﬁxed point theorem. if the Lipschitz constant L g of g satisﬁes (2.4) Lg < 1.. Figure 1.1) that F (xn ) = −αF (xn−1 ) + F (xn−1 ) + g (ξ)(xn−1 − xn ) = (I − α)F (xn−1 ) + g (ξ)αF (xn−1 ). 2.7). to obtain the ﬁxed point x satisfying x = g(x). methodology of adaptively stabilized ﬁxed point iteration in Section 3. if g ≤ C with C < 1 for a suitable norm · . . we iterate according to (2.7) We ﬁnally note that for the error en ≡ xn − x. In Section 4. in Section 5.4) The question is now how to choose the damping factor α. we note that F (x n ) = xn − g(xn ) = g(xn−1 ) − g(xn ) = g (ξ)(xn−1 − xn ). i. One obvious choice is to take α such that I −α(I −g (xn−1 )) = 0.2). T ] for different components. xn = g(xn−1 ) = xn−1 − (xn−1 − g(xn−1 )) = xn−1 − F (xn−1 ).2).5). (3. t 0 kij ti. Adaptive fixed point iteration To stabilize the ﬁxed point iteration.1) xn = (I −α)xn−1 +αg(xn−1 ) = xn−1 −α(xn−1 −g(xn−1 ) = xn−1 −αF (xn−1 ). If the solution does not converge..1) (2.5) xn = xn−1 − (F (xn−1 ))−1 F (xn−1 ).

8) α= cos β . ˜2 where ri = |1 + λi |. Let α = diag(α 1 . (2) Re λi > −1 for all λi .1. We now take (3. . the ﬁxed point iteration is given by (3. We note that. . .e.2. N . If B should be defective. It follows that ˜ |σi |2 ≤ 1 + α2 ri − 2α˜i cos β = 1 + ˜2 r ≤ 1+ ri ˜ β 1+maxi |λi | cos2 with λ1 . We focus on the case where α is either diagonal or scalar. it follows that N N n−1 ei v i = i=1 i=1 n−1 ei (1 − α(1 + λi ))v i = N n−1 σi ei v i . | arg(1+λ i ) | ≤ β for all λi . We further assume that (1) B is non-defective. as illustrated in Figure 2. . for some β ∈ (0. With (3. . Diagonal damping. . . then we can choose α diagonal such that the stabilized ﬁxed point iteration (3. . and thus 1 + Re λi ≥ ˜ ri cos β. It follows that the stabilized ﬁxed point iteration converges if we take α such that |σi | < 1 for i = 1. − ri cos2 β ˜2 2˜i cos2 β r − 1+maxi |λi | (1+maxi |λi |)2 2β 2˜i r β ri cos ˜ 1+maxi |λi | = 1 − 1+maxi |λi | < 1. since α is chosen based on the largest eigenvalue. N . and (2) Bii ≥ 0. since then Bii /(1 + Bii ) is close to unity. . i=1 ei which gives = Bii /(1+Bii ) < 1. Im λ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ β ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Re λ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ or xn = Gα xn−1 . Note that the ﬁrst condition is not a major restriction. For i = 1.. We also note that the convergence may be slow if some B ii 1.2). N n−1 i v. .7) N j=1 |(Gα )ij | αi = 1/(1 + Bii ). i. .4). (3) |Im λi |/(1+Re λi ) ≤ tan β.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 5 6 JOHAN JANSSON AND ANDERS LOGG ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ which is Newton’s method for the solution of (2. We now present an algorithm for stabilized ﬁxed point iteration which adaptively determines the damping factor α. . PSfrag replacements −1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ By (3. which will always be introduced through round-oﬀ errors. the convergence for eigenmodes corresponding to smaller eigenvalues may be slow. en = (I − α(I + B)) where σi = 1 − α(1 + λi ). i i i = 1. . . | arg(1 + λi ) | ≤ β. and assume for simplicity that g is constant and equal to −B. . . i. λN ). it follows that the ﬁxed point iteration converges for G α l∞ < 1. .e.. we assume as above that g = −B is constant. With this choice of α. . . . . We assume that (1) B is diagonally dominant. αN ) be a diagonal matrix. where Gα l∞ denotes the maximum absolute row sum. Scalar damping. . N .1) converges. With α ∈ (0. i = 1. and which avoids computing the Jacobian F and solving a linear system in each iteration as in Newton’s method. λN the eigenvalues of B. π/2). with Gα = I − α(I + B). 1 + maxi |λi | we obtain |σi |2 = (Re σi )2 + (Im σi )2 = (1 − α(1 + Re λi ))2 + α2 (Im λi )2 = 1 + α2 ri − 2α(1 + Re λi ). i=1 since B is diagonally dominant and Bii ≥ 0. We thus conclude that if B is diagonally dominant and Bii ≥ 0 for each i. we write the error e n−1 in the form en−1 = By (3.1) converges. . . N.6) xn = (1 − αi )xn−1 + αi gi (xn−1 ).4). . The eigenvalues λ of the matrix B are assumed to lie within the shaded sector. we have N j=1 ¡ ¡ ¡ ¡ ¡ |(Gα )ij | = |1 − αi − αi Bii | + αi j=i |Bij | ≤ |1 − α − αBii | + αi Bii . B will be made non-defective by a small perturbation. Figure 2. 1] scalar. . B is diagonalizable: ∃ V = v1 · · · vN non-singular : V −1 BV = diag(λ1 . By assumption. 3. . . To determine the size of α. 3. . cos2 and thus the ﬁxed point iteration (3.

which automatically detects the appropriate size of α in each iteration. . the damping factor α and the number of stabilizing steps m are then determined for β = π/4 according to √ 1/ 2 (3. but also at the smaller eigenvalue λ1 .10). Although B l2 ≈ 104 and there is no α ∈ (0. corresponding to one time step of size K = 1 with the dG(0) method for a mass-spring-dashpot system with damping b = 200 and spring constant κ. Convergence of the stabilized ﬁxed point iteration for the solution of (3. The residual F (x n ). i α ← 2α/(1 + α). which is obtained by cumulative power iteration as follows. there is only one eigenvalue and so α needs to be targeted only at this eigenvalue. This is illustrated in Figure 3. 1 1 0 −1 κ 200 As an example. or the increment dn .12) α= .8). the stabilized ﬁxed point iteration converges. κ = 2 · 104 . we need to determine the value of ρ = maxi |λi |. For the stabilized ﬁxed point iteration to converge. the eigenvalues λ = 100 ± 100i of A have a large imaginary part. To determine the number m of stabilizing iterations.14) with κ = 10 4 .4. this eigenmode will converge by a factor ∼ 1 − cos β. For κ = 104 . which is accomplished by gradually increasing the damping factor α after each sequence of stabilizing iterations.11) ρn = (ρn−1 )(n−1)/n ( F (xn ) l2 / α giving PSfrag replacements 10 −1 10 −1 10 −1 10 −2 10 −2 10 −2 10 −3 0 20 n 40 10 −3 0 20 n 40 10 −3 0 100 n 200 300 Figure 3. With κ = 10 4 . 1] such that Gα l2 < 1 with . κ= 10 0 104 10 0 κ = 2 · 104 10 0 κ = 103 10 −10 10 −10 10 −10 0 20 40 0 50 100 0 100 200 300 10 0 10 0 10 0 log (maxi |λi |) . until ρn has converged to within some tolerance. towards α = 1. the matrix A has two eigenvalues λ1 ≈ 5 and λ2 ≈ 195 of diﬀerent magnitudes. F (xn ) if ri ˜ 1 + maxi |λi |.8). Gα = I −α(I +B). log 1/(1 − cos β) We note that the number of stabilizing iterations becomes large for β close to π/2. we note that with α = 1. F (xn−1 ) l2 ) 1/n . we assume in √ practice that β = π/4. we thus need to choose m such that (1 − cos β)m max |λi | < 1.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 7 8 JOHAN JANSSON AND ANDERS LOGG (3. which results in oscillations in the convergence.8) and (3. With α and m determined by (3. . To compensate for one iteration with α = 1. is measured for a sequence of iterations with α = 1. the eigenmode corresponding to the largest eigenvalue will diverge by a factor maxi |λi |. determine ρn according to (3.13) m = log ρ. respectively. For κ = 103 . To improve the convergence for these eigenmodes.7 of DOLFIN. by targeting the stabilization at the largest eigenvalue λ = 100. the system is critically damped and B = −KA is defective with two eigenvalues of size λ = 100. We further note that with damping factor α given by (3. We let ρ 1 = F (x1 ) l2 / F (x0 ) l2 . respectively. we consider the solution of the linear system (3. typically 10%. the algorithm determines a suitable number m of stabilizing iterations with damping factor α given by (3. Note the diﬀerent behavior of the convergence for the three diﬀerent systems. . and κ = 103 .9) This corresponds to the use of stabilizing time step sequences in [3] for the stabilization of explicit methods for stiﬀ problems. and then gradually increases α by a factor two. All three results were obtained using same general iterative algorithm available in version 0. by stabilized ﬁxed point iteration.14) x = g(x) = u0 − KAx = − x. 3. For κ = 2 · 10 4 . which gives cos β = 1/ 2 and m ≈ log(maxi |λi |). and for n = 2. and to limit the number of stabilizing iterations m. corresponding to an under-damped and over-damped harmonic oscillator. When ρ has been computed. it is then important that α is targeted not only at the large eigenvalue λ 2 .10) m> (3. where we also plot the convergence for κ = 2 · 10 4 and κ = 103 . 1+ρ and (3.

referred to as the partitioning threshold. Each element (Iij . Tn ] contains a non-empty list of elements. Algorithm The algorithm we propose is a modiﬁed version of the algorithm presented earlier in [8]. . For certain problems (stiﬀ problems). other than that the ﬁrst time step is the same for each component and also that the last time step for each component may be adjusted to match the given end time T for the simulation. time slabs are constructed in a way that allows each component to have its individual time step sequence. independent of the time step sequences for other components.1. In [8]. 4. With this deﬁnition. remains unchanged. In particular. The root time slab recursively contains a total of nine element groups and 35 elements. essentially corresponding to the original algorithm of [8]. .MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 9 10 JOHAN JANSSON AND ANDERS LOGG 4. The new algorithm is intelligent. consisting of at least one element for every component. For the construction of the time slab. which in turn may contain nested groups of elements and time slabs. simple ﬁxed point iteration is used. . 2. as well as properties of the diﬀerential equation (1.1) itself.1) K = max ki . which we refer to as an element group. In the current implementation. mcG(q) or mdG(q). We let k = (ki ) denote the vector of desired time steps for the diﬀerent components. has been used. we may thus vary the multi-adaptive nature of the algorithm. We next partition the components into two groups. The recursive organization of the time slab. the maximum quotient between two diﬀerent time steps within the time slab. This is illustrated in Figure 4. a time slab does not have a well-deﬁned left end-point Tn−1 and right end-point Tn . which determines the granularity of the time slab. The root time slab in the ﬁgure contains one element group of three elements and three time slabs. one group I 00 ⊂ I0 containing components with small time steps. as discussed in [8]. To construct the time slab. The modiﬁed algorithm diﬀers from the original algorithm both in how the time slabs are constructed. and a small partitioning threshold means that all components will use the same time step. (4. A large partitioning threshold means that each component will have its own time step. This time step is adaptively determined by a controller from the current component residual with the goal of satisfying a given error tolerance. we ﬁrst examine each component for its desired time step. N }. The root time slab covering the interval (Tn−1 . Each time slab contains an element group (shaded) and a list of recursively nested time slabs. The value of θ determines (roughly speaking). This means in particular that for a non-stiﬀ problem. By varying θ. in the sense that the iterative strategy is automatically adapted to the detected level of stiﬀness. the stiﬀness will depend on the size of the time steps (and thus on the tolerance) and the exact construction of the time slab. we introduce a parameter θ ∈ [0. The new algorithm recursively constructs a time slab between two synchronized time levels Tn−1 and Tn .j−1 < tij ≤ Tn . The ﬁrst of these sub slabs contains an element group of two elements and two nested time slabs. and another group I 01 ⊆ I0 containing components with large time steps. No restrictions are made on the time step sequences. The algorithm presented in [8] gives the proper time step sequence for each component. . this iteration may fail to converge. as determined by the controllers. based on the harmonic mean value with the previous time step. U |Iij ) within the time slab satisﬁes the relation Tn−1 ≤ ti. The time slab is organized recursively as follows. 1]. Recursive construction of time slabs. PSfrag replacements Tn−1 Tn Figure 4. but has the disadvantage that there is little structure in the organization of the time slabs. Note that the method. an individual controller is used. we let K be the largest time step contained in the vector k. and in how the iteration is performed on each time slab. i i ∈ I0 = {1. . such as the eigenvalues of the Jacobian of the right-hand side f . and a possibly empty list of time slabs. The original multi-adaptive iterative strategy of [8] is based on simple ﬁxed point iteration. We take this as the deﬁnition of stiﬀness: A problem is stiﬀ when simple ﬁxed point iteration does not converge. For the partition of the components. a simple controller. For each component. and so on.

we illustrate the recursive construction of elements by numbering the elements in the order in which they are created. All components within I00 for which ki < θK are assigned to the group I000 of components with small time steps within I 00 .2) K = min ki . ¯ and let K be the length of the sub slab. ti.j−1 = Tn−1 and tij = Tn . i This means in particular that the ﬁrst element that is constructed is for the component with the smallest time step. until ﬁnally all time slabs and element groups within the root time slab have been created. Figure 5.6) ¯ K = min ki . Each of these elements covers the full length of the time slab. we let K be the size of the time slab and adjust the size if we should reach the given ﬁnal time T . i i ∈ I001 . (4. Note that we construct the list of sub slabs before we create the element group. we again determine the maximum time step. In Figure 6. The list of sub slabs is constructed sequentially until the list of sub slabs covers the interval [Tn−1 . Tn ] of the parent (root) time slab. Among the components with large time steps. we let (4. we determine the minimum time step ¯ (4.. 35 34 33 12 11 5 4 3 2 1 10 9 8 7 6 25 24 23 22 18 17 16 32 31 30 29 28 27 26 PSfrag replacements Tn−1 15 14 13 21 20 19 Tn Figure 6. For the components in the group I000 . At that point. i ∈ I01 . until the group of components with small time steps is empty. The size of the time slab is then adjusted according to ¯ (4.5) θK ¯ K K K = max ki . The original multi-adaptive algorithm presented in [8] is based on the principle (4. As before. and then constructing an element group containing one element for each of the components within the group I01 . as illustrated in Figure 4. Numbering of the elements in the order in which they are created. We illustrate the partition of components in Figure 5. the second time slab in the list of time slabs within the current parent time slab is constructed. and the remaining components for which ki ≥ θK are assigned to the group I01 of components with large time steps. . For the construction of each of these sub slabs. The partition of components into groups of small and large time steps for θ = 1/2. The time slab is then recursively created by ﬁrst constructing a list of sub slabs for the components contained in the group I 00 . i PSfrag replacements i ∈ I00 .e. ¯ i.4) The last component steps ﬁrst. The tree of time slabs is thus constructed recursively depth ﬁrst. T ).MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 11 12 JOHAN JANSSON AND ANDERS LOGG All components for which ki < θK are assigned to the group I00 of components with small time steps. and the remaining components for which ki ≥ θK are assigned to the group I001 of components with large time steps within I00 .3) Tn = min(Tn−1 + K. This property is automatically obtained through the depth ﬁrst nature of the new recursive algorithm. we continue recursively.

where r is the size of the residual for the current sub system and tol > 0 is a tolerance for the residual. where τij (t) = (t−tij )/(tij −ti. Similarly. and each element represents a set of degrees of freedom for a component U i (t) on a local interval Iij . On each level.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 13 14 JOHAN JANSSON AND ANDERS LOGG 4.8) r > tol.2.7). e |Rij | > tol. a time slab contains a number of element groups (counting also the element groups of the recursively contained time slabs).j−1 ) and {wmij }m=1 ⊂ P [qij −1] ([0. 2. The general algorithm for nested ﬁxed point iteration is given in Table 1. which each in turn consists of a set of sub systems. Since each element can also be viewed as a sub system for the element degrees of freedom. Nested ﬁxed point iteration. We present below an iterative strategy that takes advantage of this nested structure of sub systems. in combination with adaptive stabilization at the diﬀerent levels of iteration. . where each sub system consists of the degrees freedom of each element within the element group. In each iteration. The non-stiﬀ version of the iterative algorithm is speciﬁed as follows.1.2. Iij ij noting that wqij ≡ 1. which in turn are contained in the time slab (level 3). respectively. one for each element group. qij .7) F (x) = 0 for the degrees of freedom x of all elements of all element groups contained in the time slab. we choose condition 1 for the element iteration as (4. the system of equations on each element has a similar form. we may view the time slab as a set of coupled sub systems of the form (4. adaptive level 2 iteration. and to the iterations at the element group and time slab level as level 2 and level 3 iterations. the time slab can be viewed as a set of sub systems.1) is assumed to be non-stiﬀ. Nested ﬁxed point iteration on the time slab. On each time slab. Diﬀerent iterative strategies are used. the system of equations to be solved for the degrees of freedom {ξ m } on each element is of the form (4.11) e For the iteration on element group level.2. the problem (1. and adaptive level 3 iteration.2. For ﬁxed point iteration on a time slab. the nested structure of sub systems consist of elements (level 1) contained in element groups (level 2). U |Iij ). Alternatively. We may thus view the time slab as a large system of discrete equations of the form (4. As described in Section 4. For the mdG(q) method. Non-stiﬀ iteration. depending on the stiﬀness of the problem. e condition 3 for the iteration on time slab level is given by R ij l2 > tol. one for each element group within the time slab. 4. We refer to iterations at the element level as level 1 iterations. with the l2 norm taken over all elements in the element group.1. 4. ﬁxed point iteration is performed as long as a certain condition (1. as discussed in Section 3.9) ξ m = ξ0 + Iij ij for the mcG(q) method. This condition is typically of the form (4. 1]) are polynomial weight functions. [q ] m = 1. The basic principle of the nested ﬁxed point iteration is that each iteration on a given system consists of ﬁxed point iteration on each sub system. By diﬀerent choices of condition for the ﬁxed point iteration and for the type of adaptive damping on each level. We present below four diﬀerent versions of the iterative algorithm. diﬀerent overall iterative methods are obtained. condition 2 is given by R ij l2 > tol. we deﬁne the element residual Rij as wmij (τij (t))fi (U (t). . t) dt. e For each element (Iij .10) [q ] e Rij = ξqij − ξ0 − fi (U (t). The solver automatically detects which version of the algorithm to use. Adaptive ﬁxed point iteration on time slabs. adaptive level 1 iteration. or 3 ) holds. [q ] q (4. one for each element within the element group. t) dt. depending on the stiﬀness of the problem. . Unless otherwise speciﬁed by the user. . Iterate(time slab) while condition 3 do Update(time slab) end while Iterate(element group) while condition 2 do Update(element group) end while Iterate(element) while condition 1 do Update(element) end while Update(time slab) for each element group do Iterate(element group) end for Update(element group) for each element do Iterate(element) end for Update(element) for each degree of freedom do Update(degree of freedom) end for Table 1. the current system is updated and each update consists of successive ﬁxed point iteration on all sub systems. As discussed in [8]. Each element group contains a list of elements. For a given tolerance tol. . which we refer to as non-stiﬀ iteration. the system of discrete equations given by the mcG(q) or mdG(q) method is solved using adaptive ﬁxed point iteration.

Examples We illustrate the behavior of the multi-adaptive solver for a sequence of well-known stiﬀ test problems that appear in the ODE literature. which is similar to non-stiﬀ iteration except that the iterations at element level are stabilized. . as discussed above. Whenever stabilization is necessary. the update is of Gauss–Seidel type. and if the iteration at time slab level needs stabilization.e. We also perform the iteration at element group level using Gauss–Jacobi type iteration. the latest known values are used for all previously updated elements. ξm−1 are not used when computing the new value of ξm . Iij [q ] and that the damping factor α is determined at the element group level. tij )). the strategy is changed to adaptive level 2 iteration. the multi-adaptive Kn ← αKn . if the Jacobian of the right-hand side is diagonally dominant. As noted in [8]. Adaptive level 2 iteration. To a large extent. if the iterations at element group level do not converge. i. the system is stiﬀ and a diﬀerent iterative strategy is needed.4.12). we change strategy to adaptive level 1 iteration. if the iterations at time slab level do not converge. we modify the ﬁxed point iteration (4. The new choice of strategy is given by the iteration level at which stabilization is needed: If the iteration at element level needs stabilization. which includes the full set of test problems. Adaptive level 3 iteration.14) and let Kn be the maximum allowed size of the time slab for a sequence of m successive time slabs. This rich set of test problems presents a challenge for the multi-adaptive solver. 4. As before.5.. the damping factor α is determined by cumulative power iteration according to (3. the strategy is changed to adaptive level 3 iteration. As shown below. with damping factor α determined by (4. the convergence rate is measured and adaptive stabilization is performed as discussed in Section 3.e. In each iteration. corresponding to the diagonal damping discussed in Section 3. On the element level. we measure the rate of convergence. the number of stabilizing iterations is determined according to (3. the strategy is changed to adaptive level 2 iteration. In each iteration.13) and appropriate modiﬁcations for higher-order methods.13). Note that the limitation on the time step size might force diﬀerent components to use the same time steps during the stabilization.2.12) ξm ← (1 − α)ξm + α ξ0 + wmij (τij (t))fi (U (t).2. except that values are propagated forward in time between elements representing the same component. 5. and to adaptive level 3 iteration. the degrees of freedom are updated according to the ﬁxed point iteration (4. In all examples. 4. which is the case for many problems modeling chemical reactions. and adaptive stabilization performed as discussed in Section 3. the problems are identical with those presented earlier in [3]. the solver automatically and adaptively detects for each of the test problems which strategy to use and when to change strategy. If necessary.3.4. t) dt . we change strategy to adaptive level 2 iteration. except that condition 1 is modiﬁed so that exactly one iteration is performed on each element. we adjust the size of the time slab according to (4. and if the convergence rate is not acceptable (or if the residual diverges). .13). . Adaptive level 1 iteration. the new values ξ 1 . If the ﬁxed point iteration at element level does not converge.2. For the mdG(0) method. in particular if α is small. If the iteration at element group level needs stabilization. . Adaptive time step stabilization.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 15 16 JOHAN JANSSON AND ANDERS LOGG with the l2 norm taken over all elements in the time slab. On the element group level and time slab level.9).6. α = 1/(1 − kij ∂fi /∂ui (U (tij ). 4. In each iteration at all levels. meaning that the degrees of freedom {ξ m } are computed using previously computed values. The algorithm is similar to adaptive level 1 iteration. The nested ﬁxed point iteration continues as long as condition 3 is fulﬁlled.. . with the iteration at time slab level of Gauss–Seidel type. corresponding to the algorithm presented in [3] for the stabilization of explicit methods for stiﬀ problems.1. the maximum allowed size of the time slab is gradually increased by a factor two. The results were obtained using the standard implementation of the stabilized multi-adaptive solver available in DOLFIN [5] version 0. meaning that when an element is updated. If the ﬁxed point iteration at time slab level does not converge. since each of the test problems requires a slightly diﬀerent strategy as discussed in Section 4. 4.2. we change strategy to adaptive level 3 iteration. the convergence rate is measured. this type of iteration may be expected to perform well if the stiﬀness of the problem is of suﬃcient diagonal nature. the update is of Gauss– Jacobi type.9) according to (4. We now modify condition 1 and condition 2. The iteration is now of Gauss–Jacobi type on the entire time slab. i. If the adaptively stabilized ﬁxed point iteration fails to converge. If the ﬁxed point iteration at element group level does not converge.2. the strategy is changed to adaptive level 1 iteration. with the hope that the stiﬀness can be handled by the adaptively stabilized ﬁxed point iteration. the convergence rate is measured. where a stabilized mono-adaptive method was used to solve the problems. so that exactly one iteration is performed on each element and on each element group. In each iteration and for each element. After the sequence of m stabilizing time slabs.2. with m determined by (3.7.

01 seconds.4 0..4 10 0 t 0 0. ˙ u(0) = u0 . using a combination of adaptively stabilized ﬁxed point iteration on the time slab level (adaptive level 3 iteration). we present the (wall clock) time of simulation for each of the test problems. ˙ u(0) = u0 .8 U (t) 0.3) u(0) = u0 . t ∈ (0. using (diagonally) damped ﬁxed point iteration (adaptive level 1 iteration).2. The solution.8 for T = 10. T ]. The ﬁrst test problem is the scalar problem (5.6 0. for T = 10.05 t 0. For comparison.e. PSfrag replacements 10 −4 10 −4 0 2 4 t 6 8 10 0 2 4 t 6 8 x 10 10 −3 Figure 7. The next problem is the mass-springdashpot system (3. The test equation. 1000). ˙ (5. T ].38 seconds. 1.2) u(t) + Au(t) = 0.2 0 U (t) U (t) 0. obtained on a standard desktop computer (Intel Pentium 4.2 0 0 2 4 0. 1 0. which decays faster. and u0 = (1. unless otherwise stated.8 1 0.4 0.4 0. which is shown in Figure 8.6 0. corresponding to critical damping. 1). t ∈ (0. which is shown in Figure 7. λ = 1000.1 10 0 0.01 seconds. t ∈ (0. using diagonally damped . when the second component is out of the transient with the ﬁrst component still in its transient. The solution. The second test problem is the diagonal problem (5.3. the situation is the opposite with smaller time steps for the ﬁrst component. and stabilizing time steps. was computed in less than 0. Note that the second component. 1). The solution. The test system.2). which is shown in Figure 9.6 0. Solution and adaptive time step sequence for (5.2 k(t) t 6 8 10 0 2 4 t 6 8 x 10 10 −3 10 −2 k(t) 0 2 4 6 8 10 0 10 −2 10 0 10 0 PSfrag replacements 10 −4 10 −4 k(t) 10 −2 k(t) 10 −2 t 0 0. was computed in 0. 1 0. Solution and adaptive time step sequence for (5.1.1 Figure 8. u(t) + Au(t) = 0. for T = 1. T ].2 0 0 2 4 U (t) 6 8 10 0.05 t 0. with 0 −1 104 200 and u0 = (1.1) u(t) + λu(t) = 0. (individual for each component) ﬁxed point iteration (adaptive level 1 iteration).8 1 0. initially uses smaller time steps than the ﬁrst component. and u0 = 1.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 17 18 JOHAN JANSSON AND ANDERS LOGG dG(0) method was used. A= 5. Later. 5. A non-normal test problem.14) with κ = 104 . i.1). was computed in 0.6 0. 5. A = diag(100.6 GHz) running Debian GNU/Linux.

˙ u5 = r2 − r3 + r5 .3 · (0.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 19 20 1 0. 8.42 · u2 √u .75u2 .8 0 −5 0 −5 U (t) U (t) U (t) −15 −20 −25 −30 −35 0 0.6 0. 0. ˙ on [0. which is shown in Figure 10.03u3 + 0.00123. Solution and adaptive time step sequence for (5. 0. 0.8 1 10 −6 10 −4 10 −4 t t 0 1 2 t 3 4 5 Figure 9. The HIRES problem. Solution and adaptive time step sequence for (5. The problem consists of the following eight equations: u1 ˙ u2 ˙ u3 ˙ u4 ˙ ˙ u5 u6 ˙ u7 ˙ u ˙8 = = = = = = = = −1.71u3 − 1.5 forces all components to use the same time steps. −280.14 seconds. The HIRES problem (“High Irradiance RESponse”) originates from plant physiology and is taken from a test set of initial value problems [11] for ODE solvers.4.43u6 + 0. 0. −280.9/737 − u 2 ) and the reaction rates are √ given by r1 = 18.1 t 0 1 2 t 3 4 5 10 0 10 0 10 0 10 0 k(t) k(t) k(t) 10 −2 k(t) 0 100 200 300 10 −2 10 −2 10 −2 PSfrag replacements 10 −4 10 −4 PSfrag replacements 0 0.8 1 0 0.0007. −10.5r1 − r4 − 0.4 · u1 u5 .2 0 t 0.6 0. 0.0057).444.6 0. 0.0u6 u8 + 1.43u6 + 0. ˙ u2 = −0.2 0 U (t) 0 100 200 300 −10 −10 0. 5. −1. 0. ˙ u3 = r1 − r2 + r3 .5r5 + F. ˙ (5. 280.5.0u6 u8 − 1.4).71u5 − 0.81u7 . 0. which is shown in Figure 11. 0.4 0.43u4 + 0. on [0. 180].5) u4 = −r2 + r3 − 2r4 . r3 = 0. 321. The initial condition is given by u = 0.05 0.6 0.0. The solution.4 t 0. Note that for this particular problem. (5.3). r4 = 1 2 . 1. was computed in 0.69u4 + 1. 0.43u7 .007.58/34.4 0. The Akzo-Nobel problem. where F = 3. . and stabilizing time steps.2 0. r2 = 0. We next solve the “Chemical Akzo-Nobel” problem taken from the test set [11].2 0.8122] with initial condition u 0 = (1. was computed in 0. ˙ u 6 = K s u1 u4 − u 6 .58 · u3 u4 .745u5 + 0. The solution.4) 5.71u1 + 0.32u2 + 1.0u6 u8 + 0.71u1 − 8.05 t 0. using diagonally damped ﬁxed point iteration (adaptive level 1 iteration). consisting of the following six equations: u1 = −2r1 + r2 − r3 − r4 .69u7 .035u5 .81u7 .4 −15 −20 −25 −30 −35 0. 0.36).43u2 + 8.7 · u4 u2 . and r = 0. Figure 10.32u3 + 0.32 seconds.8 JOHAN JANSSON AND ANDERS LOGG 1 0.12u4 .1 10 −6 0 0.09 · u1 u4 5 2 0 6 (0. the partitioning threshold with a default value of θ = 0. using a combination of adaptively stabilized ﬁxed point iteration on the time slab level (adaptive level 3 iteration). 0.

5 0. This problem . 0) = 0. 1]. t) = f (x) as an approximation of the Dirac delta function at x = 0.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V −4 21 22 15 10 JOHAN JANSSON AND ANDERS LOGG 15 10 0.6) u1 = u2 . The heat equation. Solution and adaptive time step sequence for (5. 1). t) = f (x.4 10 −1 10 −1 10 −5 PSfrag replacements PSfrag replacements 10 −2 0. 5. ˙ u(0. t>0 x ∈ (0.89 seconds. u(x.3 0.8 10 0 10 0 k(t) k(t) 0 20 40 60 80 100 k(t) k(t) 0. The next problem originating from 1966 (Robertson) is taken from Hairer and Wanner [4]. was computed with a partitioning threshold θ = 0. t). we obtain the ODE (5. With a spatial resolution of h = 0. which is shown in Figure 13. t) = 0. 100] with initial condition u0 = (2. The solution. We take µ = 10 and compute the solution on the interval [0. ˙ u2 = −µ(u2 − 1)u2 − u1 .5).7) u(t) + Au(t) = f. was computed in 1.6 0.6). The solution. 4 · 104 ].5. ¨ which we write in the form (5. 5.99 seconds. using a combination of adaptively stabilized ﬁxed point iteration on the time slab level (adaptive level 3 iteration) and stabilizing time steps.4 10 8 x 10 U (t) U (t) 0. A stiﬀ problem discussed in the book by Hairer and Wanner [4] is Van der Pol’s equation. where A is the stiﬀness matrix (including lumping of the mass matrix). using a combination of adaptively stabilized ﬁxed point iteration on the time slab level (adaptive level 3 iteration) and stabilizing time steps. Solution and adaptive time step sequence for (5. 5. t) − u (x. A special stiﬀ problem is the one-dimensional heat equation. ˙ 1 u(x. Figure 11.6. x ∈ [0. t) = u(1. 0). where we choose f (x.7. the eigenvalues of A are distributed in the interval [0.2 10 −10 10 0 50 −2 0 t 100 150 0 1 2 t 3 4 5 t 38 40 42 t 44 46 48 Figure 12. Van der Pol’s equation.01.1 0 0 50 6 4 2 0 U (t) 0 −5 −10 −15 0 20 40 60 80 100 U (t) 5 5 0 −5 −10 −15 38 40 42 44 46 48 t 100 150 0 1 2 t 3 4 5 0 t t 10 1 0.2 0.1 in 2. of the mdG(0) solution are large. Note how the time steps are drastically reduced at the points where the derivatives. t > 0. which is shown in Figure 12. ˙ u + µ(u2 − 1)u + u = 0. and thus also the residuals. ˙ u(0) = 0. A chemical reaction test problem. Discretizing in space.8.

99 0 −3 x 10 0. 0).3 0. using diagonally damped ﬁxed point iteration (adaptive level 1 iteration).7 0. which is shown in Figure 14. 30].1 0.2 0.4 0.01 seconds.9) B + C (very fast) A+C (fast) −→ problem of the form −0. A mixed stiﬀ/non-stiﬀ test problem.5. We take λ = 1000 and compute the solution on [0.6 0.1 0. u2 = −(1 − u3 )u1 .1 0. With a partitioning threshold of default size θ = 0.2 0. 1).05 0 0 0.1).8) u3 = ˙ 0.2 0. 2 We compute the solution on the interval [0. Solution and adaptive time step sequence for (5.7 0.04u1 + 104 u2 u3 . models the following system of chemical reactions: A B+B B+C which gives an initial value ˙ u1 = u2 = ˙ (5.2 0. we solve the simple system .8 0.3 t 0.3 0.06 seconds. we recognize as the combination of a 1 2 harmonic oscillator (the ﬁrst and second components) and the simple scalar test problem (5. which. 2 3 · 107 u2 .15 t 0. which is shown in Figure 16. As an illustration.3 U3 (t) 0.9 1 0 0 0.MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V 0.4 0. As a ﬁnal test problem. −→ −→ 104 B (slow) (5.9.04 3·107 Figure 14.3 t 10 0 10 0 k(t) 10 PSfrag replacements 10 −4 k(t) −2 10 −1 PSfrag replacements 10 −2 0 0.9 1 10 −3 0 0. ˙ u3 = −λ(u2 + u2 )u3 .6 0. The solution. we notice that the time steps for the stiﬀ third component are sometimes decreased.5 t 0.05 0. 30] with initial condition u0 = (0. ˙ u1 = u2 .5 10 5 t 0. we use the mcG(1) method for the ﬁrst two non-stiﬀ components and the mdG(0) method for the third stiﬀ component.1 3 t 0. 0.2 0.995 0. where we plot the sequence of time slabs on the interval [10.25 23 24 JOHAN JANSSON AND ANDERS LOGG −5 U1 (t) 1 4 x 10 U (t) 0. 1. Solution and adaptive time step sequence for (5. 0. 0.2 0.1 0. was computed in 0. ˙ 1 2 5. This is also evident in Figure 15.3 0.15 0.7).8 0.3 Figure 13.04u1 − 104 u2 u3 − 3 · 107 u2 .8).25 0. since u3 ≈ 0 and u2 + u2 ≈ 1. whenever ki > θk3 for i = 1 or i = 2.2 0.3] with u 0 = (1. using diagonally damped ﬁxed point iteration (adaptive level 1 iteration).1 U2 (t) 2 1 0 0 0. was computed in 0.1 0. The solution.

MULTI-ADAPTIVE GALERKIN METHODS FOR ODES V

25

26

JOHAN JANSSON AND ANDERS LOGG

References PSfrag replacements t i=1 i=2 i=3 Figure 15. The structure of the time slabs on the interval [10, 30] for the solution of (5.9).

1 1

0.5

0.5

0

0

−0.5

−0.5

−1 0 10

−1

t

20

30

0

0.1

t

0.2

0.3

[1] G. Dahlquist, Stability and Error Bounds in the Numerical Integration of Ordinary Diﬀerential Equations, PhD thesis, Stockholm University, 1958. [2] T. Dupont, J. Hoffman, C. Johnson, R.C. Kirby, M.G. Larson, A. Logg, and L.R. Scott, The FEniCS project, Tech. Rep. 2003–21, Chalmers Finite Element Center Preprint Series, 2003. [3] K. Eriksson, C. Johnson, and A. Logg, Explicit time-stepping for stiﬀ ODEs, SIAM J. Sci. Comput., 25 (2003), pp. 1142–1157. [4] E. Hairer and G. Wanner, Solving Ordinary Diﬀerential Equations II — Stiﬀ and Diﬀerential-Algebraic Problems, Springer Series in Computational Mathematics, vol 14, 1991. [5] J. Hoffman and A. Logg et al., DOLFIN, http://www.phi.chalmers.se/dolﬁn/. [6] J. Jansson and A. Logg, Algorithms for multi-adaptive time-stepping, submitted to ACM Trans. Math. Softw., (2004). [7] A. Logg, Multi-adaptive Galerkin methods for ODEs I, SIAM J. Sci. Comput., 24 (2003), pp. 1879–1902. , Multi-adaptive Galerkin methods for ODEs II: Implementation and applica[8] tions, SIAM J. Sci. Comput., 25 (2003), pp. 1119–1141. [9] , Multi-adaptive Galerkin methods for ODEs III: Existence and stability, Submitted to SIAM J. Numer. Anal., (2004). , Multi-adaptive Galerkin methods for ODEs IV: A priori error estimates, Sub[10] mitted to SIAM J. Numer. Anal., (2004). [11] F. Mazzia and F. Iavernaro, Test set for initial value problem solvers, release 2.2, Department of Mathematics, University of Bari, Report 40/2003, (2003).

U (t)

1 0.8

k(t)

0.6 0.4

PSfrag replacements

0.2 0 0 5 10 15

U (t)

t

20

25

30

Figure 16. Solution and adaptive time step sequence for (5.9).

SIAM J. SCI. COMPUT. Vol. 25, No. 4, pp. 1142–1157

c 2003 Society for Industrial and Applied Mathematics

EXPLICIT TIME-STEPPING FOR STIFF ODES

1143

**EXPLICIT TIME-STEPPING FOR STIFF ODES∗
**

KENNETH ERIKSSON† , CLAES JOHNSON† , AND ANDERS LOGG† Abstract. We present a new strategy for solving stiﬀ ODEs with explicit methods. By adaptively taking a small number of stabilizing small explicit time steps when necessary, a stiﬀ ODE system can be stabilized enough to allow for time steps much larger than what is indicated by classical stability analysis. For many stiﬀ problems the cost of the stabilizing small time steps is small, so the improvement is large. We illustrate the technique on a number of well-known stiﬀ test problems. Key words. stiﬀ ODE, explicit methods, explicit Euler, Galerkin methods AMS subject classiﬁcations. 65L05, 65L07, 65L20, 65L50, 65L60, 65L70, 65M12 DOI. 10.1137/S1064827502409626

ODE-solvers based on Galerkin’s method with continuous or discontinuous polynomials of degree q, where individual time steps are used for diﬀerent components (see [8, 9]). These methods are implicit, and, to realize eﬃcient implementations, we need to use ﬁxed point iteration with simple preconditioners. With a limited (small) number of iterations, these iterative solvers correspond to explicit time-stepping, and the same question of the cost of stabilization arises. The motivation for this work comes also from situations where for some reason we are forced to using an explicit method, such as in simulations of very large systems of chemical reactions or molecular dynamics, where the formation of Jacobians and the solution of the linear system become very expensive. Possibly, similar techniques may be used also to stabilize multigrid smoothers. 2. Basic strategy. We consider ﬁrst the test equation: Find u : [0, ∞) → R such that (2.1) u(t) + λu(t) = 0 ˙ u(0) = u0 , for t > 0,

1. Introduction. The classical wisdom developed in the 1950s regarding stiﬀ ODEs is that eﬃcient integration requires implicit (A-stable) methods, at least outside of transients, where the time steps may be chosen large from an accuracy point of view. Using an explicit method (with a bounded stability region) the time steps have to be small at all times for stability reasons, and thus the advantage of a low cost per time step may be counterbalanced by the necessity of taking a large number of steps. As a result, the overall eﬃciency of an explicit method for a stiﬀ ODE may be small. The question now is if it is possible to combine the low cost per time step of an explicit method with the possibility of choosing large time steps outside of transients. To reach this favorable combination, some kind of stabilization of the explicit method seems to be needed, and the basic question is then if the stabilization can be realized at a low cost. The stabilization technique proposed in this note relies on the inherent property of the stiﬀ problem itself, which is the rapid damping of high frequencies. This is achieved by stabilizing the system with a couple of small stabilizing (explicit Euler) steps. We test this idea in adaptive form, where the size and number of the small time steps are adaptively chosen according to the size of diﬀerent residuals. In particular, we compute rates of divergence to determine the current mode λ of largest ampliﬁcation 1 and to determine a corresponding small time step k ≈ λ with high damping. We test the corresponding adaptive method in the setting of the cG(1) method with ﬁxed point iteration, eﬀectively corresponding to an explicit method if the number of iterations is kept small. We show in a sequence of test problems that the proposed adaptive method yields a signiﬁcant reduction in work in comparison to a standard implementation of an explicit method, with a typical speedup factor of ∼ 100. We conclude that, for many stiﬀ problems, we may eﬃciently use an explicit method, if only the explicit method is adaptively stabilized with a relatively small number of small time steps, and so we reach the desired combination of a low cost per time step and the possibility of taking large time steps outside transients. It remains to be seen if the proposed method can also be eﬃcient in comparison to implicit methods. We have been led to this question in our work on multi-adaptive cG(q) or dG(q)

by the editors June 14, 2002; accepted for publication (in revised form) June 2, 2003; published electronically December 5, 2003. http://www.siam.org/journals/sisc/25-4/40962.html † Department of Computational Mathematics, Chalmers University of Technology, SE–412 96 G¨teborg, Sweden (kenneth@math.chalmers.se, claes@math.chalmers.se, logg@math.chalmers.se). o 1142

∗ Received

where λ > 0 and u0 is a given initial condition. The solution is given by u(t) = exp(−λt)u0 . We deﬁne the transient as {t > 0 : λt ≤ C} with C a moderate constant. Outside the transient, u(t) = exp(−λt)u0 will be small. The explicit Euler method for the test equation reads U n = −kn λU n−1 + U n−1 = (1 − kn λ)U n−1 . This method is conditionally stable and requires that kn λ ≤ 2, which, outside of transients, is too restrictive for large λ. Now let K be a large time step satisfying Kλ > 2 and let k be a small time step chosen so that kλ < 2. Consider the method (2.2) U n = (1 − kλ)m (1 − Kλ)U n−1 ,

corresponding to one explicit Euler step with large time step K and m explicit Euler steps with small time steps k, where m is a positive integer to be determined. Altogether this corresponds to a time step of size kn = K + mk. Deﬁning the polynomial k function P (x) = (1 − θx)m (1 − x), where θ = K , we can write method (2.2) in the form U n = P (Kλ)U n−1 . We now seek to choose m so that |P (Kλ)| ≤ 1, which is needed for stability. We thus need to satisfy |1 − kλ|m (Kλ − 1) ≤ 1, that is, (2.3) m≥ log(Kλ) log(Kλ − 1) ≈ , − log |1 − kλ| c

with c = kλ a moderate constant; for deﬁniteness, let c = 1/2.

1144

KENNETH ERIKSSON, CLAES JOHNSSON, AND ANDERS LOGG

EXPLICIT TIME-STEPPING FOR STIFF ODES

1145

We conclude that m will be of moderate size, and consequently only a small fraction of the total time interval will be spent on time-stepping with the small time step k. To see this, deﬁne the cost as 1+m α= ∈ (1/K, 1/k), K + km that is, the number of time steps per unit time interval. Classical stability analysis with m = 0 gives (2.4) α = 1/kn = λ/2,

3.1. Chebyshev damping. A good candidate for P is given by the shifted Chebyshev polynomial of degree m, Pc (x) = Tm 1 − 2x KλN .

This gives Pc (0) = 1 and |Pc (x)| ≤ 1 on [0, KλN ] (see Figure 1). A similar approach is taken in [11]. Analyzing the cost as before, we have α = m/(k1 + · · · + km ), with ki = 2/(λN (1 − sm+1−i )), and si the ith zero of the Chebyshev polynomial Tm = Tm (s), given by si = cos((2i − 1)π/(2m)), i = 1, . . . , m. It follows that α= mλN /2 mλN /2 = = λN /2m. 1/(1 − s1 ) + · · · + 1/(1 − sm ) m2

with a maximum time step kn = K = 2/λ. Using (2.3) we instead ﬁnd (2.5) for Kλ α≈ 1 + log(Kλ)/c λ ≈ log(Kλ)/(Kλ) K + log(Kλ)/λ c λ/c

1. The cost is thus decreased by the cost reduction factor 2 log(Kλ) log(Kλ) , ∼ cKλ Kλ

which can be quite signiﬁcant for large values of Kλ. A similar analysis applies to the system u + Au = 0 if the eigenvalues {λi }N of ˙ i=1 λi ≤ · · · ≤ λN . In this A are separated with 0 ≤ λ1 ≤ · · · ≤ λi−1 ≤ 2/K and 2/K case, the cost is decreased by a factor of (2.6) 2 log(Kλi ) log(Kλi ) ∼ . cKλi Kλi

2 2 ≈ = 16m2 /(λN π 2 ) λN (1 − cos(π/(2m))) λN π 2 /(8m2 ) √ for m 1. With m = (π/4) KλN , the cost reduction factor for Chebyshev damping is thus given by K≥ 1/m = 4 √ ∼ (KλN )−1/2 . π KλN

The reduction in cost compared to λN /2 is thus a factor 1/m. A restriction on the maximum value of m is given by km = 2/(λN (1 − s1 )) ≤ K; that is,

In recent independent work by Gear and Kevrekidis [2], a similar idea of combining small and large time steps for a class of stiﬀ problems with a clear separation of slow and fast time scales is developed. That work, however, is not focused on adaptivity to the same extent as ours, which does not require any a priori information about the nature of the stiﬀness (for example, the distribution of eigenvalues). 3. Parabolic problems. For a parabolic system, (3.1) u(t) + Au(t) = 0 for t > 0, ˙ u(0) = u0 ,

3.2. Dyadic damping. Another approach is a modiﬁed version of the simple approach of small and large time steps discussed in the previous section. As discussed above, the problem with this basic method is that the damping is ineﬃcient for intermediate eigenmodes. To solve this problem, we modify the simple method of large and small time steps to include also time steps of intermediate size. A related approach is taken in [3]. Starting with a couple of small time steps of size k, we thus increase the time step gradually by (say) a factor of 2, until we reach the largest step size K. Correspondingly, we decrease the number of time steps at each level by a factor of 2. The polynomial P is now given by

p

with A a symmetric positive semideﬁnite N × N matrix and u0 ∈ RN a given initial condition, the basic damping strategy outlined in the previous section may fail to 2, be eﬃcient. This can be seen directly from (2.6); for eﬃciency we need Kλi but with the eigenvalues of A distributed over the interval [0, λN ], for example with λi ∼ i2 as for a typical (one-dimensional) parabolic problem, one cannot have both 2! λi−1 ≤ 2/K and Kλi We conclude that, for a parabolic problem, the sequence of time steps, or equivalently the polynomial P (x), has to be chosen diﬀerently. We thus seek a more general sequence k1 , . . . , km of time steps such that |P (x)| ≤ 1 for x ∈ [0, KλN ], with P (x) = 1− k1 x K ··· 1 − km x K

Pd (x) =

j=q+1

1−

2j x KλN

q

i=0

1−

2i x KλN

2q−i

,

where p and q ≤ p are two integers to be determined. We thus obtain a sequence of increasing time steps, starting with 2q time steps of size k = 1/λN , 2q−1 time steps of size 2k, and so on, until we reach level q where we take one time step of size 2q k. We then continue to increase the size of the time step, with only one time step at each level, until we reach a time step of size 2p k = K. With p given, we determine the minimal value of q for |Pd (x)| ≤ 1 on [0, KλN ] for p = 0, 1, . . . , and ﬁnd q(p) ≈ 2 (p − 1); see Table 1. The cost is now given by 3 α= ≈

1 λN

and K a given maximum step size.

λN /2 λN −p+2(p−1)/3+1 λN −(p−1)/3 2 2 ≈ = . 2p−q−1 2 2

λN ((2q+1 − 1) + (p − q)) (2q + · · · + 1) + (p − q) = q 2 (q + 1) + (2p+1 − 2q+1 ) (2q (q + 1) + (2q+1 + · · · + 2p ))

as is needed . CLAES JOHNSSON.3 and 8. In the case of a parabolic problem. with m = 5 for the shifted Chebyshev polynomial Pc (z) (left) and (p. We summarize our ﬁndings so far as follows. where ¯ K ≤ K is the maximum time step in the sequence. ¯ ¯ for θi = 2i /(2q (q + 1) + 2p+1 − 2q+1 ). With KλN = 64. Chebyshev damping and dyadic damping. we must have a clear separation into small (stable) eigenvalues and large (unstable) eigenvalues. the reduction in cost for dyadic damping is then a factor 1 ∼ (KλN )−1/3 . The reduction in cost for the simple approach of large unstable time steps followed by small stabilizing time steps (outlined in section 2) is a factor log(KλN )/(KλN ). Note that we take z = −Kλ. respectively. as a function of the total number of levels. without a gap in the eigenvalue spectrum. (KλN /2)1/3 which is competitive with the optimal cost reduction of Chebyshev damping. the costs are 5. which gives the same number of time steps (m = 2q+1 − 1 + p − q = 5) for the two methods. (4. The eﬃciency for a parabolic problem is thus comparable for the two methods. the simple approach of section 2 will not work. 1) for the dyadic polynomial Pd (z) (right). 5 -1 0 10 20 30 40 50 60 1 0. 2. q. q) = (6. we see that Chebyshev damping can be slightly more eﬃcient than dyadic damping. With K = 1. In this case. 1. As a comparison. However. and from Table 1. where K = k1 + · · · + km is the sum of all time steps in the sequence. 1) for the dyadic damping polynomial. In this context.5 Pd (x) PSfrag replacements 0 -0. A comparison of stability regions for the two polynomials. q) = (3. p.1) Pc (z) = i=1 1+ z/m2 1 − si PSfrag replacements Pd (x) x for si = cos((2i − 1)π/(2m)) and p q Pc (x) (1 + θi z) 2q−1 (4. we have p = log(KλN )/ log(2) = 6. For the dyadic damping polynomial. we √ obtain m = (π/4) KλN ≈ 6 for the Chebyshev polynomial. we take m = 5 for the Chebyshev polynomial and (p. Pc (x) p q 0 0 1 0 2 0 3 1 4 2 5 3 6 3 7 4 8 4 9 5 10 6 11 7 12 8 13 8 14 9 15 10 16 10 0. 3) for the dyadic polynomial Pd (x). Chebyshev damping and dyadic damping give a reduction in cost which is a factor (KλN )−1/2 or (KλN )−1/3 . 4. From Figures 1 and 2. rather than z = −Kλ. we plot in Figure 2 the stability regions for the two polynomials Pc (z) and Pd (z) for z ∈ C. As another comparison. AND ANDERS LOGG 1 EXPLICIT TIME-STEPPING FOR STIFF ODES 1147 Table 1 Number of required levels with multiple zeros. with dyadic damping we don’t need to assume that the eigenvalues of A in (3. Comparison of methods.1146 KENNETH ERIKSSON. we believe this method to be advantageous over the Chebyshev method. q) = (3. we obtain q = 3. This however requires that the problem in question has a gap in its eigenvalue spectrum. Since the dyadic damping method is a slightly modiﬁed version of the simple approach of section 2. A comparison of the two polynomials for KλN = 64: we take m = 6 for the shifted Chebyshev polynomial Pc (x) and (p.1) lie in a narrow strip along the negative real axis in the complex plane. To make the comparison fair. we plot in Figure 1 the shifted Chebyshev polynomial Pc (x) and the polynomial Pd (x) of dyadic damping for KλN = 64. respectively. that is. 5 -1 0 10 20 30 x 40 50 60 Fig.2) Pd (z) = j=q+1 (1 + θj z) i=0 Fig. the two polynomials are given by m -0.5 0 Since p = log(KλN )/ log(2). and thus this simple approach can be much more eﬃcient than both of the two approaches. discussed in the previous section. thus being simple and ﬂexible. consisting of gradually and carefully increasing the time step size after stabilization with the smallest time step. the cost is smaller for a given value of KλN (Figure 1) and the stability interval on the negative real axis is larger (Figure 2).

we measure the size of the discrete residual. in particular the eigenvalue of the current unstable eigenmode. with an extension to parabolic problems as described in section 3. that is. . tn ) for n = 2. CLAES JOHNSSON. where the function U = U (t) is piecewise constant and right-continuous with U n = U (t+ ). We consider now the general nonlinear problem. From another viewpoint. we have rnl = 1 (U nl − U n−1 ) − f kn U n−1 + U n.3) un = un−1 + tn f (u(t)) dt. A simple adaptive algorithm for the standard cG(1) method with iterative solution of the discrete equations reads as follows. we use individual time steps for diﬀerent components. tn ) using ﬁxed point iteration.2) U n = U n−1 + kn f (U n−1 ). kn n. [0. For the test equation. An adaptive algorithm. until convergence occurs with U n.3). Iterative methods.) 5. . U nl = U n−1 + kn f U n−1 + U n. see [11]. (c) Solve the discrete equations on (tn−1 .0 = U n−1 .T ] [0. We approach this question in the setting of an implicit method combined with an explicit-type iterative solver as in section 6. 1. 2. We continue the iterations until the discrete residual is smaller than some tolerance tol > 0. Repeat on (tn−1 .2) and (5. This will be explored further in another note.l−1 Jr . . The simple strategy to take small damping steps to stabilize the system applies also in the multi-adaptive setting.l−1 − U n−1 − kn f 2 U n−1 + U n. In a multi-adaptive solver.1).1) U n = U n−1 + kn f U n−1 + U n 2 . We conclude that the eﬃciency of the proposed method for the general nonlinear problem will be determined by the distribution of the eigenvalues of the Jacobian. ˙ u(0) = u0 . The implicit cG(1) method with midpoint quadrature for the general nonlinear problem (5. 8. 9] is the iterative ﬁxed point solution of the discrete equations on time slabs. rnl = 1 (U nl − U n−1 ) − f kn U n−1 + U nl 2 . (The stability region of the Chebyshev polynomial can be slightly modiﬁed to include a narrow strip along the negative real axis.l−1 2 .1148 KENNETH ERIKSSON.l−1 2 J(U (t) − u(t)) dt = (6. and solve the discrete equations for the solution U (t) on (t0 . The explicit Euler method for (5. tn−1 =f = which gives Je dt. which can be used in an adaptive algorithm targeted precisely at stabilizing the current unstable eigenmode. we have e(T ) ≤ S(T ) max k R + S 0 (T ) max r . 7. Usually only a couple of iterations are needed. we obtain information about the stiﬀ nature of the problem. We give the algorithm in the case of the simple damping strategy outlined in section 2. where we may also target individual eigenmodes (if these are represented by diﬀerent components) using individual damping steps. (b) Determine the new time step kn based on Rn−1 .T ] where f : RN × (0. ˙ where R(t) = U (t) − f (U (t)) is the continuous residual and S(T ) and S 0 (T ) are stability factors. so the stability condition for a standard explicit method appears also in explicit-type iterative methods as a condition for convergence of the iterative solution of the implicit equations. Multi-adaptive solvers. The question is now whether we can choose the time step sequence automatically in an adaptive algorithm. The ﬁxed point iteration converges for a small enough time step kn . we have S(T ) ≤ 1 and S 0 (T ) ≤ 1/λ. We can solve this system of nonlinear equations for U n using Newton’s method. 3.1) reads (5.l−1 − U nl 2 . 2 Thus. We discuss this in more detail below in section 8. For the discrete residual. until tn ≥ T : (a) Evaluate the continuous residual Rn−1 from the previous time interval. Subtracting (5. Determine a suitable initial time step k1 . Estimating the error e(T ) = U (T ) − u(T ) at ﬁnal time T (see [8]). . An important part of the algorithm described in [8. 6. (5. The general nonlinear problem.l−1 2 U n−1 + U nl 2 −f U n−1 + U nl 2 =J U n. . we ﬁnd that the error e(t) = U (t) − u(t) satisﬁes e(t+ ) − e(t+ ) = n n−1 ∂f ∂u tn tn−1 tn 1 J U n. but the simplest and cheapest method is to apply ﬁxed point iteration directly to (6. . t1 ). n (5. which should be zero for the true cG(1) approximation.1) u(t) = f (u(t)) for t > 0.2) rnl = where J is the Jacobian of the right-hand side evaluated at a mean value of U and u. To determine a stop criterion for the ﬁxed point iteration. which suggests that for a typical stiﬀ problem we can take tol = TOL. 2. T ] → RN is a given bounded and diﬀerentiable function. by measuring the size of the discrete residual. we may consider using an explicit-type iterative method for solving the discrete equations arising from an implicit method. The exact solution u satisﬁes a similar relation. where TOL is a tolerance for the error e(T ) at ﬁnal time. for l = 1. tn−1 with un = u(tn ). AND ANDERS LOGG EXPLICIT TIME-STEPPING FOR STIFF ODES 1149 with Chebyshev damping. .1) reads (6.

10]. for t > 0. where we choose u0 = 1 and λ = 1000.6 0. We also note that. An implementation of this algorithm in the form of a simple MATLAB code is available for inspection [7]. We try this code on a number of well-known stiﬀ problems taken from the ODE literature and conclude that we are able to handle stiﬀ problems with this explicit code. For a parabolic problem. by (8. see [4. we take a simple standard implementation of the cG(1)-method (with an explicit ﬁxed point solution of the discrete equations) and add a couple of lines to handle the stabilization of stiﬀ problems. Solution and time step sequence for (9.2 0 0 2 4 U (t) 6 8 10 0. (d) If 2(c) did not work. we had c = 1/2. 1.1150 KENNETH ERIKSSON. following the sequence of small stabilizing time steps. we have kn ≤ 2kn−1 . with the diﬀerence being that most of the damping is made with the smallest time step. The cost is only α ≈ 6 and the cost reduction factor is α/α0 ≈ 1/310. 9. t1 ). we take A = diag(100. Note how the time steps are drastically decreased (step 2(d) in the adaptive algorithm) when the system needs to be stabilized and then gradually increased until stabilization again is needed.1). tn ) for n = 2. 10]. . The full algorithm is thus slightly more elaborate. until tn ≥ T : (a) Evaluate the continuous residual Rn−1 from the previous time interval. and so on. as determined by Table 1. compute stability factors (or weights). The ﬁrst problem we try is the test equation. Determine a suitable initial time step k1 . . We comment also on step 2(b): For the cG(1) method we would like to take kn = TOL/(S(T ) Rn−1 ). Repeat on (tn−1 . 3. kn rl−1 k(t) 10 -2 PSfrag replacements 0 1 2 3 4 5 6 7 8 9 10 t Fig. and possibly repeat the process until the error is below a given tolerance TOL > 0. the simple step size selection has to be combined with a regulator of some kind. There are now two eigenmodes with large eigenvalues that need to be damped out. To illustrate the technique. 1). CLAES JOHNSSON. This is compared to the cost α0 for the standard cG(1) method in which we are forced to take small time steps all the time. doubling the time step until we reach kn ∼ K or the system becomes unstable again.1. tn ) using ﬁxed point iteration.4 0.1) ˜ 2kn kn−1 . To avoid this. (9. The dominant eigenvalue of A is . 10] or [9].1) u(t) + λu(t) = 0 ˙ u(0) = u0 . which means we also have to solve the dual problem. A small residual gives a large time step which results in a large residual. (b) Determine the new time step kn based on Rn−1 . what may go wrong is step 2(c). The test equation. kn = ˜ kn + kn−1 1 0. including among others the test problems presented in the next section. (e) Try again starting at 2(a) with n → n + m. the time step sequence is automatically chosen in agreement with the previous discussion. compute L= rl 2 . on [0. whichever comes ﬁrst. we report both the cost α and the cost reduction factor α/α0 . evaluate an a posteriori error estimate. this also includes the number of ﬁxed point iterations needed to compute the cG(1) solution on intervals where the iterations converge. if the time step kn is too large.) For all example problems below.2) u(t) + Au(t) = 0 ˙ u(0) = u0 . but the basic algorithm presented here is the central part. When referring to the cost α below. the size of the time step will be increased gradually. 9. It turns out that a simple strategy that works well in many situations is to take kn as the geometric mean value (8. 3.2. Now. and solve the discrete equations for the solution U (t) on (t0 . 2. on [0. we modify the algorithm to increase the time step more carefully. AND ANDERS LOGG EXPLICIT TIME-STEPPING FOR STIFF ODES 1151 In reality we want to control the global error. As is evident from Figure 3. The test system.1).6 0.2 0 t 0 2 4 t 6 8 x 10 10 -3 10 0 ˜ where kn = TOL/(S(T ) Rn−1 ). (These small time steps are marked by dashed lines. we propose the following simple modiﬁcation of the adaptive algorithm. for t > 0. 1000) and u0 = (1. (c) Solve the discrete equations on (tn−1 . .8 U (t) 0. See [1] for a discussion. This automatically gives a sequence of time steps similar to that of dyadic damping described in section 3. the ﬁxed point iterations will not converge. For the test system.4 0. (9.8 1 0. In the analysis of section 2. Examples. To be able to handle stiﬀ problems using the technique discussed above. for a stiﬀ problem. α/α0 ≈ 1/310. but it is clear that the damping steps will be more eﬃcient if we have c close to 1. 9. and take m = log(kn L) explicit Euler steps with time step k = c/L and c close to 1. with p given by p = log(kn L)/ log(2). so. but this introduces oscillations in the size of the time step.

which gives a cost reduction factor of α/α0 ≈ 1/104.3) on [0. We now solve (9. r2 = 1 √ 0. α/α0 ≈ 1/104. ˙ ˙ u2 = −0.4 · u1 u5 .8122] (as speciﬁed in [6]) and present the solution and the time step sequence in Figure 6.2 0 U (t) 4 U (t) 0 2 4 6 8 10 6 6 4 2 2 0 0 t 6 8 10 0 t 0. Solution and time step sequence for (9.09 · u1 u2 .04 0.0007. α ≈ 17. together with the initial condition u0 = (1.71u1 + 0. and r5 = 0.4. We integrate over [0.8 KENNETH ERIKSSON. 0. The method behaves similarly even if we make the matrix A highly nonnormal. ˙ u 5 = r2 − r 3 + r 5 .0u6 u8 − 1.32u3 + 0. 280.12u4 .4 0.0u6 u8 + 1. 4. The cost is now α ≈ 8. 8.75u2 .03 0. λ2 = 1000. The cost is about the same as for the previous problem.81u7 .71u1 − 8. A linear nonnormal problem. The HIRES problem. The so-called HIRES problem (High Irradiance RESponse) originates from plant physiology and is taken from the test set of ODE problems compiled by Lioen and de Swart [6].8 8 8 U (t) 0. 10]. ˙ (9. −1. 0.4 0. The solution and the time step sequence are given in Figure 5.32u2 + 1.5.05 10 0 10 0 k(t) k(t) 10 -2 10 -2 PSfrag replacements 0 1 2 3 4 5 6 7 8 9 10 PSfrag replacements 10 -4 0 1 2 3 4 5 t t 6 7 8 9 10 Fig.3·(0. 0.81u7 . but some of the damping steps are chosen based on the second largest eigenvalue λ1 = 100 (see Figure 4).58 · u3 u4 . Solution and time step sequence for (9. AND ANDERS LOGG EXPLICIT TIME-STEPPING FOR STIFF ODES 1153 1 0.6 0.05 0.5r1 − r4 − 0. the cost is somewhat larger than for the scalar test problem.42 · u2 u2 . We integrate 4 6 eight equations: u1 ˙ u2 ˙ u3 ˙ u4 ˙ (9. for t > 0.43u6 + 0.3).5) u4 = −r2 + r3 − 2r4 . r3 = 0. 0. −280.01 0. with A= 1000 −10000 0 100 u(t) + Au(t) = 0 ˙ u(0) = u0 . the bad eigenmode that needs to be damped out becomes visible in the iterative solution process.43u4 + 0.0.2 0 0 2 4 U (t) 0. ˙ √ where F = 3. The next problem is a version of the “Chemical Akzo–Nobel” problem taken from the ODE test set [6].0057). and u0 = (1. consisting of the following six equations: u1 = −2r1 + r2 − r3 − r4 .6 0.0u6 u8 + 0.02 t 0. Fig.69u4 + 1. 1).1152 1 0. 9.3. but the cost reduction factor is better: α/α0 ≈ 1/180.2). u 3 = r1 − r 2 + r 3 .1 t 0 0.9/737−u2 ) and the reaction rates are given by r1 = 18. CLAES JOHNSSON.4) u5 ˙ u6 ˙ ˙ u7 u8 ˙ = = = = = = = = −1. The Akzo–Nobel problem. −280. 9. and most of the damping steps are chosen to damp out this eigenmode.7·u4 u2 .71u3 − 1. 1. −10. 321. The problem consists of the following .43u7 . 0. 5. Since there is an additional eigenvalue.69u7 . When to damp out which eigenmode is automatically decided by the adaptive algorithm. r4 = 0. and the cost reduction factor is α/α0 ≈ 1/33. ˙ u6 = −r5 . 9. α ≈ 18.43u6 + 0. 0. 0. α/α0 ≈ 1/180.43u2 + 8.5r5 + F.58/34.745u5 + 0.03u3 + 0.035u5 .71u5 − 0.

In this . 9. Solution and time step sequence for (9. α/α0 ≈ 1/9. the cost is only α ≈ 2. t). t) = 0.8 EXPLICIT TIME-STEPPING FOR STIFF ODES x 10 2 0 -1 -2 -4 1155 U1 (t) U (t) U2 (t) 0. 1].4 8 6 4 2 0 0 50 0 x 10 Fig. −µ(u2 − 1)u2 − u1 .367). 0. and the cost reduction factor is α/α0 ≈ 1/9. A special stiﬀ problem is the one-dimensional heat equation.998 2 k(t) 10 -1 k(t) 10 -1 10 -2 PSfrag replacements 10 -2 PSfrag replacements 10 0 100 200 300 -2 k(t) 10 -4 t 130 132 134 t 136 138 140 Fig. ˙ u(0.6. The actual gain in a speciﬁc situation is determined by the quotient of the large time steps and the small damping time steps. The gain is thus determined both by the stiﬀ nature of the problem and the tolerance (or the size of the maximum allowed time step). 0.00123. 8.2 0 -3 -4 -5 -6 -7 2 4 U2 (t) 0 -2 -4 -6 t 6 8 10 t 200 300 0 1 2 t 3 4 5 1. t > 0.2 0. 0. over the interval [0. The cost is now α ≈ 140. 0. Solution and time step sequence for (9. We take µ = 1000 and compute the solution on the interval [0. 180] with initial condition u0 = (0. The heat equation.5 10 0. u(x. 0) = 0. as well as the number of small damping steps that are needed.996 10 0 0 t 0. Van der Pol’s equation.5). u(x. 6.8 1 0.4 0. Solution and time step sequence for (9.25 t 0.2 0 0 100 U (t) 1. 7. ¨ ˙ which we write as (9. t) = u(1. t) = f (x. The time step sequence behaves as desired with only a small portion of the time interval spent on taking small damping steps (see Figure 8).1 U1 (t) 1. t) − u (x. α/α0 ≈ 1/33. x ∈ [0. CLAES JOHNSSON. -4 U3 (t) 0 0.3 0. 1 10 0 PSfrag replacements 10 -1 k(t) 0 20 40 60 80 t 100 120 140 160 180 Fig. and the cost reduction factor is α/α0 ≈ 1/75.1 0.6) u1 ˙ u2 ˙ = = u2 . but the large time steps are not very large compared to the small damping steps.7.05 0. the number of small damping steps is small. t > 0. 10] with initial condition u0 = (2. Allowing a maximum time step of kmax = 1 (chosen arbitrarily).998 1.4). α/α0 ≈ 1/75.6).6 0. A stiﬀ problem discussed in the book by Hairer and Wanner [5] is Van der Pol’s equation.05 0.15 0.6 0.2 case. x ∈ (0. u + µ(u2 − 1)u + u = 0. 1).994 -8 10 0 1. 0. 0 1 2 U (t) U (t) t 100 150 t 3 4 5 9.4 0.437.996 1.45 0.4 0. 0.994 0 x 10 -4 0.35 0. 0).1154 KENNETH ERIKSSON. AND ANDERS LOGG 1 0.

and C. 1879–1902.05 0. cos( 5)).7). [9] A. This is also evident from the time step sequence (see Figure 10) which is chosen only to match the size of the (continuous) residual. 9.065 0. Sci. Solution and time step sequence for (9. SIAM J. o [4] K. With a spatial resolution of h = 0.1 0 Using the dyadic damping technique described in section 3 for this parabolic problem.phi.055 0. and G. Acta. Explicit Runge-Kutta methods for parabolic partial diﬀerential equations. CLAES JOHNSSON. the cost is α ≈ 2000.4 t 0.8. Multi-adaptive Galerkin methods for ODES II: Implementation and applications. Gear and I.01. 10.. 359–379. 55–74. Chalmers University of Technology. SIAM J. −u1 . 187 (2003). M. Projective methods for stiﬀ diﬀerential equations: Problems with gaps in their eigenvalue spectrum. Amsterdam. where we choose f (x. [5] E. 9. o [8] A. Logg. we ﬁnally consider the following simple system: 0 0. [7] A. Gear and I. A pi stepsize control for the numerical solution of ordinary diﬀerential equations.. Gustafsson.1 0. 2 2 1 0 1 0 -1 -2 0 20 40 -1 -2 t 60 80 100 95 96 97 t 98 99 100 0.04 95 96 97 98 99 100 PSfrag replacements [1] K. the solution is u(t) = ( 5 sin( 5t). Tech.. BIT. pp. α/α0 ≈ 1/31.46 0.7 0. Math. [6] W. 1091– 1106. W. Springer-Verlag.. Solution and time step sequence for (9.45 t 0.06 0. 1).5. −λi −2 −3 −4 0 10 20 30 40 50 60 70 80 90 100 Fig. Appl. D. S¨ derlind. Springer Ser. pp.8 1 10 −5 0. M. Phys. New York. To show that the method works equally well for nonstiﬀ problems. Kevrekidis.04 0 20 40 60 80 100 0. Wanner.1156 KENNETH ERIKSSON.chalmers.8 0.. [3] C. Solving Ordinary Diﬀerential Equations II—Stiﬀ and DiﬀerentialAlgebraic Problems.44 0. t) = f (x) as an approximation of the Dirac delta function at x = 0.. Sci.4 0. pp.045 0.6 0. Verwer.3 0. G.05 0. Comput. 270–287. Available online at www.se/software/. 25 (2003).43 0. B. Sci. Comput. Math. pp. pp.8) k(t) k(t) u1 ˙ u2 ˙ = = 10 −5 PSfrag replacements 0 −1 0 0. 105–158. report MAS–R9832.055 0. the eigenvalues of A are distributed in the interval [0. k(t) U (t) t k(t) U (t) t Fig. Introduction to adaptive methods for diﬀerential equations. 1998.06 0.045 0. de Swart. 14. Logg. 1991. Johnson.2 0. SIAM J. G. 2002. Kevrekidis. Lioen and H. Numer. 1119–1141. 4 · 104 ] (see Figure 9). using the technique of dyadic damping discussed in section 3.9 1 (9.065 0. J. Comput. where A is the stiﬀness matrix. S¨ derlind. UK. [10] G. o pp. A nonstiﬀ problem. no stabilization is needed.07 0.47 √ √ √ With the initial condition u0 = (0. Cambridge.2 0. [11] J. AND ANDERS LOGG 0. Estep.5 t 0. ˙ u(0) = 0. P. The automatic control of numerical integration. Multi-adaptive Galerkin methods for ODES I. J. W.8). α/α0 = 1. 11 (1998). we obtain the ODE (9. with a cost reduction factor of α/α0 ≈ 1/31. 28 (1988). Comput. Note that the time step sequence in this example is chosen slightly diﬀerently than in the previous examples. Since this problem is nonstiﬀ (for reasonable tolerances).2 4 x 10 0. 24 (2003). Hairer and G. Hansbo. This is evident upon close inspection of the time step sequence. pp. Lundh. CWI. Numer. G.3 EXPLICIT TIME-STEPPING FOR STIFF ODES 1157 U (t) 0. 95–109.7) u(t) + Au(t) = f. Logg. Test Set for Initial Value Problem Solvers. Discretizing in space. 24 (2003). pp.07 0. 1995. G¨teborg. and so the solver works as a standard nonstiﬀ cG(1) solver with no overhead.6 0. Chalmers Finite Element Center Software. REFERENCES 5u2 . . Eriksson. Cambridge University Press. in Acta Numerica 1995. CWI Quarterly. [2] C.Telescopic methods for parabolic diﬀerential equations. Sweden. 22 (1996). Comput.

mcgq.1. are C q+1 and bounded on each of the sub-intervals (x i−1 . for some partition a = x0 < x1 < . presented earlier in [1. Theorem 2. (Peano kernel theorem) For Λ a bounded and linear functional on V that vanishes on P q ([a. we denote by πv a polynomial approximation of v on [a. We refer to πv as an interpolant of v. Chalmers University of Technology. local time steps. b]) ⊂ V . We are concerned with estimating the size of the interpolation error πv−v in the maximum norm. which we prove in this paper. Throughout this paper. continuous Galerkin. In its basic form.b]) . b]) ⊂ V and use the Peano kernel theorem to obtain a representation of the interpolation error πv − v (Section 2). + q! In the general case. Key words and phrases. we generalize the interpolation estimates from Section 3 to v piecewise smooth by constructing a regularized version of v. realvalued functions on [a. in terms of the regularity of v and the length of the interval. x − t)]q . Date: March 15. b]). v(t)). piecewise smooth. For v ∈ V . the set of functions which. we apply the general results of Section 4 to a pair of special interpolants that appear in the a priori error analysis of the mcG(q) and mdG(q) methods. b]. 1. such that πv ≈ v. b]) ⊂ V for some q ≥ 0. when v ∈ C q+1 ([a. interpolation estimates. xi ). discontinuous Galerkin.se. . 2]. the interpolation estimates include also the size of the jump [v (p) ]x in function value and derivatives at the points of discontinuity within (a. then b (2. In Section 4. This requires a set of special interpolation estimates for piecewise smooth functions. If K has bounded variation and v ∈ C q+1 ([a. o 1 where v+ (t) = max(0. the Peano kernel theorem can be stated as follows. 2. In preparation for a priori error analysis of the multi-adaptive Galerkin methods mcG(q) and mdG(q) presented earlier in a series of papers. . p = 0. 2004. b]. Peano kernel theorem. . Finally. in Section 5. . we obtain estimates of the form (1. b). q + 1. we prove basic interpolation estimates for a pair of carefully chosen non-standard interpolants. Multi-adaptivity. ODE. k = b − a. . This is illustrated in Figure 1. K(t) = Λw/q!. The Peano kernel theorem The basic tool in our derivation of interpolation estimates is the Peano kernel theorem. individual time steps. A large part of the paper is non-speciﬁc and applies to general interpolants on the real line.chalmers.2 ANDERS LOGG πv INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS IN ONE DIMENSION ANDERS LOGG Abstract. n + 1. Introduction The motivation for this paper is to prepare for the a priori error analysis of the multi-adaptive Galerkin methods mcG(q) and mdG(q). We ﬁrst assume that v ∈ C q+1 ([a. .1) K(t) = 1 Λ((· − t)q ). email : logg@math. b])) in Section 3. V denotes the space of piecewise smooth. which we discuss in this section. x1 x2 b Figure 1. Department of Computational Mathematics. Speciﬁcally. that is.1. .2) Proof. with w(x) = [max(0.1) (πv)(p) − v (p) ≤ Ck q+1−p v (q+1) . b] and some q ≥ 0. . SE–412 96 G¨teborg. . Outline of the paper. Anders Logg. deﬁne (2. A piecewise smooth function v and its interpolant πv. Sweden. · = · L∞ ([a. Λv = a K(t)v (q+1) (t) dt. We then directly obtain interpolation estimates (for v ∈ C q+1 ([a. See [3]. < xn < xn+1 = b of the interval [a. . . i = 1. a priori error estimates. v PSfrag replacements a 1. The main tool in the derivation of these estimates is the Peano kernel theorem. mdgq. In other words.

we have ∂ p2 ∂ p1 (2. such that for all v ∈ C q+1 ([a. To prove (2. q. t) = k −p Gt. bounded.2. Proof. |Λx v| = |πv(x) − v(x)| ≤ |πv(x)| + |v(x)| ≤ (1 + C) v .1. t ∈ [a.9) G(x. if v ∈ P q ([a. b] × [a.INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS 3 4 ANDERS LOGG Let now v ∈ V and let (2. and vanishes on P q ([a.p (x. t) = p ∂x ∂xp q Λv = a = k −p + q! (q − p)! x−t k q−p = k −p hx. . Deﬁne G(x. 1 1 Kx (t) = π((· − t)q )(x) − (x − t)q Λx ((· − t)q ) = + + + q! q! ·−t q kq kq x−t q π = (x) − = G(x. with |Hg (x)| ≤ (1 + C) g for all x ∈ [a. ·) ∈ C q−1 ([a. b]) with (πv(x) − v(x))g(x) dx. (x) − + x−t k q ≡ g(x. (2. b]). t) − h(x. b]. .x. q! where Hg (t) ≤ (1 + C) g for t ∈ [a.p is bounded on [a. ∂xp2 ∂tp1 where each Gt. Now. and (3) π is bounded on V .6) G(x. (Peano kernel theorem II) If π is linear and bounded (with constant C > 0) on V . with |G(x. b] × [a. . (Diﬀerentiability of G) If π is linear on V . b]\{(x. πv = v for all v ∈ P q ([a. t) ∈ C q−1 ([a. From the estimate. + We ﬁrst note that for any ﬁxed t ∈ [a. b]). (ii) For any ﬁxed x ∈ [a. deﬁned by x−t q ·−t q . Furthermore. by the Peano kernel theorem. K(t) = = = a k q+1 1 If we can show that (1) π is linear on V . b]. deﬁne Λ by b b a v (q+1) (t)G(x. p = 0.x.5). t). Now. t)| ≤ 1 + C for x. Furthermore. (2) π is exact on P q ([a. b]) and ∂p (2. Proof. such that for all v ∈ C q+1 ([a. b]). then there is a function H g : [a. Λx v = πv(x) − v(x).p1 . t) ∈ C q−1 ([a. G(·. b]) ⊂ V . Theorem 2.7) G(x. b] independent of k. t)| ≤ 1 + C for all x.8) ∂tp where each Gt. Thus. t) dt. t).5) a (πv(x) − v(x)) g(x) dx = k q+1 q! b a v (q+1) (x)Hg (x) dx. b (2. then there is a bounded function G : [a. ∂p ∂p h(x. t) = k −p Gx. b] → R. it follows that Λx is bounded. (iii) For x = t and p1 . p2 ≥ 0.4). . t). q. then the kernel G. b]) ⊂ V. G(x. (2. . that is. where k = b − a. . q! a a In order to derive a representation for derivatives of the interpolation error.3) π : V → P ([a.4) πv(x) − v(x) = k q+1 1 q! k b a 1 q! b π((· − t)q )(x) − (x − t)q g(x) dx + + b q! k π a ·−t k q (x) − + x−t k q g(x) dx + k q+1 Hg (t). ∂xp where each Gx.p is bounded on [a. t).p1 . t) : x = t} independent of k. t ∈ [a. b]. k q+1 1 πv(x) − v(x) = Λx v = q! k To prove (2. and is exact on P q ([a.p2 is bounded on [a. . then the Peano kernel theorem directly leads to a representation of the interpolation error πv − v. q which is linear. b]. b]) then πv = v so Λx vanishes on P q ([a.p2 (x. b] → R. By the Peano kernel theorem. that is. t). πv ≤ C v for all v ∈ V for some constant C > 0. t) = π k k + + has the following properties: (i) For any ﬁxed t ∈ [a. . h(·. b]. we need to investigate the diﬀerentiability of the kernel G(x.p (x. (essentially) bounded function on [a. since π is linear. it now follows that b k q+1 b (q+1) (πv(x) − v(x))g(x) dx = v (t)Hg (t) dt. b]. (x) − (2. b] × [a. b] independent of k. which is linear.p (x. p = 0. if g is an integrable. t). b]) ⊂ V . b] × [a. b]. t) = π ·−t k x−t k q v (q+1) (t)G(x. b]) and ∂p G(x. + . b]). t) = k −(p1 +p2 ) Gt. Lemma 2. t). we deﬁne for any ﬁxed x ∈ [a. q! k k q! + + where |G(x. b]. t) dt. b]). b].

= 0 for p1 + p2 > q. t) : x = t}. r + 1. Then. + The degrees of freedom of the interpolant π [0. which proves (2. t) = k −(p1 +p2 ) ∂xp2 ∂tp1 (q − (p1 + p2 ))! when p1 + p2 ≤ q and any ﬁxed x. b]). b]\{(x.INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS 5 6 ANDERS LOGG where hx. (2. . b]) ⊆ P q ([a.1] (· − s)q ((x − a)/k)). b] → R. b]) with ∂p ∂tp h(x.10) k q+1−p 1 b (q+1) (πv)(p) (x) − v (p) (x) = v (t)Gp (x. We now take G x. .p = gx. g(·.9). ·) ∈ C q−1 ([a.p1 . ∂xp2 ∂tp1 where Gt. b] independent of k. + ∂xp2 ∂tp1 ∂y ∂s We conclude that ∂ p2 ∂ p1 G(x. . . t) = k −(p1 +p2 ) p2 p1 π[0.p − hx. b] independent of k. ∂ p2 ∂ p1 q!(−1)p1 h(x. .1. we thus have ∂ p2 ∂ p1 ∂ p2 ∂ p1 g(x. b] independent of k. b] × [a. + Hence. b] × [a.p − ht. b]) ⊂ V . b]) for r = 0. b]) ⊂ V .1] ·−t k q (x) = π + q (· − a) (t − a) − k k ((x − a)/k).3 that for all v ∈ C (r+1) ([a. for any ﬁxed t ∈ [a. t) = π[0. + ∂sp [0. . h(x. Proof. t)| ≤ C for all x. and functions G p : [a. .1] denote the interpolant shifted to [0. b]). + x−t k q−(p1 +p2 ) (3.2 with G 0 = G. . Interpolation estimates Using the results of the previous section.p is bounded on [a. . t) = k −p1 p1 ∂t (q − p1 )! and so. . q.p (x.3.p .1] where gt. By diﬀerentiating (2. Finally. (Peano kernel theorem III) If π is linear and bounded on V .p (x. If we now let π[0.p and Gt. t) ∈ P q ([a. let s = (t − a)/k. (πv)(p) − v (p) ≤ Ck r+1−p v (r+1) . it is exact on P r ([a. . |Gp (x. b]) ⊂ C q−1 ([a. b] × [a. 1]. b]. t) v (q+1) (t) ∂p G(x. + for p = 0. + where ht. . q.4) with respect to x and use Lemma 2. .4). we now obtain estimates for the interpolation error πv − v. If π is exact on P q ([a. then there is a constant C = C(q) > 0. Proof.x. x−t k q−p1 . + where gx.x. b] × [a. we can write g(x. t). q. t) dt. Furthermore.p = gt. 3. q. we have (πv)(p) − v (p) ≤ Ck r+1−p v (r+1) . Theorem 2. t) = k −p π[0.1] p −p ∂ = k π (· − s)q ((x − a)/k)) = k −p gt. b]). q. such that for all v ∈ C q+1 ([a. t) = π = π[0. p = 0. b] × [a. with ∂p (p) g(x.p2 (x. t) = k −(p1 +p2 ) Gt. then there is a constant C > 0. each of which in turn are C q−1 in the s-variable. and is exact on P q ([a. For p = 1. The following corollary is a simple consequence of Theorem 2. .p is bounded on [a.p1 . b]).1] (· − s)q ((x − a)/k)). we note that ∂ p1 q!(−1)p1 h(x.1. b]. ∂ p2 ∂ p1 ∂xp2 ∂tp1 h(x. g(x. we diﬀerentiate (2. depending only on the deﬁnition of the interpolant (and not on k). b].1] ∂xp ·− (t − a) k q ((x − a)/k)) = k −p gx. r = 0.8). Corollary 3.3. t) dt ∂xp ∂p g(x.1] (· − s)q are determined by + the solution of a linear system.p is bounded on [a. ·) ∈ C q−1 ([a. . and is exact on P q ([a. To prove (2. b]). For p = 0 the result follows from Theorem 2. t). If π is linear and bounded on V . . b]) for any ﬁxed x ∈ [a. t). such that for all v ∈ C q+1 ([a. to obtain (πv)(p) (x) − v (p) (x) = kq q! b a b a = k −p + q!(−1)p (q − p)! x−t k q−p = k −p ht. + p1 ∂t ∂s 1 . for ∂ p1 ∂ p1 g(x. with ∂p π (· − s)q ((x − a)/k)) + ∂tp [0. for x = t.1] (· − s)q (y). q (x) + (t − a) ·− k + and so.p (x. b]. t).1) . and thus each of the degrees of freedom (point values or integrals) will be a linear combination of the degrees of freedom of the function (· − s)q . . t) = ∂tp k q−p = q! v (q+1) (t)Gx. . t ∈ [a.p (x. t) dt. b] independent of k. b] × [a. . b] × [a. . .7) and (2. q! k a where for each p.p is bounded on [a. p = 0.p2 is bounded on [a. t) = k −p1 p π[0. g(x. Similarly. . . we note that for any ﬁxed x ∈ [a. we now obtain the following representation for derivatives of the interpolation error. . t) = ∂p ∂tp x−t k q With y = (x − a)/k. It follows by Theorem 2.

3) b In Figure 2. it is exact on P p−1 ([a.INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS 7 8 ANDERS LOGG for p = 0. (3. .4) a 0. .4 0.2. is linear on V . 1] for q = 0. . i = 1.1. that is.2 = i=1 |v(xi )| + i=1 1 k b v(x)wi (x) dx . Figure 2. Deﬁne · v πv ≤ C v on P q ([a. we note that (πv)(p) − v (p) = v (p) = v (r+1) . b]. (4. . that (πv) (p) 4.6 0.2 ∀v ∈ V.6 πv(x)wi (x) dx = a v(x)wi (x) dx. we plot the function w(x) on [−1. 1] for q = 0. . we obtain πv ≤ C πv ∗ −0. Furthermore. This leads to the following estimate for the derivative of the interpolant. a −0. ∗ 0 −0.8 where each xi ∈ [a. 2(q + 1) − 2m + 1 m ≤ Ck (p−1)+1−p v ((p−1)+1) + v (p) = (C + 1) v (p) =C v (p) . Since all norms on a ﬁnite dimensional vector space are equivalent. we do not have to show that π is bounded. It follows by Corollary 3. this holds also for p = r + 1 ≤ q. .4 Clearly.2) C= q+1 m=0 (−1)m q+1 m 2(q + 1) − 2m + 1 −1 .1) where w(x) = Cx m=0 q + 1 (−1)m x2(q+1)−2m . .5) Proof. .8 −0. For the construction of v . b]) 1 πv(xi ) = v(xi ). the triangle inequality holds and αv ∗ = |α| v ∗ for all α ∈ R.1.6 −0. b]) for p ≤ q.4 −0. .8 1 =C v ∗ ≤ C(n1 + C n2 ) v = C v . b]). (4. b]). and is uniquely deLemma 3. and (3. b i = 1. Interpolation of piecewise smooth functions We now extend the interpolation results of the previous two sections to piecewise smooth functions. . P q ([a. and so v = π0 = 0 by linearity. then π is bounded on V . . we add and subtract v (p) . . . b]) ⊂ P q ([a. if v = 0 then v ∗ = 0.2 0. For 0 < p ≤ q. . (3. Corollary 3. .2 0 x 0. such that for all v ∈ C q+1 ([a. Since π is exact on P q ([a. . . Conversely. To extend the Peano kernel theorem to piecewise smooth functions. and for p = r + 1 = q. r.8 −1 −1 −0. with v → v as → 0. The function w(x) on [−1. we show that it is often enough to show that π is linear on V and exact on P (q) ([a. It is clear that (3. . If π : V → termined by n1 interpolation conditions and n2 = q + 1 − n1 projection conditions. w(x) PSfrag replacements 0. 0. . if v ∗ = 0 then v ∈ P q ([a. b]) is the unique interpolant of 0. n1 . When r < q. 4. then there is a constant C = C(q) > 0. for some constant C = C(q) > 0. Thus.2) holds when p = 0 since π is bounded.4 where each wi is bounded. b]).6 −0. and is exact on P q ([a. Proof. 4. we introduce the function q+1 (πv)(p) ≤ C v (p) . b]) ⊂ V . · ∗ is a norm. to obtain (πv)(p) ≤ (πv)(p) − v (p) + v (p) . n2 . Finally. (3. b]) by n1 ∗ n2 0. .1. If π is linear and bounded on V .2) for p = 0. we construct a smooth version v of the discontinuous function v. 4. q. that is. . . . Extensions of the Peano kernel theorem. . .

v (q+1) (t)G(x.3). b] with discontinuities at a < x1 < x2 < . since dw dx has no zeros within (−1. (Peano kernel theorem for piecewise smooth functions) If π is linear and bounded (with constant C > 0) on V . v (q+1) (t)G(x. v (q+1) (t)G(x. It is clear from the deﬁnition that w(1) = 1 and w(−1) = −1. b]. . Then. πv − v = (πv − πv ) + (πv − v ) + (v − v). b]. 1− 2 x ∈ [x1 − . such that for v piecewise C q+1 on [a. p = 1. . b]. it is clear that I1 + I 3 = kq q! b a w((t−x1 )/ )+1 . πv(x) − v(x) = q! k a m=0 j=1 Since v|[a. 1− 2 x ∈ [xn − . we have (4. x ∈ [−1. The weight function w deﬁned by (4. b]. b] → R. t) dt = I1 + I2 + I3 . t) dt q+1 m !Z x1 + x1 − where k = b − a and for each Cqjm we have |Cqjm (x)| ≤ C for all x ∈ [a. For > 0 suﬃciently small.3) w((x−x1 )/ )+1 Tx1 − v(x) + w((x−x21 )/ )+1 Tx1 + v(x). < xn < b. 1]. x1 )) and v|(x1 . b]).2. x1 + ]. . 2 v (q+1) (t)G(x. Proof.1) and (4. Furthermore.7) a k q+1 q! n b a q v (q+1) (x)Hg (x) dx Dqjm (x)k m+1 [v (m) ]xj .4) and (4. . xn + ]. Since Proof. q+1 (−1)m x2(q+1)−2m m = C(x2 − 1)q+1 = C(x + 1)q+1 (x − 1)q+1 . . and deﬁne v as in (4. where |πv(x) − πv (x)| → 0 and |v (x) − v(x)| → 0 when v ∈ C q+1 ([a.2. t) dt [(1 − w )Tx1 − v + w Tx1 + v](q+1) (t)G(x. m h (1 − w )(m) Tx1 − (q+1−m) v + w(m) Tx1 + (q+1−m) i v (t)G(x.1.2) has the following properties: (4. . b]) ⊂ V .INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS 9 10 ANDERS LOGG Let also Ty v denote the Taylor expansion of order q ≥ 0 around a given point y ∈ (a. then there is a bounded function G : [a. → 0. + j=1 m=0 where for each Dqjm we have |Dqjm (x)| ≤ C for all x ∈ [a. q + 1. . We therefore focus on the remaining term I 2 . 1). t)| ≤ 1 + C for all x. b] → R. Theorem 4. b). As a consequence of the following Lemma. Taking the derivative of w. b] × [a. Furthermore. we then deﬁne (4.6) q n k q+1 1 b (q+1) v (t)G(x. take 0 < < |x − x1 |. v (x) = w((x−xn )/ )+1 n Txn − v(x) + w((x−x2 )/ )+1 Txn + v(x). we obtain dw (x) = C dx = C m=0 q+1 m=0 q+1 d q + 1 (−1)m dx x2(q+1)−2m+1 m 2(q + 1) − 2m + 1 kq q! b a v (q+1) (t)G(x. . . q + 1. such that b (πv(x) − v(x))g(x) dx = (4.x1 ) ∈ C [q+1] ([a.b] ∈ C [q+1] ((x1 . and is exact on P q ([a.. t) dt. if g is an integrable. t) dt. and so w(p) is zero at x = ±1 for p = 1. b]. t) dt + O( ). with |G(x. b). x1 + ] ∪ .1. b]). q+1 X kq q! m=0 q+1 X kq q! m=0 = ! q+1 I2m . with |Hg (x)| ≤ (1 + C) g for all x ∈ [a. . xn + ]). πv (x) − v (x) = where kq q! kq I2 = q! I1 = I3 = kq q! x1 − a x1 + x1 − b x1 + with v = v on [a. b]\{x1 }.∪ [xn − .5) w(p) (−1) = w(p) (1) = 0. (essentially) bounded function on [a. we can assume that v is discontinuous only at x1 ∈ (a. t) dt. t) dt . we have by Theorem 2. . . This leads to the following extension of Theorem 2. b]. w attains its maximum and minimum at x = 1 and x = −1 respectively. t ∈ [a. v has q + 1 continuous derivatives on [a. Fix x ∈ [a. With w (t) = we have I2 = = = kq q! k q! x1 − q Z x1 + x1 − Z x1 + v (q+1) (t)G(x. Without loss of generality. −1 = w(−1) ≤ w(x) ≤ w(1) = 1. . t) dt + Cqjm (x)k m [v (m) ]xj . b] \ ([x1 − . Lemma 4. then there is a function Hg : [a..

such that for v piecewise C q+1 on [a. Evaluating the derivatives of h.q−m is 2. x1 ) v (m) x1 . ·) (Tx1 + j m−1 j v (q−(m−1−j)) Gt (m−1−j) Cqjmp (x)k m−p [v (m) ]xj . . t) dt + m=0 x1 − (−1)m−1 x1 + Cqm (x. x1 v (t)G(x. = j=0 x1 (x. Theorem 4.1.2). b] \ {x1 . Consequently. = x1 = (−1)m−1 = = = x1 + kq q! a b q v (q+1) (t)G(x. and |C qjmp (x)| ≤ C for all x ∈ [a. . corresponding to Theorem 2. 2 C(−1) 2 2 x1 − x1 + m−1 x1 − 1 −1 where Cqm (x. depending only on the deﬁnition of the interpolant (and not on k). (Peano kernel theorem for piecewise smooth functions II) If π is linear and bounded on V . b]×[a. Z 1 −1 cqmj kq v (q−(m−1−j)) I20 = x1 − (1 − w ) +w (t)G(x. . . . t) dt + m=0 cqm k q Gt (q−m) (x. we obtain h(m−1) = = j=0 m−1 dm−1 (q+1−m) (q+1−m) (T v − T x1 − v)G(x. ·) and note that by Lemma (m) 2. x1 ) v (m) + O( ). . x1 ) is bounded on [a. we obtain kq q! b a q = x1 − (q+1−m) (t)(Tx1 + v(t) (q+1−m) T x1 − v(t))G(x. x1 ) where Gt.INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS 11 12 ANDERS LOGG (p) Gt (x. x1 ) = k −(q−m) Gt. From Lemma (q−m) (x. t) dt cqm k q−(q−m) Gt. h ∈ C q−1 ([x1 − . . ·) + O( ). we know that Gt bounded.q−m (x. = m=1 j=0 i x1 (s2 − 1)q+1 Gt (m−1−j) (x. b]\{x1 }. t) dt = O( ). πv(x) − v(x) = kq q! + m=0 b a q (x1 ± ) = 0 for v (q+1) (t)G(x. x1 )k m v (m) x1 . . q + 1. < xn < b. p = 0. we obtain = x1 + m=1 j=0 h i cqmj kq v (q−(m−1−j)) (q−m) x1 Gt (m−1−j) (x. . we have for m = 0. b]) ⊂ V . t). with |Gp (x. t ∈ [a. b] × [a. q. Let now h = (q+1−m) (Tx1 + v − (q+1−m) T x1 − v)G(x. . ·) dtm−1 x1 + m−1 k q+1−p 1 q! k n q b a v (q+1) (t)Gp (x. (4.2. b]. t) q+1 X m−1 X q+1 X m−1 X q X with obvious notation. t) dt Letting → 0. Noting also that w m = 1. . πv(x) − v(x) = v (q+1) (t)G(x. x1 + s) ds + O( ) while for m = 1. . . where C is the constant deﬁned in (4. we have (πv)(p) (x) − v (p) (x) = (4. and functions Gp : [a. By continuity this holds also when x = x 1 . x1 ) Z 1 −1 (s2 − 1)q+1 ds + O( ) cqm kq Gt m=0 I2m = x1 − x1 + (1 − w )(m) Tx1 − w (m) (q+1−m) v + w(m) Tx1 + − (q+1−m) h i (x. we integrate by parts to obtain x1 + (m) for x ∈ [a. . We now extend this to a representation of derivatives of the interpolation error. x1 ) v (m) I2m = x1 − w (t)h(t) dt w (t)h(m−1) (t) dt w ((t − x1 )/ )h(m−1) (t) dt (((t − x1 )/ )2 − 1)q+1 h(m−1) (t) dt. b] with discontinuities at a < x 1 < x2 < . Evaluating the integrals I 2m . .q−m (x. The second result. . . . x1 + (0) (q+1−0) T x1 − v (0) (q+1−0) T x1 + v where I2 = denotes h ∂p ∂tp G(x. then there is a constant C > 0. t) dt. q.1. xn }. x1 + ]).3.8) + j=1 m=0 C(−1)m−1 (s2 − 1)q+1 h(m−1) (x1 + s) ds. for p = 0. b] × [a. t)| ≤ C for all x. and is exact on P q ([a. b] independent of k. b] → R. . t) dt m−1 (q+1−m+j) (q+1−m+j) (m−1−j) v − T x1 − v)Gt (x. . . .7). Hence. is proved similarly. . q + 1.

n) > 0. it is exact on P p−1 ([a.1. If π is linear and bounded on V . b] × [a. b]). πcG v is the polynomial of degree q that interpolates v at the end-points of the interval [a. .x.q−m. we diﬀerentiate (4. since π is bounded. xj ) = Cqjmp (x)k −p . r = 0. b]\{x1 . . Two special interpolants In this section. dxp j=1 m=0 p n q d From Lemma 2. xn }. It follows by Corollary 4. . . b a [q] [q] [q] (4. where Gx.p (x. b] with discontinuities at a < x 1 < . The dual interpolant π dG∗ is deﬁned [q] . . . corresponding to Corollary 3. It is clear that (4. that is.p is bounded on [a.INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS 13 14 ANDERS LOGG Proof. such that for all v piecewise C q+1 on [a. n r (p) ≤ C m=0 p−1 m−p k . . t) dt + Cqjm (x)k m [v (m) ]xj . Furthermore. Corollary 4. . . . is a simple consequence of Theorem 4. then there is a constant C = C(q) > 0. This is illustrated in Figure 4. for p = 0.2. If π is linear and bounded on V . . < xn < b. m=0 5. .9) (πv) (p) −v (p) ≤ Ck r+1−p v (r+1) +C j=1 m=0 k m−p v (m) xj . we know that dp dp (p) Cqjm (x) = p Cqjm (x) = p cqm Gt. . . < xn < b. b] and additionally satisﬁes q projection condi[q] tions. b] and additionally satisﬁes q − 1 projection conditions. (5. and is exact on P q ([a. See proof of Corollary 3. Corollary 4. . b]) ⊂ V . and is exact on P q ([a. b]). xj ) dx dx ∂ p ∂ q−m = cqm k q−m p q−m G(x.1. then there is a constant C = C(q) > 0 and a constant C = C (q. (5. . ∂x ∂t and so. b]).1) πcG v(a) = v(a) and πcG v(b) = v(b). 4. where V denotes the set of functions that are piecewise C q+1 and bounded [q] on [a. . n p−1 (v − πcG v)w dx = 0 [q] ∀w ∈ P q−2 ([a.1 with G 0 = G and Cqjm0 = Cqjm . b].1 that n p−1 v (q+1) (t) a dp (p) G(x. xj ). We also deﬁne the [q] dual interpolant πcG∗ as the standard L2 -projection onto P q−1 ([a.1. Interpolation estimates. b] with discontinuities at a < x 1 < . b]) ⊂ V . where each Cqjmp is bounded on [a. As in the proof of Corollary 3.10) ≤C for p = 0.2. we deﬁne the following interpolant: πcG : V → P q ([a. We also obtain the following estimate for derivatives of the interpolant. from the proof of Theorem 4. v (p) + m=0 j=1 m=0 p−1 k m−p k m−p v (m) v (m) xj (v − πdG v)w dx = 0 [q] ∀w ∈ P q−1 ([a. we know that dxp G(x. we use the results of Sections 2–4 to prove interpolation estimates for two special interpolants. we add and subtract v (p) for 0 < p ≤ q. In other words. r + 1. to obtain (πv)(p) (x) − v (p) (x) = kq q! b Proof. .2) πdG v(b) = v(b). q. b a [q] [q] (πv)(p) ≤ C v (p) + C (4.10) holds when p = 0.2.2.p (x. πdG v is the polynomial of degree q that interpolates v at the right end-point of the interval [a.2. . . b]. q. such that for all v piecewise C q+1 on [a. to obtain (πv)(p) ≤ (πv)(p) − v (p) + v (p) .q−m (x. q.1. t) = k −p Gx.1. we deﬁne the following interpolant: πdG : V → P q ([a. b]) for p ≤ q. For p = 0. by Lemma 2. b]). . Since π is exact on P q ([a. .1. .6) with respect to x. . For the mcG(q) method. . b]). For the mdG(q) method. corresponding to Corollary 3. The following corollary. b]) ⊂ P q ([a. For p = 1. (πv)(p) ≤ Ck (p−1)+1−p v ((p−1)+1) + C j=1 m=0 n p−1 k m−p v (m) xj + v (p) ≤ C v (p) + C j=1 m=0 p−1 k m−p v (m) xj ≤ C v (p) + 2Cn v (p) + k m−p v (m) v (m) Cqjm (x) = cqm k q−m k −(q−m+p) Gt. This is illustrated in Figure 3. Proof. t). b]). the result follows from Theorem 4.

8 −0.8 0. . (πdG v)(p) ≤ C v (p) .2 0. b]). r = 0. 1 1 0. . . b] with discontinuities at a < x 1 < . . [q] [q] [q] [q] 0. q. b). . 4.2 PSfrag replacements πcG v. r = 0. To prove (5.4 πdG v. [q] [q] [q] [q] Figure 3.2 0. . with the only diﬀerence that we use the left end-point x = a for interpolation.2.4 −0. (5.9) (πcG v)(p) − v (p) ≤ Ck r+1−p v (r+1) + C j=1 m=0 [q] n r 0 0 −0. we [q] [q] only have to show that πcG and πdG are exact on P q ([a. r + 1. Furthermore. v 0 0.3 0.8 −1 x 0. Lemma 5. b]).2 for p = 0. It is clear that both πcG and πdG are linear and so. . .9 1 −1 0 0.6) 1 1 0. and (5.4).7 0. there is a constant C = C(q) > 0. Then. b]) and note that p = πcG v − v ∈ P q ([a.2 0.8 Proof.4 0.6 0. . .7 0. . and [q] πdG are exact on P q ([a. 1] for q = 1 (left) and q = 3 (right). The interpolant πcG v (dashed) of the function v(x) = x sin(7x) (solid) on [0. . .2 0 0 −0. b a pw dx = 0. that πcG v = v =v [q] ∀v ∈ P q ([a. 3. .4 x 0. b]) with pw ≥ 0 on [a. for p = 0. . b]). there is a constant C = C(q) > 0. such that for all v piecewise C r+1 on [a. Since p(a) = p(b) = 0. ∀v ∈ P ([a.2 PSfrag replacements πdG v. . . and 4. . Theorem 5. b].4 x 0. b]). .10) (πcG v)(p) ≤ C v (p) + C j=1 m=0 [q] n p−1 k m−p v (m) xj .2 PSfrag replacements −0. r = 0.3). b]). .3) and (5. .8 −0. p(b) = 0 and so p has at most q − 1 zeros within (a. such that for all v piecewise C r+1 on [a. The desired interpolation estimates now follow Corollaries 3. b]) with b pw ≥ 0 on [a. Take now w ∈ P q−1 ([a. .8 0. for any q ≥ 0. Furthermore. (5. < xn < b. there is a constant C = C(q) > 0.8 −1 x 0. b]). (πcG v)(p) ≤ C v (p) . To prove (5. and so we conclude that p = 0.4 [q] −0.6 0. r + 1.1 0.INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS 15 16 ANDERS LOGG [q] similarly. . r + 1.4 −0. .1. . b] with discontinuities at a < x1 < . and (5. . b]). q for p = 0.8 0.6 0. By deﬁnition. v 0.2 0. . . .1 0.8) for p = 0.1. .7) (πdG v)(p) − v (p) ≤ Ck r+1−p v (r+1) . take v ∈ P q ([a. (Estimates for πcG and πdG II) For any q ≥ 1 and any n ≥ 0. b]). by Lemma 3.9 1 Theorem 5. (5. q. and so again we conclude that p = 0. q.2. and (5. (5. .4 −0. . take p = πdG v − v ∈ P q ([a. . .9 1 −1 0 0. [q] 0.6 [q] −0. . q.8 0. 1] for q = 0 (left) and q = 3 (right).9 1 Figure 4.1. v 0.4 [q] −0. By deﬁnition. q.6 0. p has at most q − 2 zeros within (a.6 [q] −0.4 πcG v.3 0. there is a constant C = C(q) > 0. such that for all v ∈ C r+1 ([a.2 0.4) [q] πdG v [q] πcG [q] [q] [q] πdG v k m−p v (m) xj . The two interpolants is. a pw dt = 0.7 0.2 0.7 0. for any q ≥ 0 and any n ≥ 0.8 for p = 0.1. b) and so we can take w ∈ P q−2 ([a.3 0.6 −0. (5. . < xn < b. q. v 0 0. [q] for p = 0.6 0.3 0.5) (πcG v)(p) − v (p) ≤ Ck r+1−p v (r+1) .6 0. . .1.1 0.4 −0.6 −0. such that for all v ∈ C r+1 ([a.2. (Estimates for πcG and πdG ) For any q ≥ 1.11) (πdG v)(p) − v (p) ≤ Ck r+1−p v (r+1) + C j=1 m=0 [q] n r k m−p v (m) xj .6 0.2 PSfrag replacements −0. .6 0.1 0. .8 0.4 0. . The interpolant (dashed) of the function v(x) = x sin(7x) (solid) on [0.8 0. b].

b]) and any q ≥ 1. q. Multi-adaptive Galerkin methods for ODEs I. Note that the corresponding estimates hold for the dual versions of the [q] [q] two interpolants. 1119–1141. r + 1. Proof. Lemma 5. 1988. b]). .14) [v(a)−πdG v(a)]w(a)+ [q] b ( a d [q] (v−πdG v)) w dx = 0 dx ∀w ∈ P q ([a. For any v ∈ C([a.12) (πdG v)(p) ≤ C v (p) + C j=1 m=0 [q] n p−1 k m−p v (m) xj . . Cambridge University Press. we note the following properties of the two interpolants. . For any w ∈ P q−1 ([a. [3] M.2. . Lemma 5. [2] SIAM J. b]). we have (5. the only diﬀerence being that r ≤ q − 1 for [q] πcG∗ . For any v ∈ C([a.. 25 (2003). Approximation Theory and Methods. Integrate by parts as in the proof of Lemma 5. . 1879–1902. SIAM J.. πcG∗ and πdG∗ . b]).13) a ( d [q] (v − πcG v)) w dx = 0 dx ∀w ∈ P q−1 ([a. . 24 (2003). b]) and any q ≥ 0. Proof. References [1] A. q. . . Comput. we have b (5. . and (5. Logg. pp. r = 0. pp.D. Finally. . .2 and use the deﬁnition [q] of πdG .INTERPOLATION ESTIMATES FOR PIECEWISE SMOOTH FUNCTIONS 17 for p = 0. . Comput. which is of importance for the a priori error analysis.3. . . [q] by the deﬁnition of πcG . Cambridge. Sci. Sci.J. we integrate by parts to get b ( a d [q] [q] (v − πcG v)) w dx = (v − πcG v)w dx [q] b a b − a (v − πcG v) w dx = 0. Powell. for p = 0. Multi-adaptive Galerkin methods for ODEs II: Implementation and applications.

t). a priori error estimates. Furthermore. (1. given by the mcG(q)∗ or mdG(q)∗ method deﬁned in [4]. Tn = {Iij : Tn−1 ≤ ti. and jumps in function value and derivatives for the multi-adaptive solutions. we shall assume that the interval (0. For a given local interval Iij . (1. 5]. Key words and phrases. . .1) u(t) = f (u(t).se. we denote the time slab T . On each subinterval I ij . 1. We ﬁrst derive estimates for the general non-linear problem.4) J (πu. where 1 (1. of the exact solution φ of (1. ˙ u(0) = u0 . with the notation f ∗ (φ. < TM = T . t). we prove the corresponding estimates for the discrete dual solution Φ. t ∈ (0. t)φ(t) + g(t). i = 1. discontinuous Galerkin. corresponding to (1. We refer to the set of intervals Tn between two synchronized time levels Tn−1 and Tn as a time slab: We denote the length of a time slab by K n = Tn − Tn−1 . ˙ or −φ(t) = f ∗ (φ(t). t ∈ [0.1) or (1. ·) = −A φ + g. the discrete dual solution Φ is deﬁned as a Galerkin solution of the continuous dual problem ˙ −φ(t) + A (t)φ(t) = g. we refer to [1] or [4] for the exact deﬁnition of the methods. T ]. The proof is by induction and is based on a new representation formula for the solutions. mcgq. evaluated at an appropriate mean value of the approximate Galerkin solution U of (1. T ] into M i subintervals. (1. and the length of the subinterval is given by the local time step k ij = tij − ti. T ] is partitioned into blocks between certain synchronized time levels 0 = T 0 < T1 < . As an important step in the a priori error analysis of the multi-adaptive Galerkin methods mcG(q) and mdG(q). For the non-linear problem (1.1) is a piecewise polynomial on a partition of (0. t) ds ∂u is the transpose of the Jacobian of the right-hand side f . local time steps. and refer to [4] for the exact deﬁnition. j).chalmers. we refer the reader to [1. For a detailed description of the multi-adaptive Galerkin methods. (1.j−1 < tij ≤ Tn }. Notation. ˙ u(0) = u0 .2). This is illustrated in Figure 1. 4.5) to write the dual problem (1. 6. Department of Computational Mathematics. T ].2). U. f ∗ (φ. T ). We will use the notation (1.1. ·)φ + g. the discrete dual solution Φ is deﬁned as a Galerkin solution of the Date: March 15. where u : [0. individual time steps. Multi-adaptivity. (1.2) u(t) + A(t)u(t) = 0. tij ]. T ] → RN is the solution to be computed. we here derive estimates for derivatives. we prove estimates of derivatives and jumps across element boundaries for the multiadaptive discrete solutions. U. ·) = J (πu. T ). we proved special interpolation estimates as a preparation for the derivation of a priori error estimates for the multi-adaptive Galerkin methods mcG(q) and mdG(q).6) φ(T ) = ψ. We remind the reader that the discrete dual solution Φ is a Galerkin approximation. u0 ∈ RN a given initial condition. and f : R N × (0.3). . continuous linearized dual problem ˙ −φ(t) = J (πu. T ).2 ANDERS LOGG ESTIMATES OF DERIVATIVES AND JUMPS ACROSS ELEMENT BOUNDARIES FOR MULTI-ADAPTIVE GALERKIN SOLUTIONS OF ODES ANDERS LOGG Abstract. . continuous Galerkin. parabolic. As further preparation. Introduction In [3]. mdgq. . email : logg@math. 1. Chalmers University of Technology. Furthermore. 2].j−1 . In particular. Subinterval j for component i is denoted by I ij = (ti. linear. Anders Logg. 2. Ui |Iij is a polynomial of degree qij and we refer to (Iij . The following notation is used throughout this paper: Each component Ui (t). T > 0 a given ﬁnal time. t ∈ (0. Ui |Iij ) as an element. ODE.1).7) φ(T ) = ψ.j−1 . U. for which I ij ∈ T .3) in the form ˙ −φ(t) = f ∗ (φ(t). t ∈ [0. t). N . T ) → RN and ψ ∈ RN . t ∈ [0. . with A(t) a bounded N × N -matrix. t) = 0 ∂f (sπu(t) + (1 − s)U (t). For the linear problem (1. with given data g : [0. T ] → RN a given function that is Lipschitz-continuous in u and bounded. o 1 . by T (i. Sweden. 2004. SE–412 96 G¨teborg.3) φ(T ) = ψ. presented earlier in [1. We also derive estimates for the linear problem.1) and an interpolant πu of the exact solution u. of the approximate m(c/d)G(q) solution U (t) of (1.

j = 1. . Let U be the mcG(q) fi (U. .2) ˜ Φi (t) = ψi + t T i t 0 kij ti. and πdG∗ .2.3) Similarly. T ]. we prove a chain rule for higher-order derivatives. These representations are obtained as follows. . we obtain ˜ − (Ui − Ui )vm + Iij ˜ ˙ Ui − Ui vm dt = 0. . Similarly.6). We remind the reader about the [q] [q] [q] [q] special interpolants πcG . 0 ˜ with vm (t) = ((t − ti.ESTIMATES OF DERIVATIVES AND JUMPS 3 4 ANDERS LOGG Since diﬀerent components use diﬀerent time steps.1. the (2. ·) and −Φ = f ∗ (Φ.9) U (t) = πcG u0 + [q] [q] · fi (U. .3). . .1) can expressed in the form (2. s) ds (t). we show that the multi-adaptive Galerkin solutions (including discrete dual solutions) can be expressed as certain interpolants.1) satisﬁes the relation tij fi∗ (Φ(s). since Ui (ti. m = 0. . Integrating by parts and subtracting. In Section 3.j−1 tij Tn−1 Kn Tn Figure 1.1). ˜ Φ can be expressed as an interpolant of Φ. tij ).1) and deﬁne for i = 1. . PSfrag replacements Iij or mdG(q) solution of (1. i = 1. that is. . . some t i j ∈ (ti.4) mcG(q)∗ [q] ˜ U = πcG U . . ˜ It now turns out that U can be expressed as an interpolant of U . Theorem 2. Elements between common synchronized time levels are organized in time slabs. In Section 2. ·)vm dt. (2. ·). . To prove (2. πdG . which we use in Section 4. then on each local interval Iij . f (U (s). . Finally. [qij ] ˜ [qij ] ˜ that is. solution Φ of (1. ·)vm dt. In this example. to prove the desired estimates for the non-linear problem (1. it now follows that Ui = [qij ] ˜ πcG Ui on Iij . . by the deﬁnition of U . tij ti.j−1 ) = Ui (tij ) − Ui (tij ) = 0. πcG∗ . we have N = 6 and M = 4.j−1 ) − Ui (ti. (2. N .j−1 )/kij )m . we note that if U is the mcG(q) solution of (1.1) by induction. s) ds. together with the representations of Section 2. . . [q] By the deﬁnition of the mcG(q)-interpolant π cG . T ˙ ˙ ˜ ˜ We note that U = f (U. A representation formula for the solutions The proof of estimates for derivatives and jumps of the multi-adaptive Galerkin solutions is based on expressing the solutions as certain interpolants. (1. ˜ ˜ and thus. .j−1 . 2.6) can be expressed in the form [q] ˜ Φ = πcG∗ Φ. T ] for different components. Similarly. . . This new way of expressing the multi-adaptive Galerkin solutions is a powerful tool and it is used extensively throughout the remainder of the paper. The mcG(q) solution U of (1. s) ds. deﬁned in [3]. . Mi . Proof. qij − 1.2 for the mdG(q) and mdG(q)∗ methods. It is known before [1] that the mcG(q) solution of (1. However. t) dt.1) ˜ Ui (t) = ui (0) + 0 t fi (U (s). . we have ˙ Ui vm dt = Iij Iij with a similar relation for the mdG(q) solution. and in Theorem 2. Iij ˜ ˙ Ui − Ui vm dt = 0. . N. Ui = πcG Ui and Φi = πcG∗ Φi on each local interval Iij . in Section 5. qij − 1. We derive these representations in Theorem 2.1 below for the mcG(q) and mcG(q) ∗ methods. . Individual partitions of the interval (0. We denote the set of such internal nodes on each local interval I ij by Nij .j−1 m = 0. . with πcG a special interpolant. for Φ the mcG(q)∗ or mdG(q)∗ solution of (1. we deﬁne for i = 1.8) Ui (tij ) = (u0 )i + 0 fi (U (t). Outline of the paper. we prove that (1. but this does not hold with tij replaced by an arbitrary t ∈ [0. T ]. a local interval I ij may contain nodal points for other components. N . we prove the corresponding estimates for linear problems. 1. we have ˙ ˜ Ui vm dt = Iij Iij for all t ∈ [0. On the other hand.

. Subtracting (2. since Ui (t− ) = Ui (tij ). In this section.1) can expressed in the form (2. by the deﬁnition of U .nn x(n1 ) · · · x(nn ) . m = 1. since the mdG(q)∗ method is identical to the mdG(q) method with time reversed.j−1 ˜ ˙ Ui − Ui vm dt = 0. We now take v i = 0 except on Iij . v) dt. v(T )) + Φi vi dt = ˙ i=1 j=1 Iij 0 (f ∗ (Φ. but apply also to the linear problem (1. [qij ] ˜ ˜ and so Φi = P [qij −1] Φi ≡ πcG∗ Φi on Iij . t) with respect to t.. We also prove a basic estimate for the jump in a composite function. ˜ On the other hand. ij fi∗ (Φ. Remark 2..nn is taken over n1 + . so that (3. ·).1). .7).. The mdG(q) solution U of (1. (Chain rule) Let v : RN → R be p > 0 times diﬀerentiable in all its variables. n1 . Ui = πdG Ui and Φi = πdG∗ Φi on each local interval Iij . A chain rule for higher-order derivatives To estimate higher-order derivatives. [q] + Iij ˜ ˙ Φi vi dt = Iij fi∗ (Φ.ESTIMATES OF DERIVATIVES AND JUMPS 5 6 ANDERS LOGG To prove (2. Integrating by parts and subtracting. we obtain Iij for all continuous test functions v of order q = {q ij } vanishing at t = 0. and vn = 0 for ˙ ˙ n = i.. . ·)vm dt.5) and (2.1) is p times diﬀerentiable. to obtain Iij ˜ (Φi − Φi )w dt = 0 ∀w ∈ P qij −1 (Iij ). On ˜ the other hand. where for each n the sum ni ≥ 1. ·). . Lemma 3. we note that if U is the mdG(q) solution of (1. m = 1. [q] ˜ Φ = πdG∗ Φ.1). .2. ·)vi dt.n1 . . + nn = p with .j−1 )/kij we have ˙ ˜ Ui vm dt = Iij )m . Furthermore. ·)vm dt.. The representation (2.. .6).nn Cp. By the deﬁnition of the mdG(q)-interpolant π dG .. v(T )) + ˜ ˙ Φi vi dt = i=1 j=1 Iij 0 T (f ∗ (Φ. . To prove (2. . for all test functions v. Theorem 2. Then. we face the problem of taking higherorder derivatives of f (U (t).6) −(ψ. it now follows that N Mi Iij i=1 j=1 ˜ ˙ (Φi − Φi )vi dt = 0. v) dt. let D n v denote the nth order tensor deﬁned by N N ˜ since v(0) = 0 and both Φ and v are continuous.1. we have ˙ Ui vm dt = Iij Iij (3. [q] v◦x:R→R Similarly. 3. . . with vm (t) = ((t − ti. The representations of the multi-adaptive Galerkin solutions as certain interpolants are presented here for the general non-linear problem (1.. then on each local interval Iij .5) −(ψ. the mdG(q)∗ solution Φ of (1.6). we derive a generalized version of the chain rule for higher-order derivatives. it now follows that Ui = [qij ] ˜ πdG Ui on Iij . Proof.4). . ·)vi dt... Iij fi (U..7) ˜ U = πdG U . by the deﬁnition of Φ. p i1 =1 ··· in =1 ∂nv n w 1 · · · w in . . qij . qij . we obtain ˜ − Φi vi and thus N Mi tij ti.8) of the dual solution follows directly. . it follows that − ˙ ˜ Φi vi dt = Iij Iij ˜ ˙ ˜ Ui − Ui vm dt − Ui (t− ) − U (tij ) = 0. we note that with Φ the have N Mi mcG(q) ∗ T solution of (1. wn ∈ RN . and let x : R → RN be p times diﬀerentiable.1. fi (U.8) D n v w1 · · · wn = for w1 ..6) can be expressed in the form (2. ∂xi1 · · · ∂xin i1 [qij ] ˜ [qij ] ˜ that is. we (2.2). ij Iij Integrating by parts. ˜ and thus. (2.2) dp (v ◦ x) = D n v(x) dtp n n=1 1 .

1 and Lemma 3. we obtain by Lemma 3. and so (3. = (A+ + A− )/2 and |A| = [AB] = [A] B + A [B]. . To obtain the estimates D p (R) = max n=0. let x : R → RN be p times diﬀerentiable. .l∞ ) ≤ Cx for n = 1. .1 and 3.2.l∞ ) ≤ Cx ..1). let x : R → RN be p times diﬀerentiable.3) and n Proof.7) follows directly by the deﬁnition of v Dp (R) . . It now follows that |[A1 A2 · · · An ]| = |[A1 (A2 · · · An ) ]| = | [A1 ] A2 · · · An + A1 [A2 · · · An ] | ≤ |[A1 ]| · |A2 | · · · |An | + |A1 | · |[A2 · · · An ]| n + − + − + − + − Proof. there is a constant C = C(p) > 0.l∞ ) [x]t l∞ .nn D n v(x) x(n1 ) · · · x(nn ) [x]t p l∞ C x + t ≤C D n+1 v n=1 n1 . . . Let v : → R be p ≥ 0 times diﬀerentiable in all its variables.... except possibly at some n t ∈ R.7) dp (v ◦ x) dtp L∞ (R) RN D v(x) n1 . such that x(n) L∞ (R. such that (3. p. A max(|A+ |. Repeated use of the chain rule and Leibniz rule gives dp (v ◦ x) dtp = = = n=1 dp−1 dp−2 Dv(x)x(1) = p−2 D2 v(x)x(1) x(1) + Dv(x)x(2) dtp−1 dt dp−3 D3 v(x)x(1) x(1) x(1) + D2 v(x)x(2) x(1) + . where for each n the sum is taken over n 1 + . For p > 0. there is a constant C = C(p) > 0.4.n1 .. p.8) dp (v ◦ x) dtp p t (3. + nn = p with ni ≥ 1.. v L∞ (R) + Dnv ≤C v [x(n1 ) ]t p−n1 l∞ C x l∞ . we obtain by Lemma 3.. Estimates of derivatives and jumps for the non-linear problem We now derive estimates of derivatives and jumps for the multi-adaptive solutions of the general non-linear problem (1. such that x(n) L∞ (R. With [A] = A+ − A− .. we now prove basic estimates of derivatives and jumps for the composite function v ◦ x. ≤C v D p+1 (R) n=0 p−n Cx [x(n) ]t l∞ .5) for all deﬁne (3. . + Dv(x)x(3) dtp−3 p Lemma 3.ESTIMATES OF DERIVATIVES AND JUMPS 7 8 ANDERS LOGG Proof..2.4) |[A1 A2 · · · An ]| ≤ i=1 |[Ai ]| Πj=i |Ai |. . . dp (v ◦ x) ≤C dtp n=1 n p 1 . The proof of (3. |A− |). . dp (v ◦ x) dtp p p t ≤C ≤ i=1 |[Ai ]| Πj=i |Ai |. We ﬁrst note that for p = 0.l∞ ) ..6) D n v w1 · · · wn w1 . and 4. let D n v L∞ (R. . wn ∈ RN . .l∞ ) ( p n=0 L∞ (R. n=1 n1 . such that (3. for n = 1..1.. Then.2. .l∞ ) be deﬁned by (3.. . Lemma 3.. Lemma 3. Let v : RN → R be p + 1 ≥ 1 times diﬀerentiable in all its variables. We ﬁrst note that for p = 0.l∞ ) Using Lemma 3. .. To estimate the jump in function value and derivatives for the composite function v ◦ x. . Then. Proof... we have dp (v ◦ x) = |[(v ◦ x)]t | = v(x(t+ )) − v(x(t− )) dtp t ≤ Dv L∞ (R.. (3.nn x (n1 ) ···x (nn ) .nn n Cp. For p > 0. and let Cx > 0 be a n constant..nn L∞ (R. + [x(nn ) ]t p−nn ) l∞ C x D p+1 (R) p−n Cx [x(n) ]t ≤ Dnv Dn v L∞ (R. + .. ≤C v p D p (R) Cx ..p Dnv L∞ (R.nn D n v(x)x(n1 ) · · · x(nn ) ≤ C v p D p (R) Cx .l∞ ) = v L∞ (R) for n = 0.. and let Cx > 0 be a constant.l∞ ) w1 l∞ · · · wn l∞ with L∞ (R.3. We will use the following notation: For n ≥ 0. we have (3. we will need the following lemma. ...3) is straightforward: [A] B + A [B] = (A − A )(B + B )/2 + (A + A )(B − B )/2 = A+ B + − A− B − = [AB]. .8) holds for p = 0. .

We summarize the list of assumptions as follows: (A1) (A2) (A3) (A4) (A5) the local orders qij are equal within each time slab. . . for each local interval Iij .2.1. Furthermore. .p . assume that for each pair of local intervals I ij and Imn within the time slab. For p = 0. ¯ Note that dual problem is in general non-autonomous. by Theorem 5. ¯ qij = qmn = q .2 in [3]. q − 1. N. .2). and (A4) to derive estimates for U in terms of CU. .r . for p = 0.p−1 . = ≡ for each local interval Iij . .1). . p. Estimates for U . we now obtain the following estimate for the size of the jump in function value and derivatives for U . Ui = dtp−1 fi (U ). We also assume that the problem (1. then there is a constant C = C(¯) > 0. ¯ for each local interval Iij . . . . f is autonomous. we have (A1) and (A2) kij > α kmn . dp /dtp (∂f /∂u) (x(t)) ≤ f p T p Cx . “ ” “ ” “ ” (p) (p) ˜ (p) ˜ (p) ˜ (p) ˜ (p) Ui (t+ ) − Ui (t+ ) + Ui (t+ ) − Ui (t− ) + Ui (t− ) − Ui (t− ) ˜ By Theorem 2. q + 1. for some q ≥ 0 and some α ∈ (0..1. These estimates are then used to derive estimates for U and Φ.0 = f T .6) [d /dt (∂f /∂u) (x(t))]t p p l∞ By Lemma 4. . .4.j−1 is an internal node of the time slab T. r = 0. p = 1. q . n = 1. and ¯ (4.j−1 l∞ r+1−p r+1 ≤ Ckij CU.8) U (n) L∞ (T . . . ˜ U (p) L∞ (T . we use assumptions (A1). (Derivative and jump estimates for U ) Let U be the mcG(q) ˜ or mdG(q) solution of (1. ck .12) [U (p) ]ti. the local time steps kij are semi-uniform within each time slab. .. By deﬁnition. We make the following basic assumptions: Given a time slab T . and (A4) hold.3 and Lemma 3. . p = 1.5) T (4. . (A3). U is an interpolant of U and so.j−1 .. . . . .1. such that q (4. We ﬁrst note that at t = t i. q + 1. the local time steps kij are small. ck . ≤ f T n=0 p−n Cx [x (n) ]t l∞ . such that for each p. i = 1.ESTIMATES OF DERIVATIVES AND JUMPS 9 10 ANDERS LOGG for the multi-adaptive solutions U and Φ.j−1 is an internal node of the time slab T. r + 1. α) > 0. where ti. f and its derivatives are bounded. Lemma 4. . .l∞ ) p ≤ CCU. such that (A5) kij f T p = 0.p−1 [U (n) ]ti. we ﬁrst derive estimates for the ˜ ˜ functions U and Φ deﬁned in Section 2. such that l∞ ≥ maxi=1. (Jump estimates for U ) Let U be the mcG(q) or mdG(q) solution of (1. Note ¯ that assumption (A4) implies that each f i is bounded by f T .3 and Lemma 3.10) and p−1 kij CU. (A3). We further assume that there is a constant ck > 0. (A5 ) This assumption will be removed below in Theorem 4.p ≤ ck . we deﬁne CU.N fi ¯ D q+1 (T ) .1). then there is a constant C = C(¯.11) ˜ [U (p) ]ti.1) and deﬁne U as in (2. we introduce the following notation: For given p > 0. such that (4. . let CU. 1). .j−1 l∞ ≤C p−n CU. . noting that f T ≤ CU. . Assumptions.1) ¯ is autonomous. .p−1 .2. e+ + e0 + e− .p ≥ f T be a constant. . ˜ Lemma 4. . Temporarily. ¯ fi ¯ D q+1 (T ) < ∞. . we have [Ui ]t (p) ≤ ck . If assumptions (A1). N.j−1 n=0 l∞ . In the following ˜ lemma.4. for p = 0. q . we will assume that there is a constant ck > 0. . 4. ∂t i = 1. 4. .1 (or Theorem 2.. with the notation of Lemma 3. assume that (A4) and take f (4. Proof. and so the results follow directly by Lemma 3. . . .p and f T . such that q (4.1. If assumptions (A1)–(A5) and (A5 ) hold. The proof is by induction. we have r r+1−p ˜ (r+1) |e+ | ≤ Ckij Ui L∞ (Iij ) +C x∈Nij m=1 m−p ˜ (m) kij |[Ui ]x |. where ti.l∞ ) n ≤ CU. (A3) ∂fi = 0. . To simplify the estimates. dp−1 ˜ (p) Proof.

we have r r+1−p ˜ (r+1) |e− | ≤ Cki. it follows that r ¯ r ¯ r+1 ¯ |e+ | ≤ Ckij+1−p CU.l∞ ) ≤ CCU. since U is continuous.1 and assumption (A5 ). α).1 = C1 f T with q C1 = C = C (¯).j−1 |[Ui (m) Theorem 4.2 . . . . q where C3 = C3 (¯. Lemma 4. r r p = 1. α). ˙ ˜ |[Ui ]t | ≤ Ckij Ui ˙ ˜ L∞ (Iij ) + 0 + Cki. q .1 ≡ C2 f 2 . . Starting at p = 1.. In this way.p−1 for n = 1.¯ Ci . we now obtain the following estimate for derivatives of the solution U . . .2 = max(C1 f T . .m−1 kij m−n CU. . q . Finally. .p−1 .ESTIMATES OF DERIVATIVES AND JUMPS 11 12 ANDERS LOGG for p = 0. .2. by Lemma 4. we use Lemma ¯ 4. to obtain the estimate p−1 p−1 p−n CU. ck .13) holds for p = 1.¯−1 r (¯−1)+1 r r ¯ r+1 ¯ Ckij+1−p CU.. . r ¯ r+1 ¯ (kij CU.p−1 kij n=0 (¯−1)+1−n r CU. we obtain a sequence of constants ¯ C1 .1. .0 = Ckij CU. we thus obtain the estimate q ˙ Ui L∞ (Iij ) ≤ C(1 + α−1 )kij CU.p−1 . Assume now that (4.1). r + 1 and r = 0. ¯ q T .p−1 n=0 [U (n) ˜ = (π Ui )(p) ≤C L∞ (Iij ) p−1 ]t l∞ . This holds for all components i and all local q intervals Iij within the time slab T .. If assumptions (A1)–(A5) hold. .l∞ ) ≤ CU. C2 f T ).p−1 is a constant. . q . ¯ Then. For p = 2.¯ . We may thus deﬁne CU. . q + 1. Cq . .¯ + C r r ¯ r+1 ¯ ≤ Ckij+1−p CU.0 . we note that (A5 ) holds for CU.¯ .2 (with r = p − 1). r and so (4. q . that for r = 0 and p = 1.l∞ ) ]x |.2 ≡ C3 f 3 T . . and thus 2 2 U (2) L∞ (T . ck .l∞ ) p ≤ CCU. and so U (p) L∞ (T . For p = 1. ≤C f p T . ck . such that U (p) L∞ (T . ¯ ˜ To estimate e0 .m−1 [U n ]x l∞ p ≤ CCU. and the estimates for e + .j−1 m=1 m−p ˜ ki.j−1 ) m−p ˜ kij |[Ui (m) ]x |.3−1 = CCU. we obtain the estimate |e − | ≤ Ckij+1−p CU.¯ r n=0 r ¯ r+1 ¯ (kij CU. and so (4.j−1 Ui L∞ (Ii. . q .1 and assumption (A5 ).12) follows by induction. assuming that (A5 ) holds for CU. . It now follows by assumption (A5). ˜ (p) Ui L∞ (Iij ) +C x∈Nij m=1 Using assumption (A2). then there is a constant C = C(¯.m−1 [U (n) ]x l∞ ≤ C(1 + kij CU. ¯ r ¯ r+1 ¯ Similarly.1 with ck = C ck .2 in [3].12) holds for r = r −1 ≥ 0.0 ≤ CCU.p−1 1 + p (kij CU.m−1 )m−n ≤ CCU. to obtain p−1 m−1 m−p kij x∈Nij m=1 n=0 (p−1)+1−n m−p m−n kij CU. p − 1. we use r Lemma 4. By Lemma 4.2).12) holds for r = 0. .p−1 (p−1)+1 p ≤ CCU. we obtain for r = 0 and p = 0. . since U is continuous. r r (p) n where by deﬁnition CU.1.¯)p−1−n ≤ Ckij+1−p CU. It then follows that (A5 ) holds for CU. U (3) L∞ (T . .l∞ ) 3 3 ≤ CCU.. we have Ui (p) L∞ (Iij ) ˜ (p) |e0 | = |[Ui ]t | ≤ C p−n CU. and e− . .0 )CU.l∞ ) ≤ ¯ Cp f p for p = 1. Continuing. Ui (p) L∞ (Iij ) Thus. . and assumption (A2). ck . such that q (4. + CCU. Note that the second sum starts at ¯ ˜ m = 1 rather than at m = 0. By Theorem 2.p−1 + C CU.j−1 Ui L∞ (Ii. . . e0 . and thus r ¯ r+1 ¯ Summing up.j−1 ) by assumption (A4).p−1 [U n ]t n=0 p−1 l∞ |e0 | ≤ C = ≤C p−n CU. we thus obtain |[Ui ]t | ≤ |e+ | + |e0 | + |e− | ≤ Ckij+1−p CU. . ck . . Lemma 4. (4. .1 gives ¯ p−1 ˜ Proof.j−1 ) +C x∈Ni. ˙ ˙ ˜ |[Ui ]t | ≤ C Ui L∞ (Iij ) l∞ L∞ (Ii. and α. for some constant C = C (¯). we now deﬁne C U.¯ + C r r ¯ r+1 ¯ ≤ Ckij+1−p CU. .1 and Lemma 4.13) U (p) L∞ (T .¯ . α). (Derivative estimates for U ) Let U be the mcG(q) or mdG(q) solution of (1. by Theorem 5. U is an interpolant of U and so. For p = 1.1 (or Theorem 2. we note that e0 = 0 for p = 0. . depending only on q.13) follows if we take C = max i=1. .p−1 . .0 . ck .p−1 + C p ≤ CCU. such that U (n) L∞ (T .m−1 kij m−1 m−n CU. α) > 0.2−1 = CCU.¯−1 )m−1−n ≤ Ckij+1−p CU. . . . CU. and so (4.¯ . p = 1.0 [U ]t ˙ ˜ + C Ui ˙ ˜ ≤ C Ui L∞ (Iij ) = C fi (U ) L∞ (Iij ) ≤C f T . T √ q where C2 = C2 (¯. Similarly.¯−1 r (¯−1)+1 r where C = C(¯.¯ 1 + r m−p kij x∈Nij m=1 n=0 (¯−1)+1−n r m−p m−n kij CU.

ESTIMATES OF DERIVATIVES AND JUMPS

13

14

ANDERS LOGG

Having now removed the additional assumption (A5 ), we obtain the following version of Lemma 4.2. Theorem 4.2. (Jump estimates for U ) Let U be the mcG(q) or mdG(q) solution of (1.1). If assumptions (A1)–(A5) hold, then there is a constant C = C(¯, ck , α) > 0, such that q (4.14) [U

(p)

**At t = ti,j−1 , we obtain, by Theorem 4.2 and an interpolation estimate,
**

|[xsi ]t | ≤ s |[(πui )(n) ]t | + (1 − s) |[Ui ≤ |(πui ) ≤ ≤

(n) (n) (n)

]t | ≤ |[(πui )(n) ]t | + |[Ui − (πui )

(n) −

(n)

]t |

q+1 ¯ T q+1−n ¯ Ckij q+1 ¯ T

(t ) −

+

(n) ui (t)|

+

(n) |ui (t)

q+1−n ¯ (t ))| + Ckij f

q+1−n ¯ Ckij q+1−n ¯ Ckij

(q+1) ¯ ui L∞ (Iij )

+

q+1−n ¯ Cki,j−1

(q+1) ¯ ui L∞ (Ii,j−1 )

+

f

]ti,j−1

l∞

≤

q ¯ Ckij+1−p

f

q +1 ¯ T ,

p = 0, . . . , q , ¯

f

q+1 ¯ , T

for each local interval Iij , where ti,j−1 is an internal node of the time slab T. 4.3. Estimates for Φ. To obtain estimates corresponding to those of Theorem 4.1 and Theorem 4.2 for the discrete dual solution Φ, we need to consider the fact that f ∗ = f ∗ (φ, ·) = J φ is linear and non-autonomous. To simplify the estimates, we introduce the following notation: For given p ≥ 0, let CΦ,p ≥ f T be a constant, such that (4.15) Φ(n)

L∞ (T ,l∞ ) n ≤ CΦ,p Φ L∞ (T ,l∞ ) ,

where we have also used assumption (A2). With similar estimates for other components which are discontinuous at t = t i,j−1 , the estimate (4.18) now follows by assumptions (A4) and (A5). ˜ Using these estimates for J , we now derive estimates for Φ, correspond˜ ing to the estimates for U in Lemma 4.1. ˜ Lemma 4.4. (Derivative and jump estimates for Φ) Let Φ be the mcG(q)∗ or ˜ mdG(q)∗ solution of (1.3) with g = 0, and deﬁne Φ as in (2.2). If assumpq tions (A1)–(A5) and (A5 ) hold, then there is a constant C = C(¯, c k , ck , α) > 0, such that (4.19) and (4.20)

p−1

n = 0, . . . , p.

Temporarily, we will assume that for each p there is a constant c k > 0, such that (A5 ) kij CΦ,p ≤ ck . This assumption will be removed below in Theorem 4.3. Now, to obtain estimates for Φ, we ﬁrst need to derive estimates of derivatives and jumps for J. Lemma 4.3. Let U be the mcG(q) or mdG(q) solution of (1.1), and let πu be an interpolant, of order q, of the exact solution u of (1.1). If assumptions ¯ (A1)–(A5) hold, then there is a constant C = C(¯, c k , α) > 0, such that q (4.17) and (4.18) dp J (πu, U ) dtp

q ¯ ≤ Ckij+1−p f q +2 ¯ T ,

˜ Φ(p)

L∞ (T ,l∞ )

p ≤ CCΦ,p−1 Φ

L∞ (T ,l∞ ) ,

p = 1, . . . , q + 1, ¯

dp J (πu, U ) dtp

˜ [Φ(p) ]tij

l∞

L∞ (T ,l∞ )

≤C f

p+1 T ,

q ¯ ≤ Ckij+2−p f

q +2 ¯ T

Φ

L∞ (T ,l∞ )

+C

n=0

f

p−n T

[Φ(n) ]tij

l∞ ,

p = 0, . . . , q , ¯

p = 1, . . . , q , for each local interval I ij , where tij is an internal node of the ¯ time slab T . p = 0, . . . , q − 1, ¯ ˙ ˜ Proof. By deﬁnition, Φ = −f ∗ (Φ, ·) = −J(πu, U ) Φ. It follows that d ˜ Φ(p) = − p−1 J Φ = − dt and so, by Lemma 4.3,

p−1 p−1 p−1 n=0

ti,j−1 l ∞

for each local interval Iij , where ti,j−1 is an internal node of the time slab T. Proof. Since f is autonomous by assumption (A3), we have

1

p−1 n

dp−1−n J dtp−1−n

Φ(n) ,

J(πu(t), U (t)) =

0

∂f (sπu(t) + (1 − s)U (t)) ds = ∂u u (n) (t)

1 0

∂f (xs (t)) ds, ∂u f n by (1.1), T (n) x s (t) l∞ ≤

with xs (t) = sπu(t)+(1−s)U (t). Noting that l∞ ≤ C it follows by Theorem 4.1 and an interpolation estimate, that C f n , and so (4.17) follows by assumption (A4). T

˜ Φ(p) (t)

l∞

≤C

f

n=0

p−n n T CΦ,p−1

Φ

L∞ (T ,l∞ )

p ≤ CCΦ,p−1 Φ

L∞ (T ,l∞ ) ,

ESTIMATES OF DERIVATIVES AND JUMPS

15

16

ANDERS LOGG

**for 0 ≤ p − 1 ≤ q. To estimate the jump at t = t ij , we use Lemma 3.2, ¯ Lemma 4.3, and assumption (A5 ), to obtain
**

p−1

˜ [Φ(p) ]t

l∞

≤C

n=0

**‚ « – X ‚»„ dp−1−n ‚ Φ(n) ‚ dtp−1−n J
**

p−1 “ X q+1−(p−1−n) ¯ kij p−1

t l∞

≤C

f

q+2 n ¯ CΦ,p−1 T

‚ ‚ ‚ ‚

**˜ for p = 0, . . . , r + 1. To estimate e0 , we note that e0 = 0 for p = 0, since Φ is continuous. For p = 1, . . . , q , Lemma 4.4 gives ¯ (4.22)
**

p−1 q ¯ ˜ (p) |e0 | = |[Φi ]t | ≤ Ckij+2−p f q +2 ¯ T

Φ

L∞ (T ,l∞ )

+C

n=0

f

p−n T

|[Φ(n) ]t |

l∞ .

Φ

L∞ (T ,l∞ )

+ f

p−1

p−n T

[Φ

(n)

]t

l∞

n=0

”

q+2−p ¯ f ≤ Ckij

q+2 ¯ T

n=0

X Φ

n n kij CΦ,p−1 Φ

L∞ (T ,l∞ ) p−1 X

+C

n=0

X

f

p−n T

[Φ(n) ]t

l∞

**Using assumption (A2), and the estimates for e + , e0 , and e− , we obtain for r = 0 and p = 0, ˙ ˜ |[Φi ]t | ≤ Cki,j+1 Φi ˙ ˜ + 0 + Ckij Φi
**

L∞ (T ,l∞ )

≤

q+2−p ¯ Ckij

f

q+2 ¯ T

L∞ (T ,l∞ )

+C

f

p−n T

[Φ(n) ]t

l∞ ,

n=0

L∞ (Ii,j+1 )

L∞ (Iij ) L∞ (T ,l∞ ) .

for 0 ≤ p − 1 ≤ q − 1. ¯ Our next task is to estimate the jump in the discrete dual solution Φ itself, corresponding to Lemma 4.2. Lemma 4.5. (Jump estimates for Φ) Let Φ be the mcG(q) ∗ or mdG(q)∗ solution of (1.3) with g = 0. If assumptions (A1)–(A5) and (A5 ) hold, then there is a constant C = C(¯, ck , ck , α) > 0, such that q (4.21) [Φ(p) ]tij

l∞ r+1−p r+1 ≤ Ckij CΦ,r Φ L∞ (T ,l∞ ) ,

≤ C(α−1 + 1)kij CΦ,0 Φ

= Ckij CΦ,0 Φ

q ¯ ¯ For r = 0 and p = 1, it follows by (4.22), noting that k ij+2−1 f q+2 ≤ T C f T = CCΦ,0 , and assumption (A2), that |e0 | ≤ CCΦ,0 Φ L∞ (T ,l∞ ) + C f T [Φ]t l∞ ≤ CCΦ,0 Φ L∞ (T ,l∞ ) , and so,

p = 0, . . . , r + 1,

˙ ˙ ˜ |[Φi ]t | ≤ C Φi

L∞ (Ii,j+1 )

+ CCΦ,0 Φ

L∞ (T ,l∞ )

˙ ˜ + C Φi

L∞ (Iij )

≤ CCΦ,0 Φ

L∞ (T ,l∞ ) .

with r = 0, . . . , q −1 for the mcG(q) method and r = 0, . . . , q for the mdG(q) ¯ ¯ method, for each local interval Iij , where tij is an internal node of the time slab T . Proof. The proof is by induction. We ﬁrst note that at t = t ij , we have

[Φi ]t

(p)

Thus, (4.21) holds for r = 0. Assume now that (4.21) holds for r = r −1 ≥ 0. ¯ Then, by Lemma 4.4 and assumption (A5), it follows that

r ¯ r +1 ¯ |e− | ≤ Ckij+1−p CΦ,¯ Φ r r L∞ (T ,l∞ ) m−1 q ¯ kij+2−m f q+2 ¯ T

= ≡

e+ + e0 + e− .

“

” “ ” “ ” (p) (p) ˜ (p) ˜ (p) ˜ (p) ˜ (p) Φi (t+ ) − Φi (t+ ) + Φi (t+ ) − Φi (t− ) + Φi (t− ) − Φi (t− )

+C

x∈Nij m=1

m−p kij

Φ

L∞ (T ,l∞ )

+

n=0 q+2 ¯ T

f Φ

m−n T

[Φ(n) ]t

l∞

˜ By Theorem 2.1 (or Theorem 2.2), Φ is an interpolant of Φ; if Φ is the [qij ] ˜ mcG(q)∗ solution, then Φi is the πcG∗ -interpolant of Φi on Iij , and if Φ is [q ] ˜ the mdG(q)∗ solution, then Φi is the π ij∗ -interpolant of Φi . It follows that

dG r r+1−p ˜ (r+1) Φi |e− | ≤ Ckij L∞ (Iij ) +C x∈Nij m=1 m−p ˜ kij |[Φi (m)

r ¯ r +1 ¯ ≤ Ckij+1−p CΦ,¯ Φ r

L∞ (T ,l∞ )

+C

q ¯ kij+2−p f

L∞ (T ,l∞ )

+

f

r r m−n m−p+(¯−1)+1−n (¯−1)+1 kij CΦ,¯−1 r T L∞ (T ,l∞ ) + C

Φ

L∞ (T ,l∞ ) q+2 ¯ T

]x |,

p = 0, . . . , r+1,

r ¯ r +1 ¯ ≤ Ckij+1−p CΦ,¯ Φ r

q ¯ kij+2−p f

+ ≤

r ¯ kij+1−p+m−1−n r ¯ r +1 ¯ Ckij+1−p CΦ,¯ r

f

m−1−n r +1 ¯ CΦ,¯−1 T r

Φ

L∞ (T ,l∞ )

**where r = 0, . . . , q − 1 for the mcG(q)∗ solution and r = 0, . . . , q for the ¯ ¯ mdG(q)∗ solution. Similarly, we have
**

r

Φ

L∞ (T ,l∞ ) .

**Similarly, we obtain the estimate
**

r ¯ r+1 ¯ |e+ | ≤ Ckij+1−p CΦ,¯ Φ r L∞ (T ,l∞ ) .

|e+ | ≤

r+1−p Cki,j+1

˜ (r+1) Φi

L∞ (Ii,j+1 )

+C

x∈Ni,j+1 m=1

m−p ˜ (m) ki,j+1 |[Φi ]x |,

ESTIMATES OF DERIVATIVES AND JUMPS

17

18

ANDERS LOGG

**Again using the assumption that (4.21) holds for r = r − 1, we obtain ¯
**

q ¯ |e0 | ≤ Ckij+2−p f p−1 q +2 ¯ T

**where we have used the fact that
**

m−p q ¯ kij kij+2−m f q +2 ¯ T

Φ

L∞ (T ,l∞ )

= f

p T

(kij f

T

p ¯ )q+2−p ≤ CCΦ,p−1 ,

+C

n=0

f

r r p−n (¯−1)+1−n (¯−1)+1 CΦ,¯−1 r T kij

Φ

L∞ (T ,l∞ )

**and where C = C(¯, ck , ck , α). Continuing now in the same way as in the q proof of Theorem 4.1, we obtain Φ(p)
**

L∞ (T ,l∞ )

p−1

≤

r ¯ r +1 ¯ Ckij+1−p CΦ,¯−1 r

Φ

L∞ (T ,l∞ )

1+

n=0

(kij f

p−1−n T) L∞ (T ,l∞ ) . L∞ (T ,l∞ ) ,

for C = C(¯, ck , α), which (trivially) holds also when p = 0. q Having now removed the additional assumption (A5 ), we obtain the following version of Lemma 4.5. and Theorem 4.4. (Jump estimates for Φ) Let Φ be the mcG(q) ∗ or mdG(q)∗ solution of (1.3) with g = 0. If assumptions (A1)–(A5) hold, then there is a constant C = C(¯, ck , α) > 0, such that q (4.24) for the (4.25) [Φ(p) ]tij mcG(q)∗ [Φ(p) ]tij

l∞ q ¯ ≤ Ckij−p f q ¯ T

≤C f

p T

Φ

L∞ (T ,l∞ ) ,

p = 1, . . . , q , ¯

r ¯ r +1 ¯ ≤ Ckij+1−p CΦ,¯−1 Φ r (p)

L∞ (T ,l∞ )

r ¯ r+1 ¯ ≤ Ckij+1−p CΦ,¯ Φ r

r ¯ r +1 ¯ We thus have |[Φi ]t | ≤ |e+ | + |e0 | + |e− | ≤ Ckij+1−p CΦ,¯ Φ r so (4.21) follows by induction.

Next, we prove an estimate for the derivatives of the discrete dual solution Φ, corresponding to Theorem 4.1. Theorem 4.3. (Derivative estimates for Φ) Let Φ be the mcG(q) ∗ or mdG(q)∗ solution of (1.3) with g = 0. If assumptions (A1)–(A5) hold, then there is a constant C = C(¯, ck , α) > 0, such that q (4.23) Φ(p)

L∞ (T ,∞)

Φ

q +1 ¯ T

L∞ (T ,l∞ ) ,

p = 0, . . . , q − 1, ¯ p = 0, . . . , q , ¯

solution, and

l∞ q ¯ ≤ Ckij+1−p f

Φ

L∞ (T ,l∞ ) ,

≤C f

p T

Φ

L∞ (T ,l∞ ) ,

p = 0, . . . , q . ¯

for the mdG(q)∗ solution. This holds for each local interval I ij , where tij is an internal node of the time slab T . 4.4. A special interpolation estimate. In the derivation of a priori error estimates, we face the problem of estimating the interpolation error πϕ i −ϕi on a local interval Iij , where ϕi is deﬁned by

N

**˜ Proof. By Theorem 2.1 (or Theorem 2.2), Φ is an interpolant of Φ, and so, by Theorem 5.2 in [3], we have Φi
**

(p) L∞ (Iij )

˜ = (π Φi )(p) ˜ (p) ≤ C Φi

L∞ (Iij ) p−1

(4.26)

m−p ˜ kij |[Φi (m)

ϕi = (J (πu, u)Φ)i =

l=1

Jli (πu, u)Φl ,

i = 1, . . . , N.

L∞ (Iij )

+C

x∈Nij m=1

]x |,

**for some constant C = C (¯) > 0. For p = 1, we thus obtain the estimate q ˙ Φi
**

L∞ (Iij )

˙ ˜ ≤ C Φi

L∞ (Iij )

= C fi∗ (Φ) ≤C f

T

L∞ (Iij )

=C J Φ

L∞ (Iij )

Φ

L∞ (T ,l∞ ) ,

by assumption (A4), and so (4.23) holds for p = 1. For p = 2, . . . , q , assuming that (A5 ) holds for CΦ,p−1 , we use Lemma ¯ 4.4, Lemma 4.5 (with r = p − 1) and assumption (A2), to obtain

Φi

(p) L∞ (Iij ) p−1 p ≤ CCΦ,p−1 Φ m−p kij x∈Nij m=1 L∞ (T ,l∞ ) m−1 q ¯ kij+2−m q+2 ¯ T m−n T

We note that ϕi may be discontinuous within Iij , if other components have nodes within Iij , see Figure 2, since then some Φl (or some Jli ) may be discontinuous within Iij . To estimate the interpolation error, we thus need to estimate derivatives and jumps of ϕ i , which requires estimates for both Jli and Φl . In Lemma 4.3 we have already proved an estimate for J when f is linearized around πu and U , rather than around πu and u as in (4.26). Replacing U by u, we obtain the following estimate for J . Lemma 4.6. Let πu be an interpolant, of order q , of the exact solution ¯ u of (1.1). If assumptions (A1)–(A5) hold, then there is a constant C = C(¯, ck , α) > 0, such that q (4.27) and (4.28) dp J (πu, u) dtp

q ¯ ≤ Ckij+1−p f q +2 ¯ T ,

+C ≤ ≤ ≤

p CCΦ,p−1 p CCΦ,p−1 p CCΦ,p−1

f

Φ f

L∞ (T ,l∞ )

+

n=0

f

[Φ(n) ]x Φ

l∞

dp J (πu, u) dtp

L∞ (T ,l∞ )

≤C f

p+1 T ,

p = 0, . . . , q , ¯

Φ Φ Φ

L∞ (T ,l∞ ) L∞ (T ,l∞ )

+C +

m−p kij

m−n (p−1)+1−n (p−1)+1 kij CΦ,p−1 T

L∞ (T ,l∞ )

p CCΦ,p−1

Φ

L∞ (T ,l∞ )

(kij f

T

)

m−n

L∞ (T ,l∞ ) ,

ti,j−1 l ∞

p = 0, . . . , q − 1, ¯

Proof. If assumptions (A1)–(A5) hold.3. This holds for each local interval I ij within the time slab T . (Estimates for ϕ) Let ϕ be deﬁned as in (4. .4. to obtain p |[ϕi ]x | = ti. such that q (4. then there is a constant C = C(¯.7. p = 0. and Lemma 4. .l∞ ) ∀x ∈ Nij . [qij −2] together with Lemma 4. Theorem 4. See proof of Lemma 4. we obtain one extra power of kij f T .31).3 and Lemma 4. c k . c k .6. we obtain Φl (t) ϕi (p) L∞ (Iij ) p and so. n=0 n dtp−n Proof.6. where ti. Using the interpolation estimates of [3]. . qij = q ≥ 2. together with Lemma 4. ϕi − ϕ i L∞ (Iij ) ≤ Ckijij f q qij +1 T Φ L∞ (T . Lemma 4.26).31) ij πcG [q −2] ≤C f p+1 T Φ L∞ (T .l∞ ) n=0 L∞ (T . Theorem 4.l∞ ) f n=0 (p) p+1 T Φ L∞ (T . (Interpolation estimates for ϕ) Let ϕ be deﬁned as in (4.7.l∞ ) .32) ϕi − ϕ i L∞ (Iij ) ≤ Ckijij q −1 f qij T Φ L∞ (T . ¯ and (4.8. we have ϕi = Theorem 4. then Φl may be discontinuous within Iij .l∞ ) . and (4. Proof. .u) (n) Φ .l∞ ) .2. causing ϕi to be discontinuous within Iij . we use Lemma 3.l∞ ) =C f p+1 T Φ L∞ (T . α) > 0. with r = q ij −2 and p = 0. p = 0.j−1 is an internal node of the time slab T. qij − 1. then there is a constant C = C(¯.2 in [3]. ¯ for each local interval Iij within the time slab T .29) ϕi (p) L∞ (Iij ) ≤ Ckijij for the mcG(q) method.30) r −p (p) f |[ϕi ]x | ≤ Ckijij ij πdG [q −1] rij +1 T Φ L∞ (T . Diﬀerentiating. .26). . .ESTIMATES OF DERIVATIVES AND JUMPS 19 20 ANDERS LOGG (p) p p dp−n J (πu. Lemma 4. we now obtain the following important interpolation estimates for ϕ. If assumptions (A1)–(A5) hold. by ≤C =C f n=0 p (p−n)+1 T f n T Φ L∞ (T . PSfrag replacements Φi (t) To estimate the jump in ϕi . we now obtain the following estimates for ϕ. To prove (4.6 and the estimates for Φ derived in the previous section. α) > 0. For the mdG(q) method. qij . q such that (4. .l∞ ) . If some other component l = i has a node within Iij . to obtain the following bound for π cG ϕi − with rij = qij for the mcG(q) method and rij = qij + 1 for the mdG(q) method.j−1 Iij tij ≤C (p) n=0 p n=0 p dp−n J Φ(n) n dtp−n (kijij q +1−(p−n) p x ≤C f Φ n T n=0 dp−n J Φ(n) dtp−n x f f qij +2 T qij T ) Figure 2. + f ≤ (p−n)+1 qij −n kij T L∞ (T . (kij f T )n+1 + (kij f T )p−n for each local interval Iij .7.l∞ ) . .3. From Lemma 4. qij = q ≥ 1. we use Theorem 5.l∞ ) p q −p Ckijij q −p f f qij +1 T qij +1 T Φ Φ L∞ (T .

l∞ ) p+1 ≤ CA . such that for each p. We make the following basic assumptions: Given a time slab T . . . . n = 0.p−1 Φ L∞ (T . we obtain [U (p) ]ti.1. let C U. . By (2.p . we deﬁne CU. such that (B4) kij CA ≤ ck .l∞ ) . ¯ Similarly.l∞ ) .l∞ ) p ≤ CCU. We further assume that there is a constant c k > 0.p−1 U n=0 L∞ (T . .ESTIMATES OF DERIVATIVES AND JUMPS 21 22 ANDERS LOGG ϕi L∞ (Iij ) : qij −2 (q −2)+1 ((qij −2)+1) L∞ (Iij ) (m) 5. A and its derivatives are bounded. Estimates for U and Φ. that p−1 ˜ U (p) L∞ (T . .l∞ ) + q Ckijij f qij +1 T Φ L∞ (T . we will assume that there is a constant ck > 0.l∞ ) n ≤ CU. We summarize the list of assumptions as follows: (B1) (B2) (B3) (B4) p−n ˜ Similarly. Temporarily. ¯ for some q ≥ 0 and some α ∈ (0. p = 0. It now follows by assumptions (B1) and (B3).l∞ ) . ˜ U (p) L∞ (T .2). l∞ .1. If assumptions (B1) and (B3) hold.l∞ ) +C x∈Nij m=0 m kij kijij q −m f Φ For p = 0.2).l∞ ) . . q + 1. such that (B3) max A(p) L∞ (T .p ≤ ck .j−1 l∞ ≤ C p−1 CA [U (n) ]ti. we have (B1) and (B2) kij > α kmn . 5. .1). ≤ Ckijij = ≤ q −1 f f f qij T qij T qij T Φ Φ Φ L∞ (T . p = 1. we introduce the following notation: For given p > 0. p = 1. Estimates of derivatives and jumps for linear problems We now derive estimates for derivatives and jumps for the multi-adaptive solutions of the linear problem (1. it follows that U = −AU .8) ˜ [U (p) ]ti.2) and deﬁne U as in (2.p ≤ ck .l∞ ) (B4 ) kij CU.p U L∞ (T . . and so p−1 A (p) L∞ (T .7) with g = 0.0 = CA . ¯ qij = qmn = q . .p−1 U L∞ (T . .l∞ ) . . . ¯ ˜ U (p) = n=0 p − 1 (p−1−n) (n) A U . q .l∞ ) ≤C p−n n CA CU. ¯ (5. then there is a constant C = C(¯) > 0. we use ˜ ˜ assumptions (B1) and (B3) to derive estimates for U and Φ. . .1. . Assuming that the problem is linear.l∞ ) p ≤ CCU. q −1 Ckijij q −1 Ckijij L∞ (T . q . the local time steps kij are small.j−1 l∞ ≤C p−n CA [U (n) ]ti. q + 1. q . such that m kij |[ϕi Ckij ij ϕi +C x∈Nij m=0 qij −2 ]x | qij +1 T (5. L∞ (T .1. n for all time slabs T . In the following lemma.7) and p−1 ij The estimate for πdG [q −1] ϕi − ϕi is obtained similarly. To simplify the estimates. . assume that A has q − 1 ¯ ¯ continuous derivatives and let CA > 0 be constant.l∞ ) L∞ (T .l∞ ) .10) ˜ [Φ(p) ]tij l∞ ≤C p−n CA [Φ(n) ]tij n=0 l∞ . ¯ (5.1). .9) and p−1 ˜ Φ(p) L∞ (T . but non-autonomous. we now obtain the following estimate for the size of the jump in function value and derivatives for U and Φ. . Furthermore. p. . the estimates are obtained in a slightly diﬀerent way compared to the estimates of the previous section. 1). (Estimates for U and Φ) Let U be the mcG(q) or mdG(q) ˜ solution of (1.p ≥ CA be a constant. ˜ ˜ Lemma 5. with kij CΦ. corresponding estimates for Φ The By Lemma 5. We similarly deﬁne the constant CΦ. .2. ˙ ˜ Proof. for Φ the mcG(q)∗ or mdG(q)∗ solution of (1. such that q (5. p = 1. . assume that for each pair of local intervals I ij and Imn within the time slab. . we obtain (5.j−1 n=0 l∞ .l∞ ) p ≤ CCΦ. the local time steps kij are semi-uniform within each time slab. . and ˜ with Φ deﬁned as in (2. p = 1.p−1 U L∞ (T . .5) U (n) L∞ (T . the local orders qij are equal within each time slab. Assumptions.j−1 n=0 ˜ follow similarly. This assumption will be removed below in Theorem 5. 5.

j−1 m=1 ]x |. q . r + 1 and r = 0. .l∞ ) ≤ CCU.l∞ ) . (Derivative estimates for U and Φ) Let U be the mcG(q) or mdG(q) solution of (1. we obtain the estimate |e − | ≤ Ckij+1−p CU. ˙ ˜ ˙ |[Ui ]t | ≤ C Ui L∞ (Iij ) ˜ Proof. Proof. .1 gives ¯ p−1 and so (5. q .¯ U r L∞ (T . we thus obtain m−p ˜ ki. (Jump estimates for U and Φ) Let U be the mcG(q) or mdG(q) solution of (1. . (5. such that q (5. . +C x∈Ni. Lemma 5. ≤ C(1 + kij CU.r U L∞ (T . The proof is by induction and follows those of Lemma 4.l∞ ) m−1 m−p kij x∈Nij m=1 L∞ (T . . Theorem 5. U is an interpolant of U and so.0 )CU.7) with g = 0.1. we obtain for r = 0 and p = 0.0 U L∞ (T .j−1 Ui L∞ (Ii. For p = 1. q . . = = e+ + e0 + e− . .¯−1 )p−1−n U r n=0 L∞ (T . to obtain the estimate p−1 r ¯ r+1 ¯ ≤ Ckij+1−p CU.¯ U r L∞ (T .l∞ ) .r Φ L∞ (T . Assume now that (5. The estimates for Φ follow similarly.0 U (p) L∞ (T .¯ U r r ¯ r+1 ¯ ≤ Ckij+1−p CU. ≤ +C m−p m−n kij CA kij CU.j−1 and tij . and the estimates for e + . .j−1 ) −1 α )kij CU.l∞ ) |e0 | = ˜ (p) |[Ui ]t | ≤C p−n CA [U (n) ]t n=0 l∞ .5.1 and (B4 ).¯−1 r (¯−1)+1 r U U L∞ (T .¯−1 r (¯−1)+1 r U L∞ (T . α) > 0. r + 1.j−1 ) L∞ (T . . .12) [Φ(p) ]tij l∞ r+1−p r+1 ≤ Ckij CΦ. and ¯ (5. q . we have r r+1−p ˜ (r+1) |e− | ≤ Cki. . .¯ r U L∞ (T .l∞ ) . . for each local interval Iij . . . .l∞ ) ¯ with r = 0.11) holds for r = 0. q . . p−1 r ¯ r+1 ¯ ≤ Ckij+1−p CU. it follows that r ¯ r ¯ r+1 ¯ |e+ | ≤ Ckij+1−p CU. then there is a constant C = C(¯.l∞ ) . . . .7) with g = 0. .0 U L∞ (T .11) holds for r = r −1 ≥ 0. that for r = 0 and p = 1.13) and (5.l∞ ) (¯−1)+1−n r n=0 m−n CA [U (n) ]t l∞ +C ]ti. then there is a constant C = C(¯. Finally. ¯ ˙ ˜ L∞ (T . p = 0. q − 1 for the mcG(q)∗ solution and r = 0.11) [U (p) Thus. ¯ p = 0. r ¯ r+1 ¯ |[Ui ]t | ≤ |e+ | + |e0 | + |e− | ≤ Ckij+1−p CU.¯ U r (p) L∞ (T .j−1 |[Ui (m) ≤ r ¯ r+1 ¯ Ckij+1−p CU.14) Φ(p) L∞ (T . If assumptions (B1)–(B4) and (B4 ) hold. Using assumption (B2).j−1 Ui L∞ (Ii. We ﬁrst note that at t = ti. where ti.ESTIMATES OF DERIVATIVES AND JUMPS 23 24 ANDERS LOGG Lemma 5. .2. .j−1 l∞ ≤ r+1−p r+1 Ckij CU. r = 0. p = 0.¯ U r we use Lemma 5. such that q (5.¯ r 1+ (kij CU. .¯ r (kij CU. “ ” “ ” “ ” (p) (p) ˜ (p) ˜ (p) ˜ (p) ˜ (p) Ui (t+ ) − Ui (t+ ) + Ui (t+ ) − Ui (t− ) + Ui (t− ) − Ui (t− ) ˜ (p) |e0 | = |[Ui ]t | ≤ C p−1 p−n CA [U (n) ]t n=0 (¯−1)+1−n r l∞ ˜ Now. ¯ Then.j−1 .l∞ ) . U L∞ (T .2). . .l∞ ) L∞ (T . by Lemma 5. and let Φ be the corresponding mcG(q) ∗ or mdG(q)∗ solution of (1.l∞ ) for p = 0.l∞ ) . .0 U ˜ (p) C Ui L∞ (Iij ) +C x∈Nij m=1 m−p ˜ (m) kij |[Ui ]x |.l∞ ) = Ckij CU. . we note that e0 = 0 for p = 0. . since U is continuous. we have [Ui ]t (p) r ¯ r+1 ¯ Ckij+1−p CU.l∞ ) p ≤ CCA U p ≤ CCA Φ L∞ (T . it follows by Theorem 5. . ck .l∞ ) . ˜ To estimate e0 . It now follows by assumption (B4). . . are internal nodes of the time slab T . ˙ ˜ |[Ui ]| ≤ Ckij Ui ≤ C(1 + L∞ (Iij ) + 0 + Cki. q for the ¯ mdG(q)∗ solution. .2 in [3].2). Similarly. Note that the second sum starts at ¯ ˜ m = 1 rather than at m = 0. that (p) ˜ Ui L∞ (Iij ) = (π Ui )(p) L∞ (Iij ) is bounded by p−1 + CCA [U ]t l∞ ˙ ˜ + C Ui L∞ (Ii.l∞ ) . . L∞ (T . . Since U is an interpolant of U .j−1 ) Summing up. and let Φ be the corresponding mcG(q) ∗ or mdG(q)∗ solution of (1. by Theorem 5. . p = 0.2 and Lemma 4. since U is continuous.l∞ ) |e+ | ≤ r+1−p Ckij ˜ (r+1) L (I ) Ui ∞ ij +C x∈Nij m=1 m−p ˜ (m) kij |[Ui ]x |. respectively.¯)m−1−n r r ¯ r+1 ¯ Similarly. .l∞ ) . ck .11) follows by induction. it follows that r ≤C p−n CA kij n=0 CU.l∞ ) . and e− . . . ck . . α) > 0. e0 . . r + 1.2 in [3].1 and assumption (B4 ). If assumptions (B1)–(B4) hold.

If assumptions (B1)–(B4) hold. q . . assuming that (B4 ) holds for CU. . we now obtain the following interpolation estimates for ϕ. q .ESTIMATES OF DERIVATIVES AND JUMPS 25 26 ANDERS LOGG for some constant C = C (¯). To estimate the jump in ϕi . . As for the general non-linear problem. . ¯ q ¯ q ¯ ≤ Ckij−p CA+1 (kij CA )p−n Φ n=0 L∞ (T .15) [U (p) ]ti. . .l∞ ) . It now follows in the same way as in the proof of q Theorem 4. .l∞ ) . . +C ≤ ≤ m−p m−n kij CA kij CU. .1. . that U (p) L∞ (T .p−1 U n=0 m−n CA [U (n) ]x l∞ p−1 (5.l∞ ) p ≤ CCA U L∞ (T . if Iij contains nodes for other components.l∞ ) m−1 m−p kij x∈Nij m=1 p ≤ CCU. ¯ (p−n)+1 q −n q ¯ ¯ kij CA p L∞ (T . . ck . . we need to estimate the interpolation error πϕ i − ϕi on a local interval Iij . L∞ (T .18). .3. The estimate q for Φ follows similarly.j−1 and tij .1. 5.1. where C = C(¯.l∞ ) .7) with g = 0. .l∞ ) p+1 = CCA Φ L∞ (T . we use Theorem 5.2.20) r −p r +1 (p) Φ |[ϕi ]x | ≤ Ckijij CAij L∞ (T .l∞ ) . q . (Estimates for ϕ) Let ϕ be deﬁned as in (5. Theorem 5. Lemma 5.17) [Φ(p) ]tij l∞ q ¯ q ¯ ≤ Ckij+1−p CA+1 Φ L∞ (T . p = 0.j−1 l∞ q ¯ q ¯ ≤ Ckij+1−p CA+1 U L∞ (T .13) holds for p = 1. are internal nodes of the time slab T . α). . If assumptions (B1)–(B4) hold.l∞ ) . p = 0. to obtain p (p) |[ϕi ]x | ≤ C ≤C (p) n=0 p n=0 |(A CA (p−n) p [Φ(n) ]x )i | ≤ C Φ CA n=0 (p−n)+1 [Φ(n) ]x l∞ p = 0. ck .l∞ ) Furthermore. we thus obtain the estimate q ˙ Ui L∞ (Iij ) ˙ ˜ ≤ C Ui L∞ (Iij ) = C (AU )i L∞ (Iij ) ≤ C CA U L∞ (T . . For p = 1. then there is a constant C = C(¯.l∞ ) p CCU. . . N. where ti. α) > 0. Diﬀerentiating ϕi . qij − 1. c k .l∞ ) for the mcG(q)∗ solution and (5. ¯ for the mcG(q) method. q ¯ q ¯ ≤ Ckij−p CA+1 Φ p = 0. . and so. . . Lemma 5. we obtain ϕi (p) L∞ (Iij ) ≤C CA n=0 (p−n)+1 n CA Φ L∞ (T . with rij = qij for the mcG(q) method and rij = qij + 1 for the mdG(q) method. and let Φ be the corresponding mcG(q) ∗ or mdG(q)∗ solution of (1.16) [Φ(p) ]tij l∞ q ¯ q ¯ ≤ Ckij−p CA Φ L∞ (T . which (trivially) holds also when p = 0. Proof. .2 (with r = p − 1) and assumption (B2).p−1 . ck .l∞ ) L∞ (T . α).p−1 (p−1)+1 U L∞ (T . we obtain one extra power of kij CA . i = 1.p−1 U U L∞ (T . α) > 0. .l∞ ) ∀x ∈ Nij . For p = 2. .3. by Theorem 5.3 and the interpolation estimates from [3]. qij .18) ϕi = (A Φ)i = l=1 Ali Φl . Using Lemma 5. ck . then there is a constant C = C(¯. . This holds for each local interval I ij . +C L∞ (T . q . . A special interpolation estimate. such that q (5.2). As noted above.l∞ ) . . we have ϕi (p) p = 1. we obtain the following version of Lemma 5. we use Lemma ¯ 5. We ﬁrst prove the following estimates for ϕ. ¯ = dp (A Φ)i = dtp p p n=0 p (A n (p−n) Φ(n) )i for C = C(¯. 1+ (kij CA ) m−n and (5.p−1 U L∞ (T .2. we have (5. . . for the mdG(q)∗ solution.19) ϕi (p) L∞ (Iij ) p+1 ≤ CCA Φ L∞ (T . respectively.l∞ ) . . .l∞ ) .p−1 p CCU. . where ϕi is now deﬁned by N and so (5. .2. (Jump estimates for U and Φ) Let U be the mcG(q) or mdG(q) solution of (1. Having now removed the additional assumption (B4 ). q .l∞ ) .l∞ ) (p−1)+1−n p = 0. to obtain Ui (p) L∞ (Iij ) p ≤ CCU. This holds for each local interval I ij within the time slab T . For the mdG(q) method. ϕi may be discontinuous within Iij . such that q (5.

48 (2004). Sci. 2004–02. [3] Rep. (Interpolation estimates for ϕ) Let ϕ be deﬁned as in (5. Comput. Proof. . ¯ [q −1] L∞ (Iij ) for each local interval Iij within the time slab T . Multi-adaptive Galerkin methods for ODEs IV: A priori error estimates.22) ij πdG ij πcG [q −2] ϕi − ϕ i ϕi − ϕ i L∞ (Iij ) ≤ Ckijij q q −1 CAij Φ Φ q L∞ (T . 2004. 25 (2003). Anal.ESTIMATES OF DERIVATIVES AND JUMPS 27 Lemma 5. Interpolation estimates for piecewise smooth functions in one dimension.l∞ ) . . See proof of Lemma 4. [1] A. 339–354. Multi-adaptive Galerkin methods for ODEs III: Existence and stability. qij = q ≥ 2.18). . then there is a constant C = C(¯.21) and (5. SIAM J. pp.. Anal. q such that (5. Numer. Tech. Multi-adaptive Galerkin methods for ODEs I. Comput. . Sub[5] mitted to SIAM J. If assumptions (B1)–(B4) hold. (2004). Multi-adaptive Galerkin methods for ODEs II: Implementation and applications. 24 (2003).. pp.8. 1119–1141. References ≤ Ckijij CAij q +1 L∞ (T .. Numer. Submitted to SIAM J. [6] .l∞ ) . Logg. ¯ qij = q ≥ 1. [4] .4. Sci. Chalmers Finite Element Center Preprint Series. (2004). c k . pp. 1879–1902.. α) > 0. Applied Numerical Mathematics. Multi-adaptive time-integration. [2] SIAM J.

We ﬁrst present the user interface of the multi-adaptive solver in Section 2.j−1 . The following notation is used throughout this paper: Each component Ui (t). Multi-adaptive Galerkin methods are extensions of the standard continuous and discontinuous Galerkin methods for the numerical solution of initial value problems for ordinary or partial diﬀerential equations. which means that anyone is free to use or modify the software.2. This will be made possible through the combination of an eﬃcient forward integrator. The multi-adaptive solver is actively developed by the authors. provided these rights are preserved. but has been completely rewritten for DOLFIN. mdgq. with the intention of providing the next standard for the solution of initial value problems. . . . but with technical details left out. 2004. Comments and contributions are welcome. we present numerical results for the bistable equation as an example of multi-adaptive time-stepping for a partial diﬀerential equation. For a detailed description of the multi-adaptive Galerkin methods. This is illustrated in Figure 1. 1. 1. Key words and phrases. t). The source code of DOLFIN. Outline of the paper. including numerous example programs. T ] into M i subintervals. 15. tij ]. i = 1.1) is a piecewise polynomial on a partition of (0.j−1 < tij ≤ Tn }. we refer the reader to [14. . 12]. N . individual time steps.j−1 . discontinuous Galerkin. In Section 4. Alternatively. 16. we shall assume that the interval (0. T ] → RN a given function that is Lipschitz-continuous in u and bounded. DOLFIN is licensed under the GNU General Public License [8].1. Date: April 15. we refer to [14] or [16] for the deﬁnition of the methods. which is the C++ implementation of the new open-source software project FEniCS [3] for the automation of Computational Mathematical Modeling (CMM).chalmers. ˙ u(0) = u0 . On each subinterval I ij . algorithms.phi. User interface Potential usage of the multi-adaptive solver ranges from a student or teacher wanting to solve a ﬁxed ODE in an educational setting. the multi-adaptive methods allow individual time steps to be used for diﬀerent components or in diﬀerent regions of space. and the length of the subinterval is given by the local time step k ij = tij − ti.se/dolfin/. Subinterval j for component i is denoted by I ij = (ti. 2. 1. 17. to a PDE package using it as an internal solver module.4. and a simple and intuitive user interface. continuous Galerkin. Implementation. The user interface of the Tn = {Iij : Tn−1 ≤ ti. An example is given for the solution of a nonlinear partial diﬀerential equation in three dimensions. 1. We now provide these details. In particular. before we discuss the algorithms of multiadaptive time-stepping in Section 3. regulation of the individual time steps. Chalmers University of Technology. 13]. C++. T ]. SE–412 96 G¨teborg. The algorithms presented in this paper are implemented in the multi-adaptive ODE-solver of DOLFIN [11. We present algorithms for multi-adaptive time-stepping.2 JOHAN JANSSON AND ANDERS LOGG ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING JOHAN JANSSON AND ANDERS LOGG Abstract. In the current paper. local time steps. Sweden. Multi-adaptivity. and the automatic generation of dual problems. The multi-adaptive solver in DOLFIN is based on the original implementation Tanganyika. . email : logg@math. Ui |Iij ) as an element. automatic and reliable error control. < TM = T .1) u(t) = f (u(t). u0 ∈ RN a given initial value. Obtaining the software. is available at the web page http://www. implementation. Department of Computational Mathematics. mcgq. ODE. 1. of the approximate m(c/d)G(q) solution U (t) of (1.chalmers. adaptive ﬁxed point iteration on time slabs.net. including the recursive construction of time slabs. T ] is partitioned into blocks between certain synchronized time levels 0 = T 0 < T1 < . Some of these aspects are discussed in [15] and [13]. T ] → RN is the solution to be computed. and f : R N × (0. t ∈ (0. 13] introduced the multi-adaptive Galerkin methods mcG(q) and mdG(q) for the approximate (numerical) solution of ODEs of the form (1. email : johanjan@math. . o 1 . Anders Logg. presented in [15]. T > 0 a given ﬁnal time.se. We refer to the set of intervals Tn between two synchronized time levels Tn−1 and Tn as a time slab: We denote the length of a time slab by K n = Tn − Tn−1 . Ui |Iij is a polynomial of degree qij and we refer to (Iij . Johan Jansson. the source code can be obtained through anonymous CVS as explained on the web page.3. 17. where u : [0.se. 16. and each new release is announced on freshmeat. In particular. Introduction We have earlier in a sequence of papers [14.chalmers. Notation. Furthermore. 15. we discuss important aspects of the implementation of multi-adaptive Galerkin methods.

In the standard case. Multi-adaptive time-stepping We present below a collection of the key algorithms for multi-adaptive time-stepping. . T ]. In most cases. . Starting at t = 0.3. In this example. adaptive ﬁxed point iteration is performed on the time slab until the discrete equations given by the mcG(q) or mdG(q) method have converged. Individual partitions of the interval (0. we have N = 6 and M = 4. Tn = T . This algorithm ﬁrst estimates the individual . This is useful in interactive applications. where the righthand side f of (1. can be used as the main component of an adaptive algorithm with automated error control of the computed solution (Algorithm 2). Algorithm 1 U = Integrate(ODE) t←0 while t < T do {time slab. which creates a time slab covering an interval [Tn−1 .1) needs to be modiﬁed in each step of the integration. we present in Figure 2 and Table 1 the implementation of the harmonic oscillator u1 = u2 . For each time slab. that can be used to integrate the solution one time slab at a time. CreateTimeSlab returns the end time Tn of the created time slab and the integration continues until Figure 2. multi-adaptive solver is speciﬁed in terms of an ODE base class consisting of a right hand side f . a time interval [0. T ) Iterate(time slab) end while In DOLFIN. Tn ] such that Tn ≤ T . The class TimeStepper also provides the alternative interface TimeStepper::step(). t} ← CreateTimeSlab({1. As an example. N }.1.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 3 4 JOHAN JANSSON AND ANDERS LOGG Iij PSfrag replacements i t 0 kij ti. 1).1) u2 = −u1 . The end time T is given as an argument to CreateTimeSlab. UML class diagram showing the base class interface of the multi-adaptive ODE-solver together with a subclass representing the ODE (2. .1). Algorithm 1. . T ]. which can be used in two diﬀerent ways (see Table 2). the function TimeStepper::solve() is called to integrate the given ODE on the interval [0.j−1 tij Tn−1 Kn Tn T Figure 1. t. Algorithm 1 is implemented by the class TimeStepper. 3. Elements between common synchronized time levels are organized in time slabs. To solve an ODE. 10] with initial value u(0) = (0. and initial value u 0 . General algorithm. the algorithm creates a sequence of time slabs until the given end time T is reached. the user implements a subclass which inherits from the ODE base class. we present simpliﬁed versions of the algorithms with focus on the most essential steps. ˙ on [0. The general multi-adaptive time-stepping algorithm (Algorithm 1) is based on the algorithm CreateTimeSlab (Algorithm 3) and the algorithms for adaptive ﬁxed point iteration on time slabs discussed below in Section 3. The algorithms are given in pseudo-code and where appropriate we give remarks on how the algorithms have been implemented using C++ in DOLFIN. The basic forward integrator. T ] for different components. ˙ (2. as shown in Figure 2. 3.

Note that C++ indexing starts at 0. Recursive construction of time slabs. To create a time slab. class TimeStepper { TimeStepper(ODE ode. Algorithm 4 for the partition of components can be implemented eﬃciently using the function std::partition(). Sketch of the C++ implementation of the harmonic oscillator (2. and solved using Algorithm 1. which we refer to as an element group. stability factors {Si (T )}N . which means in particular that the element for the component with the smallest time step is created ﬁrst. int i) { if (i == 0) return u(1).1) is solved using Algorithm 1. but with diﬀerent time steps and. . In each step of Algorithm 1. 5.) The preliminary estimates for the stability factors can be based on previous experience.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 5 6 JOHAN JANSSON AND ANDERS LOGG Harmonic::Harmonic : ODE(2) { T = 10. Note that the group of recursively nested time slabs for components in group I0 is created before the element group containing elements for components in group I1 . } real Harmonic::f(Vector u. . a new time slab is created between two synchronized time levels T n−1 and Tn .e. if (i == 1) return 1. The recursive construction simpliﬁes the implementation. we ﬁrst compute the desired time steps for all components as discussed below in Section 3. } real Harmonic::u0(int i) { if (i == 0) return 0. We organize the recursive construction of time slabs as described by Algorithms 3. which together with the local residuals deteri=1 mine the multi-adaptive time steps. When the solution of the dual problem has been computed. and a possibly empty list of time slabs. Algorithm 2 U = Solve(ODE. Function u). An ODE of the form (1. . which is part of the Standard C++ Library. but usually we take S i (T ) = 1 for i = 1. A threshold θK is then computed based on the maximum time step K and a ﬁxed parameter θ controlling the density of the time slab. i. For each component in the group with large time steps. the stability factors {S i (T )}N and the error estimate can be i=1 computed. static void solve(ODE ode.7. Sketch of the C++ interface of the multi-adaptive time-stepper.0. which in turn may contain nested groups of elements and time slabs. possibly. The tree of time slabs is thus created recursively depth-ﬁrst. if (i == 1) return -u(0).1) representing the dual problem is then created. The time slab is organized recursively as follows. } algorithm. (See [4. and orders. the primal problem (1. For a more detailed discussion of the construction.2. real step(). . It is important to note that both the primal and the dual problems are solved using the same 3. Function u). 4. } Table 2. In each iteration. if we have solved a similar problem before. methods. as discussed below in Section 3. each recursively nested time slab can be considered as a sub system of the ODE. The remaining components with small time steps are processed by a recursive application of this algorithm for the construction of time slabs. N . The components are then partitioned into two sets based on the threshold. Tn ] contains a non-empty list of elements. TOL) estimate stability factors repeat U = Integrate(ODE) create dual problem ODE∗ Φ = Integrate(ODE∗ ) compute stability factors compute error estimate E until E ≤ TOL Table 1. and 6. 2] or [14] for a discussion on duality-based a posteriori error estimation.1).5.. The root time slab covering the interval [Tn−1 . an element is created and added to the element group of the time slab. diﬀerent tolerances. real t. . This is illustrated in Figure 3. 5. Algorithm 1. see [13]. see Figure 4.

t} ← CreateTimeSlab(components. t.1) F (x) = 0 for the degrees of freedom x of the solution U on the time slab. as outlined in Table 3. Adaptive ﬁxed point iteration on time slabs. Tn ] elements ← elements ∪ element end for . Tn ) element group ← CreateElements(I1 . The root time slab recursively contains a total of nine element groups and 35 elements. 2. adaptive level 1 iteration. Each time slab contains an element group and a list of recursively nested time slabs. By modifying the condition (1. Tn−1 . T n−1 . and so on. each element group is naturally partitioned into sub systems. four diﬀerent strategies for the adaptive ﬁxed point iteration are discussed: non-stiﬀ iteration. By monitoring the convergence at Algorithm 5 time slabs = CreateTimeSlabs(components. element group} I0 ← ∅ I1 ← ∅ K ← maximum time step within components for each component do k ← time step of component if k < θK then I0 ← I0 ∪ {component} else I1 ← I1 ∪ {component} end if end for ¯ K ← minimum time step within I1 ¯ K←K Algorithm 4 {I0 . Tn ) elements ← ∅ for each component do create element for component on [Tn−1 . diﬀerent versions of the overall iterative algorithm are obtained. I1 . Tn ) time slabs ← ∅ t ← Tn−1 while t < T do {time slab. K} ← Partition(components) if Tn−1 + K < T then Tn ← Tn−1 + K else Tn ← T end if time slabs ← CreateTimeSlabs(I0 . T ) {I0 . Tn ) time slab ← {time slabs. The root time slab in the ﬁgure contains one element group of three elements and three time slabs. This system is partitioned into coupled sub systems which each take the form (3. T n−1 . or 3 ) for ﬁxed point iteration on each level of iteration. I1 . 3. the discrete equations given by the mcG(q) or mdG(q) method on each time slab are solved using adaptive ﬁxed point iteration. T n ) time slabs ← time slabs ∪ time slab end while Algorithm 6 elements = CreateElements(components.3. The recursive organization of the time slab.1). For the ﬁxed point iteration. The ﬁrst of these sub slabs contains an element group of two elements and two nested time slabs. Tn−1 . As discussed in [13]. Tn } = CreateTimeSlab(components. and adaptive level 3 iteration. one for each element within the element group. The general algorithm for nested ﬁxed point iteration on the sub systems of a time slab is based on the principle that each iteration on a given system consists of ﬁxed point iteration on each sub system. each time slab is viewed as a discrete system of equations the form (3.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 7 8 JOHAN JANSSON AND ANDERS LOGG Algorithm 3 {time slab. adaptive level 2 iteration. Similarly. one for each element group. K} = Partition(components) PSfrag replacements Tn−1 Tn Figure 3. In [13]. Tn−1 .

In DOLFIN. In the case of Algorithm 7. . Table 3 shows a simpliﬁed version of the ﬁxed point iteration. Since we sometimes need to change the strategy for the ﬁxed point iteration depending on the stiﬀness of the problem. and in Algorithm 8. . where each state has diﬀerent versions of the algorithms Converged. nmax do if Converged(system) then return end if if Diverged(system) then ChangeState() break end if Stabilize(system) d ← max(d. as shown in Algorithm 7 (Iterate) and Algorithm 8 (Update). AdaptiveIterationLevel1. the appropriate version of the adaptive ﬁxed point iteration is chosen. . stabilize the iterations. the diﬀerent levels of iteration. Both algorithms return the increment d for the degrees of freedom of the current (sub) system. Diverged. θK ¯ K K Algorithm 7 d = Iterate(system) d←0 loop for n = 1. following the design pattern for a state machine suggested in [9]. and (possibly) change strategy. The class FixedPointIteration implements Algorithm 7 and the class Iteration serves as a base class (interface) for the subclasses NonStiffIteration. the state machine is implemented as shown in Figure 5. the increment is computed as the maximum increment over the iterations for the system. Each of these subclasses implement the interface speciﬁed . the increment is computed as the l 2 -norm of the increments for the set of sub systems. the ﬁxed point iteration is naturally implemented as a state machine. and Update. AdaptiveIterationLevel2. Stabilize. The partition of components into groups of small and large time steps for θ = 1/2. Update(system)) end for end loop Algorithm 8 d = Update(system) d←0 for each sub system do di ← Iterate(sub system) d ← d + d2 i end √ for d← d Figure 4. depending on the stiﬀness of the problem. The full algorithm also needs to monitor the convergence rate. Nested ﬁxed point iteration on the time slab.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 9 10 JOHAN JANSSON AND ANDERS LOGG Iterate(time slab) while condition 3 do Update(time slab) end while Iterate(element group) while condition 2 do Update(element group) end while Iterate(element) while condition 1 do Update(element) end while PSfrag replacements Update(time slab) for each element group do Iterate(element group) end for Update(element group) for each element do Iterate(element) end for Update(element) for each degree of freedom do Update(degree of freedom) end for Table 3. . and AdaptiveIterationLevel3.

and time slab level). as described in [14. Mi . and the local residuals {rij }j=1. the local i=1 Mi . as discussed in [13]. If the convergence rate of the iterations is not satisfactory. Algorithm 9 ρ = ComputeDivergence(system) d1 ← Update(system) d2 ← Update(system) ρ2 ← d2 /d1 n←2 repeat d1 ← d 2 d2 ← Update(system) ρ1 ← ρ 2 (n−1)/n ρ2 ← ρ 2 · (d2 /d1 )1/n n←n+1 until |ρ2 − ρ1 | < tol · ρ1 ρ ← ρ2 Figure 5.4. . . . where TOL is a given tolerance.5) kij = TOL N Si (T )ri. The a posteriori error estimate takes the form N by the base class Iteration. since the residual of interval Iij is unknown until the solution on that interval has been computed. This simpliﬁes the implementation of the state machine and makes it possible to separate the implementation of the diﬀerent states.3) α= √ 1/ 2 1+ρ m = log ρ. 15]. then the appropriate damping factor α and the number of stabilizing iterations m are determined by cumulative power iteration.. 3. Cumulative power iteration. (3. In each iteration of Algorithm 7.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 11 12 JOHAN JANSSON AND ANDERS LOGG are determined according to (3. Iteration::stabilize(). To change the state.j−1 1/pij . Controlling the individual time steps. and then α and m with pij = qij for the mcG(q) method and pij = qij + 1 for the mdG(q) method.Mi p 3. i=1 j=1. The a posteriori error estimate is expressed in terms of the individual stability factors {S i (T )}N . with the type of the new object determined by the new state. .. element group level.. we should thus choose the local time step k ij according to (3. Basing the time step for interval Iij on the residual of the previous interval Ii.2) and (3.N Mi .j−1 . and Iteration::update() for each level of iteration (element level.5. j = 2. The individual and adaptive time steps kij are determined during the recursive construction of time slabs based on an a posteriori error estimate for the global error e(T ) l2 at ﬁnal time. The iteration continues until the divergence rate ρ has converged to within some tolerance tol. in particular the functions Iteration::converged().4) e(T ) l2 ≤ Si (T ) max kijij rij .N time steps {kij }j=1.. i = 1.i=1 . . the object pointed to by the pointer state is deleted and a new object is allocated to the pointer. . typically tol = 10%. N. the divergence rate ρ is ﬁrst determined by Algorithm 9. Iteration::diverged(). . . the amount of damping for the ﬁxed point iteration is determined by the algorithm Stabilize. . UML class diagram showing the implementation of the state machine for adaptive ﬁxed point iteration in DOLFIN.i=1 .

As described in [15].j−1 +sn kij ). which is solved to obtain the quadrature weights. for the mcG(q) method. Note that we need to linearize around the computed solution U .1) at time t. The n ≥ 2 Lobatto quadrature points are deﬁned on [−1. wmij (τij (t))fi (U (t). .6) in the form (3. Note that the left end-point is always a quadrature point. 1] as the two end-points together with the roots of the derivative P n−1 of the (n − 1)th-order Legendre polynomial. With both quadrature rules. The integral in (3. This deﬁnes a linear system. a standard PID controller is used to deterp mine the time steps with the goal of satisfying k ijij rij = TOL/(N Si (T )) on [0. The quadrature points are computed General order mcG(q) and mdG(q) have been implemented in DOLFIN. qij . .6. 1]. In DOLFIN.1) is not known. If r i. the system of equations on each element has a similar form. . t) denotes the Jacobian of the right-hand side f of (1. ti. respectively. kold . 1]. kmax ) The initial time steps k11 = · · · = kN 1 = K1 are chosen equal for all components and are determined iteratively for the ﬁrst time slab. and then adjusted until the local residuals are suﬃciently small for all components. the polyno[qij ] qij mial weight functions {wm }m=1 are computed as described in [14] (again by solving a linear system) and then evaluated at the quadrature points. possibly based on the length T of the time interval. Lobatto quadrature with n = q + 1 quadrature points is used. 1]. [q ] m = 1. we rewrite (3. then kij will be large.5). and as a result rij will also be large. . . T ) using the forward integrator Algorithm 1. n − 1.j−1 is small. Consequently. Typically. . qij .7) qij ξijm = ξij0 +kij n=0 ij wmn fi (U (ti. where Pn−1 and Pn are Legendre polynomials. 1]) are polynomial weight functions.j−1 )/(tij − ti. Radau quadrature with n = q + 1 quadrature points is used for the mdG(q) method. the system of equations to be solved for the degrees of freedom {ξ ijm } on each element takes the form (3. 18]. To avoid these oscillations. where J(U.7. The dual problem of (1. . . Algorithm 10 k = Controller(knew . . Newton’s method is used to ﬁnd the roots of Q n on [−1. Automatic generation of the dual problem. with τij (t) = (t − ti. T ] for i = 1. k i. qij After the quadrature points {sn }n=0 have been determined. t ∈ [0.j+1 will be small. qij . 3. t) dt. and thus the weight [q ] qij functions {wmij }m=1 need to be evaluated at a set of quadrature points {sn } ⊂ [0. 1]. with time reversed to include the right end-point. As for the mcG(q) method. Both classes take the order q as an argument to its constructor and implement the appropriate version of (3. . φ(T ) = ψ. since multi-adaptive time-stepping requires an individual controller for each component. implementing the interface speciﬁed by the common base class Element.1) for φ = φ(t) that is solved to obtain stability factors and error estimates is given by (3.j+1 and ri. The n ≥ 1 Radau points are deﬁned on [−1. since the exact solution u of (1. . which determines the new time step as the harmonic mean value of the previous time step and the time step determined by (3. N . Alternatively. . the time steps can not be based directly on (3. 1] as the roots of Qn = Pn−1 + Pn . Since Lobatto quadrature with n quadrature points is exact for polynomials of degree p ≤ 2n − 3 and Radau quadrature with n quadrature points is exact for polynomials of degree p ≤ 2n − 2.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 13 14 JOHAN JANSSON AND ANDERS LOGG However. However. both quadrature rules are exact for polynomials of degree n − 1 for n ≥ 2 and n ≥ 1.8) ˙ −φ(t) = J(U. With w(t) = φ(T − t). . T − t)w(t). T ). . then this computation is carried out only once. since that leads to oscillations in the time steps.6) is computed using quadrature.j−1 ) and where [q ] qij {wmij }m=1 ⊂ P [qij −1] ([0. The two methods are implemented by the two classes cGqElement and dGqElement. the current implementation of DOLFIN determines the time steps according to Algorithm 10. .8) as a forward ˙ problem. the time steps can be determined using control theory.5). For the mcG(q) method. we rewrite (3. as suggested in [10. . and so on.7). . these values are computed and tabulated each time a new type of element is created. t) φ(t). 1] should thus be zero for p = 0. To solve this backward problem over [0. ˙ . The size K1 of the ﬁrst time slab is ﬁrst initialized to some default value. [q ] m = 1. Multiplying these values with the quadrature weights. Implementation of general elements. Similarly. we adjust the time step knew = kij according to Algorithm 10. The quadrature points are then rescaled to [0. . and are then rescaled to the interval [0.6) ξijm = ξij0 + Iij in DOLFIN using Newton’s method to ﬁnd the roots of P n−1 on [−1. 1]. the integral of the Legendre polynomial P p on [−1. 3. .j−1 +sn kij ). with m = 0. For mdG(q). If the same method is used for all components throughout the computation. kmax ) k ← 2kold knew /(kold + knew ) k ← min(k. we have w = − φ(T − t) = J (U. .

to evaluate fi at a given time t. Each time a value is requested which is not in one of the available blocks.1) needs to be evaluated at the set of quadrature points. the sparsity pattern can be speciﬁed by a (sparse) matrix. see Algorithm 11. Storing the solution. We let Si ⊆ {1. This function is part of the Standard C++ Library and uses binary search to ﬁnd the appropriate element from the ordered sequence of elements for component Ui . In DOLFIN. each component Uj of the computed solution U on which fi depends has to be evaluated at the quadrature points. which is part of the C standard I/O library. This is of particular importance for Si = {j ∈ {1. (3. The constructor of the dual problem takes as arguments the primal problem (1. ˙ t ∈ (0. which makes it possible to solve the dual problem using the same algorithm as the primal problem. Algorithm 11 y = EvaluateRightHandSide(i. one of these blocks is dropped and the appropriate block is fetched from ﬁle. the set of components on which fi depend.. i. Since the computed solution U of the primal problem (1. During the construction of a time slab. a cache of blocks is kept in main memory to allow eﬃcient evaluation of the solution.10) Thus. . the solver ﬁrst needs to ﬁnd the element (Iij . the initial value problem for w is implemented as a subclass of the ODE base class.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 15 16 JOHAN JANSSON AND ANDERS LOGG problems of sparse structure and makes it possible to use the multi-adaptive solver for the integration of time-dependent PDEs.8) can be written as a forward problem for w in the form (3. . T ]. N } : ∂fi /∂uj = 0}. as shown in Figure 6. which means that the complexity of ﬁnding the element is logarithmic. .9) w(0) = ψ. Interpolation of the solution. For a suﬃciently large problem. .7). t) ≡ J(U. an element such that t ∈ Iij might not exists. In order for fi to be evaluated. . .t) for j ∈ Si do x(j) ← Uj (t) end for y ← fi (x. The solution is stored on disk in a temporary ﬁle created by the function tmpfile(). 3.1). Alternatively. . To evaluate Ui (t).1) is needed for the computation of the discrete solution Φ of the dual problem (3. and so (3. in which case the last element of component Ui is used and extrapolated to the given time t. the solution needs to be stored to allow U to be evaluated at any given t ∈ [0. The solution is written in blocks to the ﬁle in binary format. To ﬁnd the element (Iij . T ]. only the components U j for j ∈ Si need to be evaluated at t. During the computation. t) Figure 6. N } denote the sparsity pattern of component U i .9. Ui |Iij ) satisfying t ∈ Iij . In addition. w(t) = f ∗ (w(t). the function std::upperbound() is used. The dual problem is implemented as a subclass of the common base class for ODEs of the form (1. The righthand side f ∗ of the dual problem is automatically generated by numerical diﬀerentiation of the right-hand side of the primal problem.8). The sparsity pattern Si is automatically detected by the solver. .8. The key part of Algorithm 11 is the evaluation of a given component U i at a given time t. the appropriate component f i of the righthand side of (1. 3. To update the degrees of freedom for an element according to (3. .e. Ui |Iij ) such that t ∈ Iij . T − t) w(t). see Section 4.1) and the computed solution U of the primal problem. only one block will be kept in memory. The local polynomial Ui |Iij is then evaluated (interpolated) at the given time t. the speed of the evaluation is increased by caching the latest used element and each time checking this element before the binary search is performed. The number of blocks kept in memory depends on the amount of memory available.

1].9. we obtain an ODE initial value problem of the form (1. = 0. . From (4. In Figure 7. Solution of the bistable equation (4.1). ﬁnal time T = 100. which includes the bistable equation as one of numerous multi-adaptive test problems.4. with Ω = (0.2. in particular in regions with where the curvature of the interface is small.0001.1) using multi-adaptive time-stepping. Figure 7. This mesh consists of 1. (4. and one unstable steady-state solution. The bistable equation has been studied extensively before [7.1). The solution was computed on a uniformly reﬁned tetrahedral mesh with mesh size h = 1/64. in Ω. and note that the time steps are small in regions where there is strong competition between the two stable steady-state solutions. 572.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 17 18 JOHAN JANSSON AND ANDERS LOGG 4. In particular. Since this action is local on the interface between positive and negative regions. 1) × (0. u = 0. and with random initial data u0 = u0 (x) distributed uniformly on [−1. it has two stable steady-state solutions. 1). we solve the bistable equation on the unit cube. in Ω × (0.1) at ﬁnal time T = 100. Animations of the solution and the multi-adaptive time steps are available in the gallery on the DOLFIN web page [11]. 625 nodes.3. We refer to the overall method thus obtained as the cG(1)mcG(1) method.1) u − ∆u = u(1 − u2 ) ˙ ∂n u = 0 u(·. which we solve using the multi-adaptive mcG(1) method. it is clear that the solution increases in regions where it is positive and decreases in regions where it is negative. neighboring regions will compete until ﬁnally the solution has reached one of the two stable steady states. 6] and has interesting stability properties. Figure 8. 0) = u0 on ∂Ω × (0. We also plot the solution and the multi-adaptive time steps at time t = 10 in Figure 9 and Figure 10. and in Figure 8 the solution at ﬁnal time T = 100. u = 1 and u = −1. 1) × (0. we discretize in space using the standard cG(1) method [5]. To solve the bistable equation (4. Because of the diﬀusion. The visualization of the solution was made using OpenDX [1] version 4. T ]. Solving the bistable equation As an example of multi-adaptive time-stepping. Initial data for the solution of the bistable equation (4. T ]. Lumping the mass matrix. we plot the initial value used for the computation. the bistable equation is an ideal example for multi-adaptive time-stepping.1). 864 tetrahedrons and has N = 274. The computation was carried out using DOLFIN version 0.

opendx. 10 (2001). pp. 1995. GNU GPL. [14] A. pp. [7] D. 7 (1994). 28 (1988). R. Gustafsson.html.. pp. 2003–21. Gamma. Eriksson. Johnson. Williams. Larson. 105–158. Hansbo. The FEniCS project. Figure 9. 696 (2000). and L. . Multi-adaptive Galerkin methods for ODEs V: Stiﬀ problems. Math. Logg. . pp. Hoffman and A. Vlissides. Comput. . 2002. An analysis of numerical approximations of metastable solutions of the bistable equation. Acta Numerica.1). Solution of the bistable equation (4. Estimating the error of numerical solutions of systems of nonlinear reaction–diﬀusion equations. Multi-adaptive Galerkin methods for ODEs I. Logg et al. 1–26. Lundh. An optimal control approach to a posteriori error estimation in ﬁnite element methods. ¨ [10] K. [11] J. . Soderlind. Estep. Chalmers Finite Element Center Preprint Series. Multi-adaptive Galerkin methods for ODEs III: Existence and stability. Cambridge University Press. R. Softw. (1995). Comput. ACM Trans. pp. 2002–06. Becker and R. 24 (2003). pp.. http://www. Hoffman and A. Scott. A PI stepsize control for the numerical solution of ordinary diﬀerential equations.. M. [2] R. Multi-adaptive Galerkin methods for ODEs IV: A priori error estimates. Estep...G. Hoffman. DOLFIN.org/. 25 (2003). Nonlinearity. Logg. Acta Numerica.R. (2004). Addison Wesley. Rep. Rep. DOLFIN: Dynamic Object oriented Library for FINite element computation. Tech. Soderlind. [15] . A.ALGORITHMS FOR MULTI-ADAPTIVE TIME-STEPPING 19 20 JOHAN JANSSON AND ANDERS LOGG References [1] OpenDX. Dupont.phi. Johnson. M. and R. 1445–1462.. [3] T. 2003. Numer. Rannacher. pp. Design Patterns: Elements of Reusable Object-Oriented Software. M. (2004). ¨ [18] G. SIAM J. [5] [6] D. Tech.1) at time t = 10. Estep. Anal. http://www. 1879–1902. Anal.C. Sub[16] mitted to SIAM J.se/dolﬁn/. 29 (2003). Kirby.gnu. [8] Free Software Foundation.chalmers. J. Memoirs of the American Mathematical Society. [4] K. Multi-adaptive time steps at time t = 10 for the solution of the bistable equation (4. Logg. and G. 1996. BIT. Figure 10. [13] J. Sci. (2004). P. Larson. Computational Diﬀerential Equations. Introduction to adaptive methods for diﬀerential equations. [12] J. [9] E. Numer. and J. Chalmers Finite Element Center Preprint Series. 1119–1141. SIAM J. Multi-adaptive Galerkin methods for ODEs II: Implementation and applications. C. R. 1–109. Digital ﬁlters in adaptive time-stepping. Logg. 270–287. submitted to BIT. Johnson. http://www. and C. D. Sub[17] mitted to SIAM J. Jansson and A. Helm.org/copyleft/gpl. Sci.

t) dt. mcgq. such as viscous damping and external forces. . The approximate solution U ≈ u is obtained by an appropriate approximation of the integral tj tj−1 f (u(t). which means using a large number of small time steps. T > 0 a given ﬁnal time. SE–412 96 G¨teborg. o 1 . we want to compute an accurate solution U which is close to the exact solution u. Selecting the appropriate size of the time steps {k j = tj − tj−1 }M is j=1 essential for eﬃciency and accuracy. mechanical system.chalmers. This is the approach taken in this paper. email : logg@math. At the same time. Common to all these applications is that the computation time is critical. Simulating a mechanical system involves both modeling (formulating an equation describing the system) and computation (solving the equation). The solution method needs to be eﬃcient as well as accurate and reliable.2) u(tj ) = u(tj−1 ) + tj−1 f (u(t). which means using a small number of large time steps. Discretizing the system of PDEs in space. The competing goals of eﬃciency and accuracy can be met using an adaptive Date: April 27.1) is obtained. This paper discusses multi-adaptive Galerkin methods in the context of mechanical systems. an application is real-time. both for entertainment in the form of computer games and movies. t). email : johanjan@math. Key words and phrases. ˙ u(0) = u0 . . 2004. We want to compute the solution U using as little work as possible.chalmers.se. to obtain a physically accurate model of a mechanical system.2 JOHAN JANSSON AND ANDERS LOGG SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS JOHAN JANSSON AND ANDERS LOGG where u : [0.e. Chalmers University of Technology. which means that the time inside the simulation must reasonably match the time in the real world. discontinuous Galerkin. for the prediction and veriﬁcation of mechanical products. Introduction Simulation of mechanical systems is an important component of many technologies of modern society. adapting the time steps to the diﬀerent time scales of the system. j = 1.1) u(t) = f (u(t). continuous Galerkin. for a partition 0 = t0 < t1 < · · · < tM = T of [0. The model of a mechanical system often takes the form of an initial value problem for a system of ordinary diﬀerential equations of the form (1. Mass–spring systems appear to encompass most of the behaviors of elementary mechanical systems and thus represent a simple. t ∈ (0. Anders Logg. A mass–spring system consists of a set of point masses connected by springs. Numerical methods for the (approximate) solution of (1. for example using the Galerkin ﬁnite element method.1) and the solution of (1. mass– spring model. and in the simulation of realistic environments such as surgical training on virtual and inﬁnitely resurrectable patients. and powerful model for the simulation of mechanical systems. the step-wise integration of (1.. 1. 1. The primary type of mechanical system studied is an extended mass–spring model. t) dt. and f : R N × (0. potentially allowing enormous improvement in eﬃciency compared to traditional mono-adaptive methods. local time steps. A multi-adaptive method integrates the mechanical system using individual time steps for the diﬀerent components of the system. T ]. The resulting system can be interpreted as a mass–spring system and thus the ﬁnite element method in combination with a PDE model represents a systematic methodology for the generation of a mass–spring model of a given mechanical system. 1. T ]. . u0 ∈ RN a given initial value. It appears in industrial design. The simulation of a mechanical system thus involves the formulation of a model of the form (1.1. we believe it is necessary to solve a system of partial diﬀerential equations properly describing the mechanical system.1) are almost exclusively based on time-stepping. Johan Jansson. i. Multi-adaptivity.1) using a time-stepping method. Department of Computational Mathematics. However. Often. ODE. individual time steps. the accuracy requirement is given in the form of a tolerance TOL for the size of the error e = U − u in a suitable norm.2.se. The simulation of a mechanical system involves the formulation of a diﬀerential equation (modeling) and the solution of the diﬀerential equation (computing). Mass–spring systems. We present below multi-adaptive Galerkin methods for the solution of (1. . (1.1) with individual time steps for the diﬀerent parts of the mechanical system. typically governed by Hooke’s law with other laws optionally present. Sweden. an initial value problem for a system of ODEs of the form (1.1) to obtain an approximation U of the solution u satisfying tj Abstract. M. in the simplest case given by the equations of linear elasticity. intuitive. It appears in virtual reality. T ] → RN is the solution to be computed. Often. mdgq. T ] → RN a given function that is Lipschitz-continuous in u and bounded. Time-stepping methods.

We ﬁrst describe the basic mass–spring model in Section 2 and then give a short introduction to multi-adaptive Galerkin methods in Section 3.1). ˆ V = {v : v|Ij ∈ [P q−1 (Ij )]N . This can be very costly if the system exhibits multiple time scales of diﬀerent magnitudes. V ) denotes a suitable pair of ﬁnite dimensional subspaces (the trial and test spaces). .phi. Finally.chalmers. 23. . The mechanical systems presented in the examples have been implemented using Ko. 12. a cG(q) or dG(q) method corresponds to an implicit Runge–Kutta method.4. ˆ in the choice of approximating spaces (V. i. [3. but has been used to some extent for speciﬁc applications. 8]. V ). we note that tj−1 f (U (t). Standard methods for the discretization of (1. t) dt ≈ kj f (U (tj ). 1. http://www. 22. . tj ).5. v) dt ˆ ∀v ∈ V . 2. We thus obtain the method (1. ·). . Typical choices of approximating spaces include (1. In general.4) V = {v ∈ [C([0. t) dt. 9]. which means that anyone is free to use or modify the software. since U piecewise constant. 1. we obtain the dG(q) method.g. .3) 0 ˙ (U . Multi-adaptive time-stepping. We refer to the resulting methods. with the forces between the mass elements transmitted using explicit spring connections. Outline of the paper. including specialized integrators for the n-body problem [24. determining a sequence of time steps which produces an approximate solution U satisfying the given tolerance with minimal work. .1).se/ko/. . ·) denotes the RN inner product and (V. 19. Obtaining the software. ˆ where (·. T ].2).3.3). In Section 5. eﬃcient representation and computation of the solution thus requires that this diﬀerence in time scales is reﬂected where F denotes the force acting on the element. By choosing a constant test function v in (1. DOLFIN is licensed under the GNU General Public License [11]. as multi-adaptive Galerkin methods. provided these rights are preserved. . m is the mass of the element.1) F = ma. Alternatively. x2 . j = 1. (Note that “spring” is a historical term. 5]. we investigate and analyze the performance of the multi-adaptive methods for a set of model problems. M. 1]. 2. individual time-stepping (multi-adaptivity) has previously received little attention in the large literature on numerical methods for ODEs. the source code can be obtained through anonymous CVS as explained on the web page. The examples presented below have been obtained using DOLFIN version 0. 18.net.1) reads: Find U ∈ V . and a = x is the acceleration of the element with x = (x 1 . (2.1).4. The mass–spring model represents bodies as systems of discrete mass elements. 21. v) dt = 0 T (f. 27. 1. 26]. and each new release is announced on freshmeat. with equality if f does not depend explicitly on t. T ])]N : v|Ij ∈ [P q (Ij )]N .phi. . see [7. is available at the DOLFIN web page. V represents the space of continuous and piecewise polynomial vectorˆ valued functions of degree q ≥ 1 and V represents the space of discontinuous piecewise polynomial vector-valued functions of degree q − 1 on a partition ˆ of [0.chalmers.11 [14]. 10. and low-order methods for conservation laws [25. Mass–spring model We have earlier in [17] described an extended mass–spring model for the simulation of systems of deformable bodies. and is not limited to pure Hookean interactions. . such that T {k j }M j=1 (1. including numerous example programs.. M }. tj In the simplest case of the dG(0) method. we present in Section 6 results for a number of large mechanical systems to demonstrate the potential and applicability of the proposed methods. 16]. recently introduced in a series of papers [20. Comments and contributions are welcome. including the cG(q) and dG(q) methods. Surprisingly. based on DOLFINs multi-adaptive ODE-solver. We refer to this as the cG(q) method. 4. The Galerkin ﬁnite element method for (1.SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS 3 4 JOHAN JANSSON AND ANDERS LOGG algorithm. . which is a software system for the simulation of mass– spring models. j = 1. . j = 1. including adaptive algorithms for the automatic construction of an optimal time step sequence. x3 ) ¨ . M }. which we recognize as the backward (or implicit) Euler method. If the diﬀerent time scales are localized to diﬀerent components.6) U (tj ) = U (tj−1 ) + kj f (U (tj ). With both V and V representing discontinuous piecewise polynomials of degree q ≥ 0. tj ). . Ko will be released shortly under the GNU General Public License and will be available at http://www.e. we can determine its motion from Newton’s second law. j = 1. see e. Early work on the cG(q) and dG(q) methods include [6.5) U (tj ) = U (tj−1 ) + tj−1 f (U (t). . we discuss the interface of the multiadaptive solver and its application to mass–spring models.) Given the forces acting on an element. The source code of DOLFIN. corresponding to (1. Galerkin ﬁnite element methods present a general framework for the numerical solution of (1. require that the same time steps {kj }M are used for all components Ui = Ui (t) of the approxj=1 imate solution U of (1. with details depending on the choice of quadrature for the approximation of the integral of f (U. 13. . M. it follows that both the cG(q) and dG(q) solutions satisfy the relation tj (1. In Section 4. .se/dolfin/.

ˆ where the trial space V and test space V are given by (3. . Mi . a mass–spring model may thus be given by just listing the mass elements and spring connections of the model. tij ]. Mi .j−1 for j = 1. 23.3) to allow each component Ui of the approximate solution U to be piecewise polynomial on an individual partition of [0. . . 3. ˆ V = {v : vi |Iij ∈ P qij −1 (Iij ). v) dt = 0 T (f. e2 . .1. . The mcG(q) method is thus obtained as a simple extension of the standard cG(q) method by allowing each component to be piecewise polynomial on an individual partition of [0. . i = 1. j = 1. such that T (3. and dynamically creating and destroying spring connections based on contact and fracture conditions. T ])]N : vi |Iij ∈ P qij (Iij ). The motion of the entire body is then implicitly described by the motion of its individual mass elements. .1) 0 ˙ (U . . With this notation. collision and fracture. T ] is partitioned into blocks between certain synchronized time Figure 1. lf }: e1 : the ﬁrst mass element connected to the spring e2 : the second mass element connected to the spring κ : Hooke spring constant b : damping constant l0 : rest length lf : fracture length Table 1. Multi-adaptive Galerkin methods The multi-adaptive methods mcG(q) and mdG(q) used for the simulation are obtained as extensions of the standard cG(q) and dG(q) methods by ˆ enriching the trial and test spaces (V. The individual time steps {k ij }j=1. C}: x : position v : velocity m : mass r : radius C : a set of spring connections A spring connection c is a set of parameters {e 1 . Descriptions of the basic elements of the mass– spring model: mass elements and spring connections.i=1 are chosen adaptively based on an a posteriori error estimate for the global error e = U − u . b. a spring connection c. Mi .N 3. by adding a radius of interaction to each mass element. . . v1 v2 F e1 c e2 F Actual length of c Rest length of c Fracture length of c Radius of e1 Radius of e2 the position of the element. With these definitions. Schema of two mass elements e 1 and e2 . . T ]. T ]. . κ. levels 0 = T0 < T1 < · · · < TM = T . . Similarly. we give the basic properties of the mass–spring model consisting of mass elements and spring connections. 16]. Adaptivity. . In particular. . Mi . To give the deﬁnition of the multiadaptive Galerkin methods. v) dt ˆ ∀v ∈ V . we can write the mcG(q) method for (1. 3. m. i = 1. V ) of (1. l0 . We refer to the set of intervals T n between two synchronized time levels T n−1 and Tn as a time slab. 22. and important quantities. we refer to [20] or [22] for the full deﬁnition of the methods. We also assume that the interval [0.2. and the length of the subinterval is given by the local time step k ij = tij − ti. .2) V = {v ∈ [C([0. we refer the reader to [20. N }. . .SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS 5 6 JOHAN JANSSON AND ANDERS LOGG A mass element e is a set of parameters {x. In Table 1 and Figure 1. r. This is illustrated in Figure 2. .j−1 . The force given by a standard spring is assumed to be proportional to the elongation of the spring from its rest length. j = 1. we obtain the mdG(q) method as a simple extension of the standard dG(q) method.1) in the following form: Find U ∈ V . . Deﬁnition of the methods. We extend the standard model with contact. we introduce the following notation: Subinterval j for component i is denoted by I ij = (ti. 21. For a detailed description of the multi-adaptive Galerkin methods. N }. v.

The mass–spring model is then automatically translated into a system of ODEs of the form (1. ·)| = TOL/(N Cq Si i (T )). Multi-adaptive simulation of mass–spring systems The simulation of a mechanical system involves the formulation of a differential equation (modeling) and the solution of the diﬀerential equation (computing). with the rest of the masses oscillating slowly. and R i (U. We refer to this as adaptive ﬁxed point iteration. ˙ factors. Sketch of the C++ interface of the multi-adaptive ODE-solver. In Figure 5. we comment brieﬂy on the user interface of the multi-adaptive solver. .1) is solved by ﬁxed point iteration on time slabs.T ] [q ] Si i (T ) [q ] are the individual stability where Cq is an interpolation constant. Thus. Performance We consider a simple model problem consisting of a long string of n point masses connected with springs as shown in Figure 4. we measure the individual residuals and take each individual time step k ij such that (3. ·)|. Ko represents a mass–spring model internally as lists of mass elements and spring connections. . int i). To solve an ODE. the ﬁrst mass oscillates at a high frequency. ·) = Ui − fi (U. (3. as shown in Table 2.j−1 tij Tn−1 Kn Tn T Figure 2. Iij q [q ] where TOL is a tolerance for the error at ﬁnal time. Ko speciﬁes the ODE system as an ODE subclass and uses DOLFIN to compute the solution. N . 21]. The a posteriori error estimate for the mcG(q) method takes the form N Table 2. 5. As a result. a translation or mapping is thus needed between a given mass element and a component number in the system of ODEs. to determine the individual time steps. and an initial value u0 . virtual real u0(int i). . To evaluate the right-hand side f of the corresponding ODE system.1).SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS 7 8 JOHAN JANSSON AND ANDERS LOGG PSfrag replacements Iij 4. In this example. the user implements a subclass which inherits from the ODE base class. The mass–spring model presented above has been implemented using Ko. Having deﬁned these two components in the form of the mass– spring model presented in Section 2 and the multi-adaptive solver presented in Section 3. Elements between common synchronized time levels are organized in time slabs. at ﬁnal time t = T . ·) are the individual residuals for i = 1. Individual partitions of the interval [0. a software system for the simulation and visualization of mass–spring models.3) e(T ) l2 ≤ Cq i=1 q Si i (T ) max |ki i Ri (U. This mapping may take a number diﬀerent forms. The user interface of the multi-adaptive solver is speciﬁed in terms of an ODE base class consisting of a right hand side f . as shown in Figure 3. T ] for different components.4) kijij max |Ri (U. All other springs are connected together with soft springs with spring constant κ = 1. . a time interval [0.3. 3. we have N = 6 and M = 4. } i t 0 kij ti. . Ko automatically generates a mass–spring model from a geometric representation of a given system. [0. Iterative methods. For a stiﬀ problem. the ﬁxed point iteration is automatically stabilized by introducing a damping parameter which is adaptively determined through feed-back from the computation. real t. measuring the eﬀect of local errors introduced by a nonzero local residual on the global error. are obtained from the solution φ of an associated dual problem. we plot the coordinates for the ﬁrst three masses on [0. Ko uses the mapping presented in Algorithm 1. virtual real f(Vector u. See [21] or [15] for a detailed discussion of the algorithm for the automatic selection of the individual time steps. class ODE { ODE(int N). ki = ki (t) are the individual time steps. T ]. see [7] or [20]. The ﬁrst mass on the left is connected to a ﬁxed support through a hard spring with large spring constant κ 1. 1]. as described in [16]. The individual stability factors [q ] Si i (T ). The system of discrete nonlinear equations deﬁned by (3. as discussed in [20.

x2 ← u(3(i − 1) + 2) m. The system consists of a string of masses. and use the same small time step k for all masses in the mono-adaptive simulation.1 0. n) = C1 + C2 M n.4 t 0.8 1 Figure 5.1899 PSfrag replacements 0.19005 0.18985 0. We let M = K/k denote the number of small time steps per each large time step. We run the test for M = 100 and M = 200 with large spring constant κ = 10M for the hard spring connecting the ﬁrst mass to the ﬁxed support. As shown in Figure 6. The mechanical system used for the performance test. u2 .1 and. u3 ) 0. Each mass has been slightly displaced to initialize the oscillations. the work for the mono-adaptive method grows linearly with the total number of masses.2 0.1/M . the complexity of the mono-adaptive method may be expressed in terms of M and n as follows: (5. Algorithm 1 FromComponents(Vector u.x3 ← u(3(i − 1) + 3) m. Figure 3. 0. the computation time for the multi-adaptive solver grows slowly with the number of masses n.v1 ← u(N/2 + 3(i − 1) + 1) m. u2 .1) Tc (M.18975 u3 -0. u3 ) t 0.15 (u1 . A geometric representation of a cow is automatically translated into a mass–spring model.2 0.2 0. .SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS 9 10 JOHAN JANSSON AND ANDERS LOGG Figure 4. More speciﬁcally.x1 ← u(3(i − 1) + 1) m. Mass m) i ← index(m) N ← size(u) m. a small time step of size k = 0.4 0.05 0 0.1897 0.05 0.6 0.8 1 0 0. We use a large time step of size K = 0. ﬁxed at the left end.v3 ← u(N/2 + 3(i − 1) + 3) To compare the performance of the multi-adaptive solver (in the case of the mcG(1) method) with a mono-adaptive method (the cG(1) method). On the other hand.18995 u3 PSfrag replacements (u1 . we choose a ﬁxed small time step k for the ﬁrst mass and a ﬁxed large time step K > k for the rest of the masses in the multi-adaptive simulation. as expected.6 0.1898 0 0. The computation time T c is recorded as function of the number of masses n. independent of the total number of masses. practically remaining constant. consequently. Coordinates for the ﬁrst three masses of the simple model problem (left) and for the third mass (right). small time steps are used only for the ﬁrst rapidly oscillating mass and so the work is dominated by frequently updating the ﬁrst mass.v2 ← u(N/2 + 3(i − 1) + 2) m.19 0.

with minimal overhead.e. For the next example.SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS 11 12 JOHAN JANSSON AND ANDERS LOGG 15 30 25 10 20 15 PSfrag replacements 5 PSfrag replacements 10 5 0 0 100 200 300 400 n 600 700 800 900 1000 0 0 100 200 300 400 n 600 700 800 900 1000 Figure 6. using a minimal amount of work. and the evaluation of residuals for multi-adaptive time-stepping. As expected.3.e. using constant time steps equal to the smallest time step selected by the mono-adaptive method. It also shows that the overhead is substantial for the current implementation of the multi-adaptive solver. Oscillating tail. Our general conclusion is that the multi-adaptive solver is more eﬃcient than a mono-adaptive method for the simulation of a mechanical system if M is large. while for the multi-adaptive solver.1. i. 6.. A sequence of frames from an animation of the multi-adaptive solution is given in Figure 8. resulting in gradual damping of the slow oscillations. Compared to the simple non-adaptive implementation of the cG(1) method. . with M = 100 (left) and M = 200 (right). The cow is given a constant initial velocity and the tail is given an initial push to make it oscillate. 6. The computation times are given in Table 3. the speed-up is a factor 3. Local manipulation. as shown in Figure 7. For the ﬁrst example. the multi-adaptive solver automatically selects small time steps for the oscillating tail and large time steps for the rest of the system. We also plot the corresponding solutions in Figure 11. However. In Figure 9. while keeping the rapid oscillations of the ﬁrst mass largely unaﬀected. A cow with an oscillating tail (left) with details of the tail (right). as illustrated in Figure 12. 6. We compare the performance of the multi-adaptive solver (in the case of the mcG(1) method) with a mono-adaptive method (the cG(1) method) using the same time steps for all components. n) = C3 M + C4 n. when small time steps are needed for a part of the system. With b = 100. we present results for a number of large mechanical systems. we plot the time steps as function of time for relevant components of the system. The speed-up of the multiadaptive method compared to the mono-adaptive method is a factor 70. i. as discussed in Section 3.2) Tc (M. The same result is obtained if we add damping to the system in the form of a damping constant of size b = 100 for the spring connections between the slowly oscillating masses.2. we take the mass–spring model of Figure 3 representing a heavy cow and add a light mass representing its tail. We also make a comparison with a simple non-adaptive implementation of the cG(1) method. if large time steps may be used for a large part of the system. and if n is large. In Figure 10. interpolation of solution values within time slabs. we plot the time steps used in the mono-adaptive simulation. we obtain (5. Tc Tc Figure 7. we believe it is possible to remove a large part of this overhead. we ﬁx a damped cow shape at one end and repeatedly push the other end with a manipulator in the form of a large sphere. adaptive ﬁxed point iteration is automatically activated for the solution of the discrete equations. Large problems and applications To demonstrate the potential and applicability of the proposed mass– spring model and the multi-adaptive solver. Figure 8. The tail oscillates rapidly while the rest of the cow travels at a constant velocity to the right. This shows that the speed-up of a multi-adaptive method can be signiﬁcant. Computation time Tc as function of the number of masses n for the multi-adaptive solver (dashed) and a mono-adaptive method (solid). including the organization of the multi-adaptive time slabs.

Mono-adaptive time steps for the cow with oscillating tail. Small time steps are automatically selected for the components aﬀected by the local manipulation.001 0.4 k k -0.8 1 Figure 10.2 0 0. Figure 12.6 0.0001 0 u PSfrag replacements 0 0.4 t 0.8 1 0 0.0001 0. The plot on the left shows the time steps for components 481–483 corresponding to the velocity of the tail.1 0.01 10 0. the multi-adaptive solver automatically selects small time steps for the components directly aﬀected by the manipulation. Solution for relevant components of the cow with oscillating tail.6 0.4 t 0. . and the plot on the right shows the time steps for components 13–24 corresponding to the positions for a set of masses in the interior of the cow.SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS 13 14 JOHAN JANSSON AND ANDERS LOGG 0.4 -0.8 1 t -15 0. with large time steps for the rest of the system. A cow shape is locally manipulated. Multi-adaptive time steps used in the simulation of the cow with oscillating tail. mono-adaptive cG(1).2 u 0.8 1 Figure 9.1 15 0.4 1e-06 PSfrag replacements 0 0.2 0. As shown in Figure 13. Computation times for the simulation of the cow with oscillating tail for three diﬀerent algorithms: multiadaptive mcG(1).6 -10 -0.4 0. Figure 11.2 0.6 0.2 0.6 0. the time steps are drastically decreased at each impact to accurately track the eﬀect of the impact. The plot on the left shows the solution for components 481–483 corresponding to the velocity of the tail.001 0. and the plot on the right shows the solution for components 13–24 corresponding to the positions for a set of masses in the interior of the cow. This test problem also illustrates the basic use of adaptive time-stepping.2 0.8 1 t -1 0.01 0.4 1e-05 1e-05 -5 PSfrag replacements 1e-06 PSfrag replacements 0 0. Algorithm Time / s Multi-adaptive 40 Mono-adaptive 2800 Non-adaptive 130 Table 3.8 1e-07 t 1e-07 0.6 0. 0.001 5 -0.0001 k PSfrag replacements 1e-05 1e-06 1e-07 0 0. and a simple implementation of non-adaptive cG(1) with ﬁxed time steps and minimal overhead.2 0.

1987.C. Dahlquist. Sci.5 k -5. with spring constant κ = 107 and damping constant b = 2 · 105 . Our ﬁnal example demonstrates the applicability of the multi-adaptive solver to a stiﬀ problem consisting of a block being dropped onto a stiﬀ beam. Ascher and L. [1] U.5 2 k 1e-05 0 0.4 0.3.SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS 15 16 JOHAN JANSSON AND ANDERS LOGG -5. . The material of both the block and the beam is very hard and very damped.3 0. Comput. with spring constant κ = 10 7 and damping constant b = 2 · 105 for each spring connection. 2 e (1997). SIAM J. Petzold.5 u t 1.2 0.5 2 2 0. respectively.5 2 1e-05 0 0. No. PhD thesis. A stiﬀ beam. New Astronomy. High resolution schemes for conservation laws with locally varying time steps. Stockholm University. • Multi-adaptive time-stepping. respectively.5 -5. we make the following conclusions regarding multi-adaptive time-stepping: • A multi-adaptive method outperforms a mono-adaptive method for systems containing diﬀerent time scales if there is a signiﬁcant separation of the time scales and if the fast time scales are localized to a relatively small part of the system. [4] R.001 -5.001 -1 PSfrag replacements -2 PSfrag replacements 1e-04 -3 From the results presented above.1 0 0.5 u k 1e-05 t 1.01 0. J. pp.5 u t 1. SIAM.2 -0. [2] J. Dubinski. Conclusions u PSfrag replacements -0. References u k -4 -5 0 0. Kirby.5 u t 1.6 -0. The Numerical Analysis of Ordinary Diﬀerential Equations — Runge– Kutta and General Linear Methods. 7. [5] C.5 2 Figure 13.6 PSfrag replacements -5.2 0. Dav´. 1958.8 -5. 1998. The material of both the block and the beam is very hard and very damped.1 Figure 14.9 -6 0 0. Dawson and R.01 -5.8 k 1e-04 1e-05 0 0.5 PSfrag replacements -5. [3] G. The multi-adaptive time steps for the simulation are shown in Figure 15..5 -0. 22.5 2 -5.5 u t 1.5 t 1.001 -0.and right-most masses.3 -5. Parallel treeSPH.001 u PSfrag replacements -5.01 0 0. 2256–2281.4 k -0.3 PSfrag replacements k 1e-04 -0. and the two rows below correspond to the velocities of the left. 0 0. Stability and Error Bounds in the Numerical Integration of Ordinary Diﬀerential Equations.5 2 6. with large time steps before and after the impact. Computer Methods for Ordinary Diﬀerential Equations and Diﬀerential-Algebraic Equations. and L. works in practice for large and realistic problems. Wiley.5 2 0. 6 (2001). Butcher.9 -6 0 0.5 2 t 1.and right-most masses. pp. 277–297.6 0.01 -5.4 0.7 1e-04 k -5. Solution (left) and multi-adaptive time steps (right) for selected components of the manipulated cow. A block is dropped onto a beam.7 0 0.5 t 1. The two top rows correspond to the positions of the left. as shown in Figure 14. and in particular the current implementation. Note that the time steps are drastically reduced at the time of impact.7 PSfrag replacements -5. Hernquist.

004 0.. Hager. 321–336. [6] M. submitted to ACM Trans. Ziantz. vol 8. pp. http://www.S.. Cambridge University Press. Chapman & Hall.01 0. [26] S. 28 (1994). Numer. 25 (2003). [12] E. pp. 36 (1981). and C. 908–926. 1–48. Flaherty. 41 (1983).. 455–473. Sci. A discrete mechanics model for deformable bodies.D. vol 14. [9] D. Teresco.001 0 0 2 4 6 8 10 [19] C. 105–158. (2004).011 0. pp. Comp. Aarseth. Trochu. [7] K. pp. pp. 44 (1992). SIAM J. Estep. Multi-adaptive Galerkin methods for ODEs V: Stiﬀ problems. Error estimates and adaptive time-step control for a class of one-step methods for stiﬀ ordinary diﬀerential equations.. [15] J. SIAM J. (2004). [10] D. http://www. DOLFIN..002 17 18 JOHAN JANSSON AND ANDERS LOGG k PSfrag replacements 0. pp.B. (1995). Math.K. . SIAM J. 1994.01 to track the contact between the block and the beam. [14] J. Comput. Computational Diﬀerential Equations. Discontinuous Galerkin methods for ordinary diﬀerential equations.007 0. D. Estep. M. Multi-adaptive Galerkin methods for ODEs I. Agnor. Osher and R. Algorithms for multi-adaptive time-stepping. (2004). 1879–1902. Journal of Parallel and Distributed Computing. Wanner. Szymanski. pp. A posteriori error bounds and global error control for approximations of ordinary diﬀerential equations. [20] A.008 0. pp. Johnson. Numer. 24 (2003). Submitted to SIAM J. 34 (2002). 1991. pp. Logg. Sub[22] mitted to SIAM J. Eriksson. M2 AN.html. Multi-adaptive Galerkin methods for ODEs II: Implementation and applications. t Figure 15. W. Astron. [25] S. On a Hermite integrator with Ahmad-Cohen scheme for gravitational many-body problems. Anal. Logg.SIMULATION OF MECHANICAL SYSTEMS WITH INDIVIDUAL TIME STEPS 0. Publ. Alexander and C.org/copyleft/gpl.gnu. 47 (1997). [16] . [27] L. P. Hoffman and A.005 0. Math. 139–152. Delfour. GNU GPL. Hairer and G. Sci. Adaptive local reﬁnement with octree load balancing for the parallel solution of three-dimensional conservation laws.. Makino and S. B.M. Jansson and A. 1991. pp.. R. 815–852. submitted to BIT. [11] Free Software Foundation. Multi-adaptive Galerkin methods for ODEs IV: A priori error estimates. Loy. Multi-adaptive time steps for the block and beam. French. 1996. [18] J.chalmers. Softw. J. Numer. Numerical approximations to nonlinear conservation laws with locally varying time and space grids. ICARUS. [23] . n-body simulations of late stage planetary formation with a simple fragmentation model. 1119–1141. Japan. Hansbo. Comp. Computer-Aided Design. Shampine.. Estep and D. Jansson and J.. Anal. Math.phi. and L. Springer Series in Computational Mathematics.G.. Introduction to adaptive methods for diﬀerential equations.H. Global error control for the continuous Galerkin ﬁnite element method for ordinary diﬀerential equations.003 0. The maximum time step is set to 0. SIAM J. 32 (1995). . Johnson.006 0.009 0. Anal. [24] J. Springer Series in Computational Mathematics. Solving Ordinary Diﬀerential Equations I — Nonstiﬀ Problems. Anal. [17] J. Numer. Acta Numerica. 113–124. pp. Note that the time steps are drastically reduced at the time of impact. (2004). Numerical Solution of Ordinary Diﬀerential Equations. Solving Ordinary Diﬀerential Equations II — Stiﬀ and Diﬀerential-Algebraic [13] Problems.se/dolﬁn/. 141–151. Comput. Shephard. [21] . . [8] . Soc.E. Logg et al. Vergeest. Sanders. and F. 132 (1998). 25 (1988). Multi-adaptive Galerkin methods for ODEs III: Existence and stability.

u(0) = (0. o Sweden. T ]. T ] in various ways. including a simple model problem oscillating at a time scale of 10−9 computed over the time interval [0. [8] and [6]. By resolving the fast time scales in a short time simulation. AND ANDERS LOGG COMPUTATIONAL MODELING OF DYNAMICAL SYSTEMS JOHAN JANSSON.1). We present below a new approach to model reduction. ¯ ¯ ¯ ¯ . t ∈ (0. This process of computational modeling can be completely automated. 3. Taking averages to obtain the reduced model Having realized that point-wise resolution of the fast time scales of the exact solution u of (1. deﬁned ¯ by (3. the key step is to correctly model the eﬀect of the variation at the fast time scales on the variation on slow time scales. A simple model problem We consider a simple example illustrating the basic aspects: Find u = (u1 . where τ > 0 is the size of the average. We consider here a constant extension. be replaced with a reduced model for the variation of the solution u of (1. The problem of model reduction is very general and various approaches have been taken. where u : [0. T ] → RN is the solution to be computed. we seek instead to compute a time average u of u. CLAES JOHNSON. i.chalmers. T − τ /2]. Chalmers University of Technology. making solution possible on a long time interval.1) with a reduced model where the fast time scale has been removed. u0 ∈ RN a given initial value. Claes Johnson. CLAES JOHNSON.1).1) u(t) = f (u(t). dynamical system. 100].se. ranging from very fast to slow. 0). or turbulent ﬂow with a wide range of time scales.1) u(t) = ¯ 1 τ τ /2 u(t + s) ds. email : johanjan@math. Key words and phrases. and a lattice consisting of large and small point masses. Typical examples include meteorological models for weather prediction. To make computation feasible in a situation where computational resolution of the fast time scales would be prohibitive because of the small time steps required.e.1) u1 + u1 − u2 /2 = 0 ¨ 2 u(0) = (0. T ] → R2 . If a dynamical system contains multiple time scales. based on resolving the fast time scales in a short time simulation and determining a model for the eﬀect of the small time scale variation on large time scales. 2004. see Figure 1. We consider a situation where the exact solution u varies on diﬀerent time scales. The second point mass M 2 is connected to a ﬁxed support through a very stiﬀ spring with spring constant √ κ = 1018 and oscillates rapidly on a time scale of size 1/ κ = 10−9 . The 2 on M proportional to the elongation oscillation of M2 creates a force ∼ u2 1 of the spring connecting M2 to M1 (neglecting terms of order u4 ). Introduction We consider a dynamical system of the form (1. As discussed below. Department of Computational Mathematics. with M2 moving along a line perpendicular to the line of motion of M1 . see e.g. ˙ 1. T ] → RN a given function that is Lipschitz-continuous in u and bounded. reduced model.1) may sometimes be computationally very expensive or even impossible.chalmers.1) with time steps of size ∼ 0. T ]. t). T ]. 1 which models a moving unit point mass M 1 connected through a soft spring to another unit point mass M2 . this means a total of ∼ 10 12 time steps for solution of (2. ranging from very fast to slow.1) on resolvable time scales.chalmers. T > 0 a given ﬁnal time.1) containing the fast time scales needs to Date: April 22. 2. SE–412 96 G¨teborg. With T = 100. with fast time scales on the range of seconds and slow time scales on the range of years. automation. with fast time scales on the range of femtoseconds and slow time scales on the range of microseconds.. The average u can be extended to ¯ [0.se. This process of computational modeling can be completely automated and the validity of the reduced model can be evaluated a posteriori. −τ /2 t ∈ [τ /2. u2 + κu2 = 0 ¨ on (0. it is possible to compute the (averaged) solution of (2. Johan Jansson. Anders Logg. we let u(t) = u(τ /2) for t ∈ [0. 2 −9 requires time steps of size ∼ 10 −10 for The short time scale of size 10 full resolution.1 and consequently only a total of 103 time steps. the given model (1. In this short note. T ]. email : logg@math. protein folding represented by a molecular dynamics model of the form (1. AND ANDERS LOGG Abstract. we discuss the basic approach to computational modeling of dynamical systems. u2 ) : [0. and let u(t) = u(T − τ /2) for t ∈ (T − τ /2. by replacing (2.se. However. ˙ u(0) = u0 .2 JOHAN JANSSON. Two examples are presented. 1) on (0. email : claes@math. computational solution of the dynamical system can be very costly. a model for the eﬀect of the small time scale variation on large time scales can be determined. and f : R N × (0. such that (2. Modeling. τ /2).

where we made the approximation u2 (0) = 0.1) by (3. ¯ 2 f2 . Another possibility is to use a piecewise polynomial representation for the subgrid model g . τ /2] ∪ (T − τ /2. −κu2 ). ˜ 5.1). see e. 0). ¯ ˙ or (3. but without resolving the fastest time scales.3) for u ≈ u with an ˜ ¯ approximate subgrid model g ≈ g . ·)(t) − f (¯(t). ¯ u ¯ and then determining g for the remainder of the time interval such that ˜ g (˜(t). 0). t) ≈ g (u. ·)(t) − f (¯(t). ·)(t) − f (¯(t). t) ≈ g (¯(t). T ]. T ]. the small scale variation may still be present.3) in the form of a modiﬁed test function. T ]. it is enough to model g with ˜ a constant and repeatedly checking the validity of the model by comparing the reduced model (3. the solution u is computed accurately over a short time period. while we hope that U is close to u point-wise. we need to solve the reduced model (3. ·) = (u3 .1) by introducing the two new variables u 3 = u1 and u4 = u2 with ˙ ˙ f (u. A simple mechanical system with large time scale √ ∼ 1 and small time scale ∼ 1/ κ. ˙ (0) = (0. [3].1). a least squares stabilization is added in the Galerkin formulation of the reduced system (3. By the linearity of f1 .2) is ¯ unknown. To remove these oscillations. since the variance g in the averaged dynamical system (3. We refer to this system as the reduced model ¯ with subgrid model g corresponding to (1. u4 . which we can write in the form (1. the approach followed below. CLAES JOHNSON. however. t) = f (u. ·)(t) = f (¯(t). ¯ However. 2 √ we note that u2 ≈ 0 (for κτ large) while u2 ≈ 1/2. the reduced model is constructed with subgrid model g varying ˜ on resolvable time scales. T ] by deﬁning g (u. Solving the reduced system Although the presence of small scales has been decreased in the reduced system (3. ˜ ¯ t ∈ (0. t). t) + g (˜(t).2) ˙ u(t) = f (¯(t). ˜u a sequence of solutions is computed with increasingly ﬁne resolution. t) = −f (¯(t). the reduced system needs to be stabilized by introducing damping of high frequencies. t) ¯ u ¡ ¡ ¡ $% $% $% $% ¡ ¡ ¦ ¦ ¤¥ ¦§ ¨ ¨ ¨© © § " " "# ¨ ¨ ¤¥ ¨© © # ¤¥ ! ! ¤¥ ¤¥ ¤¥ ¤¥ ¤¥ u1 &'( () )012 23456 &'( () )012 23456 $% $% $% $% $% $% $% $% $% $% $% $% 67 789@ @A BC Figure 1.3) with the full model (1. we aim at computing the average u of u. 0). t). We obtain ¯ ˙ u u u(t) = u(t) = f (u. ˜u ¯ For the simple model problem (2. t) on (0. if the solution u of the full dynamical system (1.1). In (i). resolving the fastest time scales.) ¯ u We now seek to model the variance g (u.2) for the simple model problem (2.2) ¨ u1 + u1 − 1/4 = 0 ˜ ˜ ¨ u2 + κ˜2 = 0 ˜ u u(0) = (0. We now seek a dynamical system satisﬁed by the average u by taking the ¯ average of (1. T ]. t) accounts for the eﬀect of ¯ small scales on time scales larger than τ . t). AND ANDERS LOGG 4.1) in a short time simulation. ˜ To summarize. t) in the form g (u. Note that we may not expect U to be close to u point-wise in ˜ ¯ time. The reduced model is then obtained by computing the variance (4. Following the general approach presented in [5]. A model for the eﬀects of the fast unresolvable scales is then determined by extrapolation from the sequence of computed solutions.3) using ˜ ¯ e.1) g (u.1) is computationally unresolvable.2) and thus (1. t) + (f (u. with solution u(t) = ( 1 (1 − cos t). −u1 + u2 /2.2) to (0. t) ¯ in the form g (˜(t).1). on (0. In the simplest case. t) = f (u.3) ˙ u(t) = f (˜(t).COMPUTATIONAL MODELING OF DYNAMICAL SYSTEMS $% 3 4 JOHAN JANSSON. (i) scale-extrapolation or (ii) local resolution. t) ¯ ¯ ˜u and replace (3. a Galerkin ﬁnite element method. ¯ ¯ where u0 = u(0) = u(τ /2). This is not evident in the reduced system (4.g. (Note that we may extend (3. t). t)).g. In (ii). we ˜ √ √ 1 τ 1 τ compute u2 (0) = τ 0 u2 (t) dt = τ 0 cos( κt) dt ∼ 1/( κτ ) and so u2 ˜ ˜ √ √ oscillates at the fast time scale 1/ κ with amplitude 1/( κτ ). Solving the reduced model (3. ˜ 4 In general. ¯ . Modeling the variance M2 ¡ ¡ ¡ ¡ $% $% κ=1 ¦ ¦ ¤ ¦ κ=1 M1 £ ¢ £ ¢ £ ¢ £ ¢ £ ¢ £ ¢ £ ¢ £ ¢ £ ¢ u2 PSfrag replacements κ=1 κ 1 There are two basic approaches to the modeling of the variance g (u. and f4 . we obtain an approximate solution U ≈ u ≈ u. the (approximate) reduced model takes the form (4. ˜ on (0. ˜ u ˜u u(0) = u0 . u ˜ 67 789@ @A BC u where the variance g (u. t) + g (u. In practice.3).

the Galerkin orthogonality ˜ ˙ expressing the orthogonality of the residual R(U. ·)) dt + ˜ ˜ (φ. With the option automatic modeling set. e. Components with constant average. g (U. ·)) dt. R(U. . g (U. ψ)| ≤ S [1] (T ) max k R(U.1). ·) = U − f (U.2) may be inactivated. ·)) dt + T 0 (φ. a reduced model of the form (3. such as u 2 in (2. ·).T ] and where ψ is initial data for the backward dual problem. ·)) dt. Alternatively. U − u − f (U. but it represents a ﬁrst attempt at the automation of modeling. ¯ are automatically marked as inactive and are kept constant throughout the simulation. ·) − g (u. ·) + f (¯. including the simple model problem (2. t) ds.T ] l2 Ij l2 . t ∈ [0. tj ].1) is chosen to reﬂect the desired output quantity.4. we take the computed solution U ≈ u at the control point and add ¯ a perturbation of appropriate size. ·) − g (U. in the error representation ˜ ¯ corresponds to the modeling error u − u. ψ) − e e T 0 ˙ (φ + J(¯. ·) Ij [0. ·) φ. ˜ ≤ S [1] (T ) max k R(U. in this error representation corresponds to the discretization error U − u for the numerical solution of (3. ·)) dt. t) = u 0 ∂f (s¯(t) + (1 − s)U (t). If a ˜ Galerkin ﬁnite element method is used (see [1. we subtract a piecewise constant interpolant to obtain T 0 ˜ (φ. t) φ(t). ψ).T ] [0. R(U. computed with DOLFIN version 0.3). ·) l2 .3). we introduce the dual problem ˜ (6. ·) l2 + S [0] (T ) max g (U.3) for a given dynamical system of the form (1. ˜ ¯ T ˜ The ﬁrst term. components such as u 2 in (4. ψ = (1. We take this ˜ u simple approach for the example problems presented below. ·)) dt = ≤ T 0 M j=1 ˜ (φ − πφ.10 [4]. 0 (φ.1) ˙ −φ(t) = J(¯. ψ) = (¯(T ). U − f (U. Numerical results We present numerical results for two model problems. In the simplest case of the cG(1) method for a partition of the interval (0. e ˜ ¯ [0. U. . ˜ ¯ This estimate is obtained by repeatedly solving the full dynamical system (1.1). To analyze the modeling error introduced by approximating the variance g ¯ with the subgrid model g . 0) to measure the error in the ﬁrst component of U . damping is introduced for high frequencies without aﬀecting low frequencies. We notice in particular that if the stability factor S [0] (T ) is of moderate size. ·)) dt ¯ u T 0 including both discretization and modeling errors. u ∂u T ˙ where the stability factor S [1] (T ) = 0 φ l2 dt measures the sensitivity to discretization errors for the given output quantity (¯(T ).3) for u ≈ u may be constructed. = 0 T ˙ (φ. ·) − g (u.COMPUTATIONAL MODELING OF DYNAMICAL SYSTEMS 5 6 JOHAN JANSSON. AND ANDERS LOGG As a result. ·) − g (u. 7. DOLFIN automatically creates the reduced model (3. R(U. ·)) dt ˜ kj max R(U. following the directions for the automation of computational mathematical modeling presented in [7]. we need to estimate the quantity g − g . ˙ φ l2 dt 6. length kj = tj − tj−1 . ˜ ¯ We thus obtain the error estimate (6.1) at a number of control points and comparing the subgrid model g with ˜ the computed variance g . .2) J(¯. ·) ˜ to a space of test functions can be used to subtract a test space interpolant πφ of the dual solution φ. To estimate the modeling error. ·) − g (U. The sensitivity to modeling errors ˜ ¯ T is measured by the stability factor S [0] (T ) = 0 φ l2 dt. we note that e(0) = 0 and ¯ ¯ ¯ ˙ φ + J(¯. 0 (φ. 2]). correu sponding to a subgrid model of the form g 2 (˜. R(U. and write u T (¯(T ). CLAES JOHNSON. As initial data for the full system at a control ¯ point. . To estimate the error e = U − u at ﬁnal time. ·) = −f2 (˜. ·) φ = 0. Error analysis The validity of a proposed subgrid model may be checked a posteriori. with the size of the perturbation chosen to reﬂect the initial oscillation at the fastest time scale.3) ˜ |(¯(T ). each of . 0. u φ(T ) = ψ. e − J e) dt = ¯ ¯ ˙ ˙ (φ. T ). e T The second term. ·)) dt ˜ ¯ = 0 (φ. U. ·) where J denotes the Jacobian of the right-hand side of the dynamical system (1.1) by resolving the full system in a short time simulation and then determining a constant subgrid model g . The automatic modeling implemented in DOLFIN is rudimentary and many improvements are possible. U. ˜ 1 (6. ·) − g (u. T ] into M subintervals I j = (tj−1 . The initial data ψ for the dual problem (6.1) evaluated at a mean value of the average u and the computed numerical ¯ (ﬁnite element) solution U ≈ u of the reduced system (3. g (U.g. e) dt u ¯ T 0 = 0 T ˙ (φ. U.

5 0. Dongarra. With a constant subgrid model g as in the example. [2] [3] J. as shown in Figure 3 and Figure 4. [7] A. Without resolving the fast time scales and ignoring the subgrid model. K˚ agstr¨m. Johnson. D = 2. Chalmers University of Technology. Cambridge University Press. [5] J.1. Hansbo. The solution for the two components of the simple model problem (2. as shown in Figure 6. we show the computed solution with τ = 10−4 . Introduction to adaptive methods for diﬀerential equations.phi.5 x 10 4 −7 Figure 2. the reduced model can no longer give an accurate representation of the full system. Computational Modeling of Complex Flows.. Ruhe and D. Computational Diﬀerential Equations. Skoogh. pp. DOLFIN. P. . Acta Numerica. 4·10 −7 ] (below). 2004. in Applied Parallel Computing — Large Scale Scientiﬁc and Industrial Problems. The simple model problem. The value of the subgrid model g1 is automatically determined ¯ to 0. 2002. to appear in Encyclopedia of Computational Mechanics. (2004). 0) √ the upper right large point mass at and x = (1.5 0 −0. Eriksson. and C. The automatic modeling is activated at time t = 2τ = 2 · 10 −7 . Hoffman and C.2495 ≈ 1/4. [4] J.5 1 1. giving a large time scale of size ∼ 10 and a small time scale of size ∼ 10−6 . B. http://www.COMPUTATIONAL MODELING OF DYNAMICAL SYSTEMS 7 8 0.3 0. 100] (above) and on [0. Hoffman and A.5 −1 0 10 −14 20 30 40 50 t 60 70 80 90 100 2 x 10 u1 (t) 1 0 0 1 2 3 x 10 4 −7 1 u2 (t) PSfrag replacements 0. Wa´niewski. The fast oscillations of the small point masses make the initially stationary structure of large point masses contract. References [1] K.2 0. In Figure 5. . A lattice with internal vibrations. The solution of the simple model problem (2. 1 (1991). PhD thesis.1) is shown in Figure 2 for κ = 10 18 and τ = 10−7 . u1 (t) 0. the distance D between the lower left large point mass at x = (0.5 3 3.1 0 0 10 20 30 40 50 60 70 80 90 100 1 u2 (t) PSfrag replacements 0. Hoffman. The second example is a lattice consisting of a set of p2 large and (p − 1)2 small point masses connected by springs of equal stiﬀness κ = 1. No. D.2. Lecture o s Notes in Computer Science. 1) remains constant. eds. [8] A. PhD thesis. 1996.5 −1 0 0. At this point. Computability and adaptivity in CFD. Estep. 1541. pp. Logg et al. 7.1) on [0.5 0 −0.. Johnson. (1995).5 2 t 2. E. Chalmers University of Technology. 105–158.chalmers. Automation of Computational Mathematical Modeling. the reduced model needs to be reconstructed in a new short time simulation. AND ANDERS LOGG 7.-O.4 JOHAN JANSSON. the reduced model ¯ stays accurate until the conﬁguration of the lattice has changed suﬃciently. which manages to correctly capture the oscillation in the diameter D of the lattice as a consequence of the internal vibrations at time scale 10−6 . Each large point mass is of size M = 100 and each small point mass is of size m = 10−12 . 491–502. Logg. [6] H.se/dolﬁn/. Problems with diﬀerent time scales. 1998. and J. When the change becomes too large. CLAES JOHNSON. Acta Numerica. Kreiss. J. Elmroth. Rational Krylov algorithms for eigenvalue computation and model reduction.

Detail of the lattice.2 0.19 d(t) 0.175 0 1 2 3 x 10 4 −4 D(t) Figure 4.409 PSfrag replacements ¢£¢£ ¢£¢£ ¢£¢£ ¢£ ¢£ ¢£ ¤¥¤¥ ¤¥¤¥ ¤¥¤¥ ¤¥ ¤¥ ¤¥ M M PSfrag replacements 1. Lattice consisting of p2 large masses and (p − 1)2 small masses. CLAES JOHNSON. t Figure 5. 10] and on [0.411 1. 4·10 −4 ].413 1.414 1. AND ANDERS LOGG ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ M ¦§¦§ ¦§¦§ ¦§¦§ ¦§ ¦§ ¦§ M 1.41 1.185 0.195 0. Distance D between the lower left large mass and the upper right large mass (above) and the distance d between the lower left large mass and the lower left small mass (below) as function of time on [0.415 JOHAN JANSSON.408 1.406 0 1 2 3 4 5 t 6 7 8 9 10 0.407 Figure 3. The arrows indicate the direction of vibration perpendicular to the springs connecting the small mass to the large masses. .18 PSfrag replacements 0. d(t) 1.412 D(t) m ¨¨¨¨© © © © 1. respectively.COMPUTATIONAL MODELING OF DYNAMICAL SYSTEMS 9 10 1.

36 0 20 40 t 60 80 100 Figure 6.39 1. 100] (right) for m = 10 −4 and τ = 1.1).39 PSfrag replacements 1. 20] (left) and on [0.COMPUTATIONAL MODELING OF DYNAMICAL SYSTEMS 1.3) and the dashed line represents the solution of the full system (1.42 11 D(t) 1. The diameter D of the lattice as function of time on [0.42 1. The solid line represents the diameter for the solution of the reduced system (3.36 0 5 10 t 15 20 1. .

- G40 60 Fuel Cell Test StationUploaded byDavi Batalha
- Fuel Cost Minimization in Multimodal pipelineUploaded byAutumn Hernandez
- Marine2013_isogeoUploaded byGiannis Panagiotopoulos
- IndexUploaded byAnonymous 37PvyXC
- 6EAF3d01Uploaded bykaryantoherlambang
- BR917059EN-CYMCAP70-NewFeaturesUploaded bysajuaanalsa
- CAM IIUploaded bypussyfaaaa
- 1-s2.0-S002002551300532X-mainUploaded byitzgaya
- 00581777Uploaded byKamugasha Kagonyera
- 1801.09756Uploaded byCarlos Faz
- Chap013 RevUploaded byNoga Rose
- PO SS2011 05.1 DynamicOptimization p11Uploaded byEverton Colling
- Iima Teaching Note MertonUploaded byKush Sharma
- SSRN-id1866674 (1)Uploaded byprasenjitjuprod
- bmw_finrep.ml.pdfUploaded byPrashanth
- Mounting Components EnusUploaded bychoonhooi
- Alternating Direction Method for image restoration: application to 3D biological imagingUploaded byinriaariana
- Neutrosophic Operational ResearchUploaded byscience2010
- US Senior Citizen Diabetes Prevention ProposalUploaded bylemonsong
- Pre Solving in Linear ProgrammingUploaded byRenato Almeida Jr
- Rockwell Autoamtion TechED 2017 - AP21 - Uncork the Value of Premium Wines With MESUploaded byIsaac Mendible
- 10.1109-90.803389Uploaded byMustapha Brahim
- Design of a Sequential Control CircuitUploaded bysbkulk
- chap07.pptUploaded byHassan Mosa
- K2UserManualUploaded byMary Cazacu
- Development and Application of a Hybrid Genetic Algorithm for Resource Optimization and ManagementUploaded bymanique_abeyrat2469
- Synthesis of a PumpingUploaded bypastcal
- 4-Assignment of Opration ResearchUploaded byism33
- Design Wind Speeds for MexicoUploaded byFernandochiaro
- MUSA MethodUploaded byRahmaniyah Dwi Astuti