Energy-Preserving Runge-Kutta methods Fasma Diele, Brigida Pace Istituto per le Applicazioni del Calcolo M. Picone, CNR, Via Amendola 122, 70126 Bari, Italy f.diele@ba.iac.cnr.it b.pace@ba.iac.cnr.it SDS2010, Monopoli, June 8 11, 2010 Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 1 / 28
OUTLINE Definition of the problem and motivations s-stage trapezoidal methods Conservation of Hamiltonian function of polynomial type High order conservative methods Energy-Preserving Near-DIRK methods Numerical tests Conclusions Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 2 / 28
DEFINITION OF THE PROBLEM We consider the numerical integration of Hamiltonian systems ( ) 0 I ẏ = J H(y), J =, I 0 where the Hamiltonian function H(y) is a polynomial. AIM: Define RK methods that exactly conserve the above Hamiltonian function: H(y n+1 ) = H(y n ) for all n and h > 0 Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 3 / 28
MOTIVATIONS (1/2) Many interesting Hamiltonian systems arising from different fields of study are defined by polynomial Hamiltonian functions. Furthermore any nonlinear Hamiltonian function may be in general well approximated by a polynomial. It is well known that symplectic RK methods only conserve quadratic Hamiltonian functions: H(y) = 1 2 y T Cy but, in general, fail to yield conservation for higher degree. So do symmetric methods. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 4 / 28
MOTIVATIONS (2/2) A few years ago, the unfruitful attempts to devise energy-preserving RK methods culminated in the general feeling that they could not exist even in the simpler case of polynomial Hamiltonians (A. Iserles and A. Zanna, Preserving algebraic invariants with Runge-Kutta methods, J. Comput. Appl. Math., 125, 2000, 69 81). Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 5 / 28
EXAMPLES Energy function evaluated over the numerical solution obtained by solving the quartic pendulum equation H(p, q) = 1 2 p2 + 1 2 q2 1 24 q4. by the Lobatto IIIA method of order four (left picture) and Gauss method of order six (right picture). Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 6 / 28
APPROACH (1/2) Classically, a numerical method in a given class (RK, multistep methods, etc.) is defined by selecting the coefficients in such a way that the order is maximized and a given number of extra conditions are satisfied. Depending on the kind of continuous problem that is to be solved, such extra conditions confer the method specific features, for example: a good conditioning, good linear stability properties, more efficiency in solving the nonlinear systems involved, etc. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 7 / 28
APPROACH (2/2) Accordingly, we wonder whether some parameters defining the method may be selected not to improve the order but to guarantee the conservation of the Hamiltonian function for the discrete solution y n. More specifically, we refer to the class of RK methods. QUESTION: Can we modify a given Runge Kutta formula by adding a number of internal stages in such a way that the resulting formula applied to our problem be conservative? Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 8 / 28
SKETCH OF THE IDEA: quadratic Hamiltonian (1/2) We consider one of the simplest RK methods: the trapezoidal method: y n+1 y n = 1 2 J ( H(y n) + H(y n+1 )) Multiplication of both sides by ( H(y n ) + H(y n+1 )) T yields ( H(y n ) + H(y n+1 )) T (y n+1 y n ) = 0 For quadratic Hamiltonian function this is equivalent to the conservation law: H(y n+1 ) = H(y n ), for all times t n Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 9 / 28
SKETCH OF THE IDEA: quadratic Hamiltonian (2/2) In fact we consider the segment σ n joining y n to y n+1 σ n (c) = (1 c)y n + cy n+1, with c [0, 1]. and the line integral H(y n+1 ) H(y n ) = H(y)dy = y n y n+1 1 0 σ n(c) T H(σ n (c)) dc 1 =(y n+1 y n ) T H(σ n (c)) dc 0 = 1 2 (y n+1 y n ) T ( H(y n ) + H(y n+1 )) =0 H(y) being linear. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 10 / 28
s-stage TRAPEZOIDAL METHODS The s-stage trapezoidal method is defined as y n+1 = y n + h s b i f (K i ). i=1 where K 0 = y n, K s = y n+1 and, for i = 2,..., s 1, K i are internal stages that are located over the segment σ n (c) = (1 c)y n + cy n+1. In the simplest case they are equally distributed: K i = σ n (c i ), i = 1,..., s, with c i = (i 1)h/(s 1). Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 11 / 28
SOME EXAMPLES When s = 2 we obtain the trapezoidal method; for s = 3 and s = 5 we obtain respectively the methods: y n+1 = y n + h ( 6 f (y n ) + 4f ( y n + y n+1 ) + f (y n+1 ) 2 ) and y n+1 = y n + h 90 ( 7f (y n ) + 32f ( 3y n + y n+1 4 +32f ( y n + 3y n+1 ) + 7f (y n+1 ) 4 ) + 12f ( y n + y n+1 ) ) 2 When applied to y = f (t), these become the Newton-Cotes quadrature formulae of order 4 and 6 respectively. On the other hand, when applied to general ODE problems their order reduces to two. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 12 / 28
BUTCHER ARRAY FORMULATION Written as a Runge-Kutta method, an s-stage trapezoidal method is defined by the following Butcher array: 0 0 0...... 0 c 1 c 1 b 1 c 1 b 2...... c 1 b s c 2. c 2 b 1. c 2 b 2....... c 2 b s. c s 1 c s 1 b 1 c s 1 b 2...... c s 1 b s c s b 1 b 2...... b s b 1 b 2...... b s It is easily seen that each method under consideration is symmetric. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 13 / 28
CONSERVATION OF ENERGY (1/2) As done for the trapezoidal method, starting from y n+1 = y n + hj s b i H(K i ), i=1 we obtain ( s b i H(K i ) T ) (y n+1 y n ) = 0. i=1 that will represent our conservation law. In fact assume that H(y) is a polynomial... Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 14 / 28
CONSERVATION OF ENERGY (2/2) 1 H(y n+1 ) H(y n ) =(y n+1 y n ) T H(σ n (c)) dc Suppose the number of the internal stages K i be enough to guarantee that the underlying quadrature formula is exact when applied to the polynomial H(σ n (c)). Then ) H(y n+1 ) H(y n ) =(y n+1 y n ) T ( s i=1 =0 0 b i H(K i ) Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 15 / 28
NUMERICAL TEST: Polynomial pendulum (1/2) We consider the pendulum equation defined by H(p, q) = 1/2p 2 + 1 cos q and retain a finite number of terms in the Taylor expansion of the cosine. In particular we consider: - H(p, q) = 1 2 p2 + 1 2 q2 1 24 q4, (quartic pendulum oscillator); - H(p, q) = 1 2 p2 + 1 2 q2 1 24 q4 + 1 720 q6, (pendulum oscillator of degree six); - H(p, q) = 1 2 p2 + 1 2 q2 1 24 q4 + 1 720 q6 + 1 40320 q8, (pendulum oscillator of degree eight). Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 16 / 28
NUMERICAL TEST: Polynomial pendulum (2/2) 3-stage (first row), 5-stage (second row) and 7-stage (third row) trapezoidal methods applied to the three pendulum problems. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 17 / 28
HIGH ORDER CONSERVATIVE METHODS (1/2) We introduce some example of methods of order four and six that exactly preserve the Hamiltonian function of separable Hamiltonian system, in the case where such function is a polynomial of degree at most three. These methods are symmetric and are defined as where... y n+1 = y n + h s b i f (K i ). i=1 Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 18 / 28
HIGH ORDER CONSERVATIVE METHODS (2/2) K 0 = y n, K s = y n+1 and, for i = 2,..., s 1, K i are internal stages that are located over quadratic curve of the phase space: σ n (c) = y n +2(K 2 y n )c +2(y n+1 2K 2 +y n )(c 1 2 )c, to get methods of order four, cubic curve of the phase space: σ n (c) = y n + 3(K 2 y n )c + 9 2 (K 3 2K 2 + y n )(c 1 3 )c + 9 2 (y n+1 3K 3 + 3K 2 y n )(c 1 3 )(c 2 3 )c, to get methods of order six. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 19 / 28
NUMERICAL TEST Methods of order four (first row) and of order six (second row), applied to cubic Hamiltonian (first column) and to quartic Hamiltonian (second column). Stepsize h = 1; number of points n = 1000. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 20 / 28
NOTES (1/2) The class of s-stage Trapezoidal Methods represents the first instance (and the first existence proof) of RK methods capable of providing a precise conservation of the energy, in the case where the Hamiltonian function is of polynomial type. See for example: F. Iavernaro, B. Pace. s-stage Trapezoidal Methods for the Conservation of Hamiltonian Functions of Polynomial Type. AIP Conf. Proc. 936, pp. 603-606, 2007. F. Iavernaro, B. Pace. Conservative Block-Boundary Value Methods for the Solution of Polynomial Hamiltonian Systems. AIP Conf. Proc. 1048, pp. 888-891, 2008. B. Pace. Symmetric schemes for the solution of Hamiltonian problems, PhD thesis, University of Bari (Italy), 2008. F. Iavernaro, D. Trigiante. High-order symmetric schemes for the energy conservation of polynomial Hamiltonian problems. JNAIAM, vol. 4, n. 1 2, pp. 87 101, 2009. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 21 / 28
NOTES (2/2) An alternative approach based on B-series and average vector fields methods has been recently provided in E. Celledoni, Robert I. McLachlan, D.I. McLaren, B. Owren, G. Reinout, W. Quispel and W.M. Wright. Energy-preserving Runge-Kutta Methods, ESAIM: M2AN 43 (2009) 645-649. A modification of collocation methods extending the averaged vector field method of high order has been developed by E. Hairer in Energy-preserving variant of collocation methods, to appear in JNAIAM, 2010. These methods are connected to the methods studied by Iavernaro and Trigiante (JNAIAM 2009) when particular quadrature formulas are chosen. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 22 / 28
ENERGY-PRESERVING NEAR-DIRK METHODS: first results No explicit RK method can be energy-preserving for polynomial Hamiltonians of degree higher than two and all the energy-preserving RK methods provided in literature are fully implicit. QUESTION: Can we define energy-preserving near-diagonally implicit (i.e. with sparse Butcher array) RK symmetric methods that exactly conserve polynomial Hamiltonian function? Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 23 / 28
METHOD OF ORDER 2 0 0 0 0 0 1/3 1/12 1/4 0 0 2/3 1/8 3/8 1/8 3/24 1 1/8 3/8 3/8 1/8 1/8 3/8 3/8 1/8 Near-DIRK second order method applied to the cubic Hamiltonian (first row) and to quartic Hamiltonian (second row). Stepsize h = 1; number of points n = 1000. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 24 / 28
METHOD OF ORDER 2 0 0 0 0 0 0 1/4 1/24 1/6 1/24 0 0 1/2 1/12 1/3 1/12 0 0 3/4 1/12 1/3 1/8 1/6 1/24 1 1/12 1/3 1/6 1/3 1/12 1/12 1/3 1/6 1/3 1/12 Near-DIRK second order method applied to the cubic Hamiltonian (first row), to quartic Hamiltonian (second row) and to Hamiltonian of degree five (third row). Stepsize h = 1; number of points n = 1000. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 25 / 28
SKETCH OF THE IDEA We consider γ n joining y n to y n+1 γ n (c) = σn(c) 1 = (1 2c)y n + 2cy n+ 1, with c [0, 1 2 2 ] σ 2 n(c) = (1 2c)y n+ 1 2 and the line integral H(y n+1 ) H(y n ) = H(y)dy = = 1/2 0 =... = 0 y n y n+1 σ 1 n (c) T H(σ 1 n(c)) dc + + 2cy n+1, with c [ 1 2, 1] 1 0 1 1/2 γ n(c) T H(σ n (c)) dc σ 2 n (c) T H(σ 2 n(c)) dc Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 26 / 28
METHOD OF ORDER 4 Near-DIRK fourth order methods applied to the cubic Hamiltonian (first column) and to quartic Hamiltonian (second column). Stepsize h = 1; number of points n = 1000. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 27 / 28
CONCLUSIONS The class of s-stage Trapezoidal Methods represents the first instance of RK methods capable of providing a precise conservation of the energy, in the case where the Hamiltonian function is of polynomial type.these are methods of order two that generalize the classical trapezoidal method. After that, the underlying idea, has permitted the construction of energy-preserving RK methods of orders 4 and 6 and has leaded to the discovery of arbitrary high order implicit energy preserving RK methods. The research of energy-preserving near-diagonally implicit RK formulae has being the subject of the current research. Fasma Diele, Brigida Pace (IAC-CNR) Energy-Preserving RK methods 11/06/2010 28 / 28