# 21 - Runge-Kutta methods Systems of ODEs Time-stepping for...

• Notes
• 36

This preview shows page 1 - 11 out of 36 pages.

Runge-Kutta methods Systems of ODEs Time-stepping for systems One-Step Methods Dhavide Aruliah UOIT MATH 2070U c D. Aruliah (UOIT) One-Step Methods MATH 2070U 1 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems One-Step Methods 1 Runge-Kutta methods 2 Systems of ordinary differential equations Higher-order ODEs and 1 st -order systems 3 Time-stepping methods for 1 st -order IVP systems c D. Aruliah (UOIT) One-Step Methods MATH 2070U 2 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems Runge-Kutta methods Observe various methods can be expressed as y i + 1 = y i + h φ where φ is an increment function Euler’s method k 1 = f ( t i , y i ) , y i + 1 = y i + hk 1 General form of increment function is φ = a 1 k 1 + a 2 k 2 + · · · + a s k s where { a j } s j = 1 are constants and { k j } s j = 1 are slopes c D. Aruliah (UOIT) One-Step Methods MATH 2070U 4 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems Runge-Kutta methods Generic explicit Runge-Kutta methods are of the form k 1 = f ( t i , y i ) k 2 = f ( t i + p 1 h , y i + q 11 k 1 h ) k 3 = f ( t i + p 2 h , y i + q 21 k 1 h + q 22 k 2 h ) . . . k s = f ( t i + p s - 1 h , y i + q s - 1,1 k 1 h + q s - 1,2 k 2 h + · · · + q s - 1, s - 1 k s - 1 h ) y i + 1 = y i + h ( a 1 k 1 + a 2 k 2 + · · · + a s k s ) Specific coefficients derived using Taylor series to generate formulas of prescribed accuracies c D. Aruliah (UOIT) One-Step Methods MATH 2070U 5 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems Runge-Kutta methods of order 2 Generic 2-stage method is k 1 = f ( t i , y i ) , k 2 = f ( t i + p 1 h , y i + q 11 k 1 h ) , y i + 1 = y i + h ( a 1 k 1 + a 2 k 2 ) Infinitely many 2-stage second-order accurate methods determined by equations a 1 = 1 - a 2 , p 1 = 1 2 a 2 , q 11 = 1 2 a 2 c D. Aruliah (UOIT) One-Step Methods MATH 2070U 6 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems Runge-Kutta methods of order 2 Heun’s method ( a 2 = 1/2) k 1 = f ( t i , y i ) , k 2 = f ( t i + h , y i + hk 1 ) , y i + 1 = y i + h 2 ( k 1 + k 2 ) Midpoint method ( a 2 = 1) k 1 = f ( t i , y i ) , k 2 = f t i + h 2 , y i + h 2 k 1 , y i + 1 = y i + hk 2 Ralston’s method ( a 2 = 2/3) k 1 = f ( t i , y i ) , k 2 = f t i + 3 4 h , y i + 3 h 4 k 1 , y i + 1 = y i + h 2 ( k 1 + k 2 ) c D. Aruliah (UOIT) One-Step Methods MATH 2070U 7 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems Classical Runge-Kutta method of order 4 RK4 (Classical Runge-Kutta method of order 4) k 1 = f ( t i , y i ) , k 2 = f t i + h 2 , y i + h 2 k 1 , k 3 = f t i + h 2 , y i + h 2 k 2 , k 4 = f ( t i + h , y i + hk 3 ) , y i + 1 = y i + h 6 ( k 1 + 2 k 2 + 2 k 3 + k 4 ) (RK4) c D. Aruliah (UOIT) One-Step Methods MATH 2070U 8 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems c D. Aruliah (UOIT) One-Step Methods MATH 2070U 9 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems Example of Classical Runge-Kutta (RK4) Given the IVP ( y 0 = - y ln y , y ( 0 ) = 1 2 , use the classical Runge-Kutta method of order 4 with step-size h = 0.5 to approximate y ( 0.5 ) . Here, t 0 = 0, y 0 = 0.5, f ( t , y ) = - y ln y Grid has one time-step: N = 1, h = 0.5 Want to determine y 1 y ( t 1 ) = y ( h ) k 1 = f ( t 0 , y 0 ) k 2 = f t 0 + h 2 , y 0 + h 2 k 1 = - ( 0.5 ) ln ( 0.5 ) = - y 0 + 0.5 2 k 1 ln y 0 + 0.5 2 k 1 0.34657 0.31288 c D. Aruliah (UOIT) One-Step Methods MATH 2070U 10 / 35
Runge-Kutta methods Systems of ODEs Time-stepping for systems Example of Classical Runge-Kutta (RK4) (cont.)