High order explicit methods for parabolic equations and stiff ODEs (DUMKA3, DUMKA4, ROCK2, ROCK4) Alexei Medovikov Tulane University A. Abdulle, A. Medovikov Second order Chebyshev methods based on orthogonal polynomials. Numerische Mathematik V90.1. pp.1-18 Medovikov A.A. High order explicit methods for parabolic equations. BIT, V38,No2,pp.372-390 Lebedev V.I., Medovikov A.A. Method of second order accuracy with variable time steps. Izv. Vyssh. Uchebn. Zaved. Mat. no. 9, 52--60 (English translation). WELCOME TO DUMKALAND Explicit numerical methods for stiff differential equations Dumka3 Examples Download DUMKA3.cpp (C++) Download DUMKA3.c (C) Download DUMKA3.f (FORTRAN) Download ROCK2/ROCK4 (rock.tar)(FORTRAN) Applications (medicine, biology, apply math ...) Motility of microorganisms E-Mail:amedovik@math.tulane.edu Phone:(504)862-8396 Address: Mathematics Department Tulane University New Orleans, LA Web: http://www.math.tulane.edu/~amedovik DUMKA3 - integrates initial value problems for systems of first order ordinary differential equations y'=f(y,t). It is based on a family of explicit Runge-KuttaChebyshev formulas of order three. It uses optimal third order accuracy stability polynomials with the largest stability region along the negative real axis. Examples of solution of stiff differential equations by explicit methods Brusselator equation 2u u 2u 2 f(x, y, t) 1 u v 4.4u 2 2 t x y 2v v 2v 2 3.4u u v 2 t y 2 x Nagumo nerve conduction equation u 2u f(u) v t x 2 v n(u bv) t 5 if (x 0.3)2 ( y 0.6)2 0.12 and t 1.1 f(u) else 0, Burgers equation duk uk2 1 uk2 1 u 2uk uk 1 k 1 dt 4x x2 Summary , due to conditional stability 1. Stability: Explicit methods have small stepsize 2. Variable steps can be used to maximize mean stepsize of a sequence of n explicit methods i / n c pn2 / n (n) 3. Optimal sequence of explicit steps can be found in terms of roots of stability polynomials, which approximate exponential function and possess n p Chebyshev alternation Rn(z) 1 z z / p! aizi p 1 Asymptotic formulas and orthogonal polynomials can be used to construct such polynomials, even very high degree polynomials (n > 1000) 4. 5. Accuracy: In order to construct high order explicit methods for non-linear ODE, we start with stability polynomials and we use B-series in order to satisfy order conditions, and build Runge-Kutta methods for non-liner ODEs 6. Efficient stepsize control and step rejection procedure are achieved via embedded methods 7. For automatic computation of spectral radius we used non-linear power method. Stability analysis of explicit RK methods dy f( y, t) dt ODEs: Explicit Euler method: Test equation: Stability function: Stability region: Goal: y 1 y0 y(t0 ) y0 f( y0, t0 ) y' λy y1 y0 y0 (1 )y0 n y n (1 ) y0 yn Rn(h)y0 where h is a total step S z C : Rn(z) 1, z h Find stability polynomial which maximize average stepsize {Sp( f / y) S} h / n , given Stability analysis of explicit RK methods Explicit Euler method: y1 (1 )y0 Rn() 1 1 Stability condition of explicit Euler method: h 2/ Linear stability analysis for non-linear ODEs: ~ y err y 0 0 0 ~ ( y f( y )) ( y ~ f( y ~) y1 y 1 0 0 0 0 ~ ) J( y )(y y ~) (y y 0 0 0 0 0 err1 err0 J(y0)err0 (I J(y0))err0 2 / M where M (f(y) / y) {Sp( f / y) stability region} Linear stability RK methods vs. Stability RK methods? R(z) 1 z, h , z n Rn(h) (1 i) i 1 h n i i 1 dRn( ) d 0 Can we solve stiff ordinary differential equations (ODE) by explicit methods with stepsize larger than 2/M? Example: y' 500( y cos(t )) y(0) 0 2 / 500 Consider two steps 1 and 2 where 1 1 / 500 y1 (1 500 1 ) y0 1 cos(t0 ) y2 (1 500 2 ) y1 2 cos(t0 1 ) y2 (1 500 2 )(1 5001 ) y0 (1 500 2 )1 cos(t0 ) 2 cos(t0 1 ) if 1 2 2 / 500 instability if 2 1 1 / 500 stability (1 500 2)(1 5001) 0 1 for any 2 R1(h) (1 ), h y' 500(y cos(t)) R1(h) (1 h1)(1 h2), h (h1 h2) n R1(h) (1 hi), h i 1 n h i i 1 Original idea of Runge-Kutta-Chebyshev methods Consider sequence of Euler steps and find an optimal polynomial yn n (1 i )y0 h | Rn( ) || h n (1 i ) | 1 i 1 i / n i 1 i i 1 i 1 n n dRn( ) d 0 Sp ( A) [0, M ] S as large as possible If we have found the optimal stability polynomial, the variable sequence of steps can be found in terms of the roots of the stability polynomial i 1 / i The solution for n-stage Runge-Kutta-Chebyshev method order p=1 is given by Chebyshev stability polynomial. 1 x0 cos n arccosx Rn( ) , x x0 , x0 1 cos n arccosx0 M 0 M 1 x( ) x0, x(0) x0 1 1 cos n arccosx0 x 1 max Rn( ) 1, 0 M M 1 x0 sin(n arccos(x0 )) 1 x0 dRn( ) h(x0 ) n d 0 1 x02 cos(n arccos(x0 )) M 2 h(1) lim h(x0 ) n x0 1 M 2 2 2 h n /n n nheuler M M 2 Runge-Kutta methods n Yi y0 h aijf(t0 cjh, Yj), j 1 n y1 y0 h bjf(t0 cjh, Yj). j 1 c1 c2 cn 1 cn a11 a21 an 11 an1 b1 a12 a1n 1 a1n a2n an 12 an 1n an2 ann 1 ann b2 bn 1 bn cA b Stability function of explicit Runge-Kutta method y' y Y (Y1, , Yn )t n Yi y0 h aij( )Yj, j 1 n y1 y0 h bj( )Yj, y 0 ( y0, , y0 )t j 1 Y y 0 zΑY t y 1 y0 z b Y z h y1 (1 z b (I z) 1)y0, 1 (1 1)t t 1 if A n 0, aij 0, j i, t t t 2 n n 1 Rn(z) 1 z b 1 z b 1 z b 1 1 z z / 2! z / p! 2 p n i d z i i p 1 Theorem (T. Riha): Among all polynomials of the order p the polynomial which possess Chebyshev alternant, would maximize real stability interval ln Rn(z) 1 z z / 2 z 2 p / p! n aizi i p 1 Rn(z) 1 for z [ln,0] or equivalently, the polynomial which possess Chebyshev alternant: M z ln 2 ln ln Rn( ) 1 / 2! M M l n M p / p! n i p 1 i l di n M has maximal possible stepsize dRn( ) ln h d M , given stability Rn() 1, [0, M] Theorem : Let w(x) be a positiveweight functionon the interval[1,1] which satisfies 0 c1 (x) c2 and | (x ) (x) || ln |1 L(where c1,2, , L are fixed positive numbers). Then the polynomialPn(x) of the least deviationfrom zero withthe weight function (x)1 / 2 in the intrval[1,1] is expressedin asymptotical form as (x)Pn(x) 2 1 where ( ) 2 cos(n ( )) n(x), arccos(x) ln (z) ln (x) 1 x 2 dz z x 1 z2 1 1 Theorem : Let w(x) be a positiveweight function on the interval[1,1] which satisfies0 c1 w(x) c2 and | w(x ) w(x) || ln |1 L (where c1,2, Then the orthogonal polynomials w(x) / sqrt(1 x 2 ), satisfy , L Pn(x) associated uniformly on are fixed positive numbers). with [1,1] : w(x)Pn(x) cos(n ( )) (ln(n) ), arccos(x) where 1 ( ) 2 ln w(z) ln w(x) 1 x 2 dz 1 z x 1 z2 1 the weight function p p p p 1 2 3 4 Rn(0) Rn(0) Rn(0) Rn(0) 1 1 1 1 R'n(0) R'n(0) R'n(0) R'n(0) ln ln R'n'(0) ln2 ln R'n'(0) ln2 R'n''(0) ln3 ln R'n'(0) ln2 R'n''(0) ln3 (1) R'n'''(0) ln4 Two algorithms of computation of stability polynomials: p(x) (x xj) DUMKA3,4 1. For given n calculate weight p j 1 and roots via asymptotic formula for polynomials Pn p (x) of the least deviation from zero: (n p)k ( k ) (k 0.5), k 1, , n p j1 k (k 0.5) n p (kj) , xk cos(k ) n p 2. For given n calculate weight p()Rn p( ) satisfies (1), w p(x) p (x xj) j 1 so that the polynomial R ( ) w ( )P ( )satisfies (1), n p n p where Pn p (x) is orthogonal polynomial with the weight (w(x))2 1 x2 ROCK2,4, RKC so that the polynomial Rn( ) w 2(x) 2 (x xj) j 1 Tk(x1) Tk(x2 ) Tk'(x1) Tk'(x2 ) Tk(x) Tk 1(x1) Tk 1(x2 ) Tk' 1(x1) Tk' 1(x2 ) Tk 1(x) Pk(x) C ' ' T ( x ) T ( x ) T ( x ) T k 2 1 k 2 2 k 2 1 k 2( x2 ) Tk 2( x) 2 w 2(x) Tk 3(x1) Tk 3(x2 ) Tk' 3(x1) Tk' 3(x2 ) Tk 3(x) Tk 4(x1) Tk 4(x2 ) Tk' 4(x1) Tk' 4(x2 ) Tk 4(x) 1 P (x)P(x) k 1 l w(x)2 1 x 2 dx kl Rn(x) w 2(x)Pn 2(x) cos(n ( )) p 1 Rn(0) 1 R'n(0) ln p 2 Rn(0) 1 R'n(0) ln R'n'(0) ln2 Pk(z) ( kz k )Pk 1(z) kPk 2(z), z [ M,0] Accuracy: Order conditions of Runge-Kutta methods Taylor expansions of the exact solution and numerical solution : dy J d 2 y J h2 d 3 y J h3 y (h) y h 2 3 dt dt 2 dt 6 h2 h3 J J J I J I K J I K y0 f h f f f f f f I IK I fK f 2 6 J J 0 h h2 J I bt31 fIKJ f If K bt32 fIJ fKIf K b( )f h bt21 fI f 2 6 ~ (h) y y J J 0 J I where b( ) J f f f J I 2f J f J f I K J I K I K J I K f , fIK f f f f , fI fK f f y I y I y K y I y K I t b1 n b i i 1 b(t21 ) 2 n ba i ij t 2b Α1 i,j 1 b(t31 ) 3 n biaijaik b(t31 ) 6 i,j,k 1 b(t41 ) 4 n biaijaikail i,j,k,l 1 t 24b Α 3 1 n ba a i ij jk t 6 b Α 21 i,j,k 1 b(t42 ) 8 n biaijaikajl i,j,k,l 1 b(t43 ) 12 n biaijajkajl i,j,k,l 1 b(t44 ) 24 n ba a a i ij jk jl i,j,k,l 1 Construction of pth order composition method Let us consider two consecutive steps by Runge-Kutta methods A and B. We call the method which is the result of one step of A and one step of B as the composition method C=B(A) Stability function of the composition method C is the product of stability functions of the methods A and B Theory of composition methods allows to calculate Taylor expansion of composition methods: c( ) c(t 21 ) c(t31 ) c(t32 ) c(t 41 ) c(t 42 ) c(t 43 ) c(t 44 ) b( ) a ( ) b(t 21 ) 2b( )a ( ) a (t 21 ) b(t31 ) 3b( )a 2 (t 21 ) 3b(t 21 )a 2 ( ) a (t31 ) b(t32 ) 3b( )a (t 21 ) 3b(t 21 )a ( ) a (t32 ) b(t 41 ) 4b( )a 3 ( ) 6b(t 21 )a 2 ( ) 4b(t31 )a ( ) a (t 41 ) b(t 42 ) 4b( )a (t 21 )a ( ) 6 1 / 3b(t 21 )a (t 21 ) 2 / 3b(t 21 )a 2 ( ) 42 / 3b(t31 )a ( ) 1 / 3b(t32 )a ( ) a (t 42 ) b(t 43 ) 4b( )a (t31 ) 6b(t 21 )a 2 ( ) 4b(t31 )a ( ) a (t 43 ) b(t 44 ) 4b( )a (t32 ) 6b(t 21 )a (t 21 ) 4b(t32 )a ( ) a (t 44 ) Given method A, define method B such that method C=B(A) will be method of the order p and stability function of the method C will be product of the stability functions of the methods A and B. Coefficients of Taylor expansion of the method B can be expressed in terms of coefficients of the methods C and B p 1 p 2 p 3 c( ) 1 c(t21 ) 1 c(t31 ) 1, c(t31 ) 1 b( ) b(t21 ) b(t31 ) b(t32 ) b(t41 ) p 4 c(t41 ) 1, c(t42 ) 1, c(t43 ) 1, c(t44 ) 1 1 a( ) 1 (2b( )a( ) a(t21 )) 1 (3b( )a2(t21 ) 3b(t21 )a2( ) a(t31 )) 1 (3b( )a(t21 ) 3b(t21 )a( ) a(t32 )) 1 (4b( )a3( ) 6 b(t21 )a2( ) 4b(t31 )a( ) a(t41 )) 1 (4b( )a(t21 )a( ) 6 1 / 3b(t21 )a(t21 ) 2 / 3b(t21 )a2( ) b(t42 ) 42 / 3b(t31 )a( ) 1 / 3b(t32 )a( ) a(t42 )) b(t43 ) 1 (4b( )a(t31 ) 6 b(t21 )a2( ) 4b(t31 )a( ) a(t43 )) b(t44 ) 1 (4b( )a(t32 ) 6 b(t21 )a(t21 ) 4b(t32 )a( ) a(t44 )) Examples of the method A (RKC) and DUMKA: Y0 y0 Y1 y0 h1f(Y0 ) Yj hjf(Yj 1) jYj 1 jYj 2, j 2, , n p yi 1 yi f(y0, t0), i 1, , n p Equations for coefficients of the method B p 2 b1 b 2 b3 b( ) b 2c2 b3 c3 b(t21 ) / 2 p 3 b1 b 2 b3 b( ) b 2c2 b3 c3 b(t21 ) / 2 2 2 b 2c2 b3 c3 b(t31 ) / 3 b 2 a32 c2 b(t32 ) / 6 p 4 b1 b 2 b3 b3 b( ) b 2c2 b3 c3 b4c4 b(t21 ) / 2 2 2 2 b 2c2 b3 c3 b4c4 b(t31 ) / 3 3 3 3 b 2c2 b3 c3 b4c4 b(t41 ) / 4 b3 a32 c2 b4(a42 c2 a43 c3 ) b(t32 ) / 6 b3 a32 c2c3 b4c4(a42 c2 a43 c3 ) b(t42 ) / 8 2 2 2 b3 a32 c2 b4(a42 c2 a43 c3 ) b(t43 ) / 6 b a a c b(t ) / 24 44 4 43 42 2 Embedded methods hp d py y0 C0 (h p 1) p p! dh y p 1 y p 1 1 h p 1 d p 1y y0 C1 ( h p 2 ) p 1 ( p 1)! dh h p 1 d p 1y y(h) y0 C 2 (h p 2 ) p 1 ( p 1)! dh err y(h) y err y p 1 errnew y(h) y1p C new hnew errnew tol C new Cold p 1 C new err / hold p 1 hold err p 1 tol hnew 1 / p 1 hnew tol hold err p 1 1 p 1 y p 1 1 d p 1y C0 h p 1 O(h p 2 ) p 1 ( p 1)! dh 1 d p 1y C0 h p 1 O(h p 2 ) p 1 ( p 1)! dh Embedded methods Yi n y0 h aijf(t0 cj h, Yj), j 1 y1 n y0 h bjf(t0 cjh, Yj), j 1 ~ y 1 n y0 ~ h bjf(t0 cjh, Yj), j 1 err ~ y1 y 1 bi 1 and bici 1 / 2 b(t ) 1, b(t ) 1 31 32 ~ bi 1 ~ bci 1 / 2 Embedded composition method C’=B’(A) 0 0 0 c2 a21 0 0 c3 a31 a32 0 0 b1 ~ b1 b1 ~ b2 b1 ~ b3 ~ ~ ~ ~ b 1 b2 b3 b4 b( ) ~ ~ ~ b2c2 b3c2 b4 b( ) b(t21 ) / 2 ~ b4 0 0 0 0 0 c2 a21 0 0 0 c3 a31 a32 0 0 c4 a41 a42 a43 0 b1 b2 b3 b4 ~ ~ ~ ~ ~ b1 b2 b3 b4 b5 5 ~ bi b( ) i~1 ~ ~ ~ b c b 3c3 b4c4 b5 b( ) b(t21 ) / 2 2 2 ~ 2 ~ ~ ~ b c b3c32 b4c42 b5 b 2( ) b(t31 ) / 3 2 2 ~ ~ ~ b 3 a32c2 b4( a42c2 a43c3 ) b5( b2c2 b3c3 b3c4 ) b(t32 ) / 6 Numerical results duk uk2 1 uk2 1 u 2uk uk 1 k 1 dt 4x x 2 u(0) 1.5x(1 x)2, 0.0005, x [0,1], t [0,2.5] | Rn ( ) | 1 Rn ( ) [1,0] max | Rn (i ) | w p ( x) Pn p ( x) w p ( x0 ) Pn p ( x0 ) , dy f( y) dt x x0 (1 x0 ) (2)