Exponential Integrators John C. Bowman and Malcolm Roberts (University of Alberta) June 11, 2009 www.math.ualberta.ca/ bowman/talks 1
Outline Exponential Integrators Exponential Euler History Generalizations Stationary Green Function Higher-Order Vector Case Lagrangian Discretizations Charged Particle in Electromagnetic Fields Embedded Exponential Runge Kutta (3,2) Pair Conclusions 2
Exponential Integrators Typical stiff nonlinear initial value problem: dy dt + η y = f(t,y), y(0) = y 0. Stiff: Nonlinearity f varies slowly in t compared with the value of the linear coefficient η: 1 df f dt η Goal: Solve on the linear time scale exactly; avoid the linear time-step restriction ητ 1. In the presence of nonlinearity, straightforward integrating factor methods (cf. Lawson 1967) do not remove the explicit restriction on the linear time step τ. 3
Instead, discretize the perturbed problem with a scheme that is exact on the time scale of the solvable part. 4
Exponential Euler Algorithm Express exact evolution of y in terms of P(t) = e ηt : ( ) y(t) = P 1 (t) y 0 + t 0 fp d t. Change variables: P d t = η 1 dp ( P(t) y(t) = P 1 (t) y 0 + η 1 1 f dp ). Rectangular approximation of integral Exponential Euler: ( y i+1 = P 1 y i + P 1 ) f i, η where P = e ητ and τ is the time step. The discretization is now with respect to P instead of t. 5
Exponential Euler Algorithm (E-Euler) y i+1 = e ητ y i + 1 e ητ η f(y i ), Also called Exponentially Fitted Euler, ETD Euler, filtered Euler, Lie Euler. As τ 0 the Euler method is recovered: y i+1 = y i + τf(y i ). If E-Euler has a fixed point, it must satisfy y = f(y) ; this is η then a fixed point of the ODE. In contrast, the popular Integrating Factor method (I-Euler). y i+1 = e ητ (y i + τf i ) can at best have an incorrect fixed point: y = τf(y) e ητ 1. 6
Comparison of Euler Integrators dy dt + y = cos y, y(0) = 1. 0 error 0.01 0.02 euler i euler e euler 0.03 0 1 2 3 4 5 t 7
History Certaine [1960]: Exponential Adams-Moulton Nørsett [1969]: Exponential Adams-Bashforth Verwer [1977] and van der Houwen [1977]: Exponential linear multistep method Friedli [1978]: Exponential Runge-Kutta Hochbruck et al. [1998]: Exponential integrators up to order 4 Beylkin et al. [1998]: Exact Linear Part (ELP) Cox & Matthews [2002]: ETDRK3, ETDRK4; worst case: stiff order 2 Lu [2003]: Efficient Matrix Exponential 8
Hochbruck & Ostermann [2005a], Hochbruck & Ostermann [2005b]: Explicit Exponential Runge-Kutta; stiff order conditions. 9
Generalization Let L be a linear operator with a stationary Green s function G(t,t ) = G(t t ): G(t,t ) t + LG(t,t ) = δ(t t ). Let f be a continuous function of y. Then the ODE has the formal solution dy dt + Ly = f(y), y(0) = y 0, y(t) = e t 0 Ldt y 0 + t 0 G(t t )f(y(t )) dt. 10
Letting s = t t : y(t) = e t 0 Ldt y 0 + t 0 G(s)f(y(t s)) ds. Change integration variable to h = H(s) = s 0 G( s) d s: y(t) = e t 0 Ldt y 0 + H(t) 1 f ( y(t H 1 (h)) ) dh. Rectangular rule Predictor (Euler): Trapezoidal rule Corrector: ỹ(t) e t 0 Ldt y 0 + f(y(0))h(t). y(t) e t 0 Ldt y 0 + f(y(0)) + f(ỹ(t)) H(t). 2 11
Other Generalizations Higher-order exponential integrators: Hochbruck et al. [1998], Cox & Matthews [2002], Hochbruck & Ostermann [2005a], Bowman et al. [2006]. Vector case (matrix exponential P = e ηt ). Exponential versions of Conservative Integrators [Bowman et al. 1997], [Shadwick et al. 1999], [Kotovych & Bowman 2002]. Lagrangian discretizations of advection equations are also exponential integrators: u t + v x u = f(x,t,u), u(x, 0) = u 0(x). η now represents the linear operator v x P 1 u = e tv x u corresponds to the Taylor series of u(x vt). 12
Higher-Order Integrators General s-stage Runge Kutta scheme: y i = y 0 + τ i 1 j=0 a ij f(y j,t + b j τ), (i = 1,...,s). Butcher Tableau (s=4): b 0 a 10 b 1 a 20 a 21 b 2 a 30 a 31 a 32 b 3 a 40 a 41 a 42 a 43 13
Higher-Order Exponential Integrators dy dt + η y = f(t,y), y(0) = y 0. Let x = e ηt, u = xy. Then dx/dt = ηx, so that du dx = d(xy) dx = y + xdt dy dx dt = y + 1 η (f ηy) = f η Apply conventional integrator to du dx = f η. When y is evolved from t = 0 to t = τ, the new independent variable goes from x = 1 to x = e ητ. 14
Vector Case When y is a vector, ν is typically a matrix: dy + νy = f(y). dt Let z = ντ. Discretization involves ϕ 1 (z) = z 1 (e z 1). Higher-order exponential integrators require ) j 1 ϕ j (z) = z (e j z z k. k! k=0 Exercise care when z has an eigenvalue near zero! Although a variable time step requires re-evaluation of the matrix exponential, this is not an issue for problems where the evaluation of the nonlinear term dominates the computation. Pseudospectral turbulence codes: diagonal matrix exponential. 15
Charged Particle in Electromagnetic Fields Lorentz force: mdv q dt = 1 v B + E. c Efficiently compute the matrix exponential exp(ω), where Ω = q mc τ 0 B z B y B z 0 B x. B y B x 0 Requires 2 trigonometric functions, 1 division, 1 square root, and 35 additions or multiplications. The other necessary matrix factor, Ω 1 [exp(ω) 1] requires care, since Ω is singular. Evaluate it as lim [(Ω + λ 0 λ1) 1 (e Ω 1)]. 16
Motion Under Lorentz Force Exact, PC, E-PC trajectories of a particle under Lorentz force. 17
Bogacki Shampine (3,2) Pair Embedded 4-stage pair [Bogacki & Shampine 1989]: 0 1 2 1 2 0 3 4 3 4 2 9 1 3 4 9 3rd order 1 7 24 1 4 1 3 1 8 2nd order Since f(y 3 ) is just f at the initial y 0 for the next time step, no additional source evaluation is required to compute y 4 [FSAL]. 18
An Embedded 4-Stage (3,2) Exponential Pair Letting z = ντ and b 4 = 1: y i = e b iντ y 0 + τ i 1 j=0 a 10 = 1 ( ) 1 2 ϕ 1 2 z, a 20 = 3 ( ) 3 4 ϕ 1 4 z a 21, a 21 = 9 8 ϕ 2 a ij f(y j,t + b j τ), ( ) 3 4 z + 3 8 ϕ 2 (i = 1,...,s). ( ) 1 2 z, a 30 =ϕ 1 (z) a 31 a 32, a 31 = 1 3 ϕ 1(z),a 32 = 4 3 ϕ 2(z) 2 9 ϕ 1(z), a 40 =ϕ 1 (z) 17 12 ϕ 2(z), a 41 = 1 2 ϕ 2(z), a 42 = 2 3 ϕ 2(z), a 43 = 1 4 ϕ 2(z). y 3 has stiff order 3 [Hochbruck and Ostermann 2005] (order is preserved even when ν is a general unbounded linear operator). y 4 provides a second-order estimate for adjusting the time step. ν 0: reduces to [3,2] Bogacki Shampine Runge Kutta pair. 19
Application to GOY Turbulence Shell Model E(k) 10 1 10 0 10 1 10 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 10 10 10 11 10 12 10 13 10 14 10 15 10 16 10 17 10 18 10 19 10 20 10 21 10 0 10 1 10 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 10 10 k 20
Conclusions Exponential integrators are explicit schemes for ODEs with a stiff linearity. When the nonlinear source is constant, the time-stepping algorithm is precisely the analytical solution to the corresponding first-order linear ODE. Unlike integrating factor methods, exponential integrators have the correct fixed point behaviour. We present an efficient adaptive embedded 4-stage (3,2) exponential pair. A similar embedded 6-stage (5,4) exponential pair also exists. Care must be exercised when evaluating ϕ j near 0. Accurate optimized double precision routines for evaluating these functions are available at www.math.ualberta.ca/ bowman/phi.h 21
Asymptote: 2D & 3D Vector Graphics Language Andy Hammerlindl, John C. Bowman, Tom Prince http://asymptote.sf.net (freely available under the GNU public license) 22
Asymptote Lifts TEX to 3D Acknowledgements: Orest Shardt (U. Alberta) 23
References [Beylkin et al. 1998] G. Beylkin, J. M. Keiser, & L. Vozovoi, J. Comp. Phys., 147:362, 1998. [Bogacki & Shampine 1989] P. Bogacki & L. F. Shampine, Appl. Math. Letters, 2:1, 1989. [Bowman et al. 1997] [Bowman et al. 2006] J. C. Bowman, B. A. Shadwick, & P. J. Morrison, Exactly conservative integrators, in 15th IMACS World Congress on Scientific Computation, Modelling and Applied Mathematics, edited by A. Sydow, volume 2, pp. 595 600, Berlin, 1997, Wissenschaft & Technik. J. C. Bowman, C. R. Doering, B. Eckhardt, J. Davoudi, M. Roberts, & J. Schumacher, Physica D, 218:1, 2006. [Certaine 1960] J. Certaine, Math. Meth. Dig. Comp., p. 129, 1960. [Cox & Matthews 2002] S. Cox & P. Matthews, J. Comp. Phys., 176:430, 2002. [Friedli 1978] A. Friedli, Lecture Notes in Mathematics, 631:214, 1978. [Hochbruck & Ostermann 2005a] M. Hochbruck & A. Ostermann, SIAM J. Numer. Anal., 43:1069, 2005. [Hochbruck & Ostermann 2005b] M. Hochbruck & A. Ostermann, Appl. Numer. Math., 53:323, 2005. [Hochbruck et al. 1998] M. Hochbruck, C. Lubich, & H. Selfhofer, SIAM J. Sci. Comput., 19:1552, 1998. [Kotovych & Bowman 2002] O. Kotovych & J. C. Bowman, J. Phys. A.: Math. Gen., 35:7849, 2002. [Lu 2003] Y. Y. Lu, J. Comput. Appl. Math., 161:203, 2003. [Nørsett 1969] S. Nørsett, Lecture Notes in Mathematics, 109:214, 1969. [Shadwick et al. 1999] B. A. Shadwick, J. C. Bowman, & P. J. Morrison, SIAM J. Appl. Math., 59:1112, 1999. [van der Houwen 1977] P. J. van der Houwen, Construction of integration formulas for initial value problems, North- Holland Publishing Co., Amsterdam, 1977, North-Holland Series in Applied Mathematics and Mechanics, Vol. 19. [Verwer 1977] J. Verwer, Numer. Math., 27:143, 1977.