Professional Documents
Culture Documents
Runge Kutta PDF
Runge Kutta PDF
1
(K1 + K2 ) = hf (tn , Y (tn ))
2
h2 ∂
∂
+ f (tn , Y (tn )) + f (tn , Y (tn )) f (tn , Y (tn )) + O h3 ,
2 ∂t ∂Y
h2 00
Y (tn + h) = Y (tn ) + hY 0 (tn ) + Y (tn ) + O h3 .
2
5.3.1 Modified Euler Method — Local truncation error (2/3)
h2 00
Y (tn + h) = Y (tn ) + hY 0 (tn ) + Y (tn ) + O h3 .
2
Substitute Y 0 (tn ) = f (tn , Y (tn ))
5.3.1 Modified Euler Method — Local truncation error (2/3)
h2 00
Y (tn + h) = Y (tn ) + hY 0 (tn ) + Y (tn ) + O h3 .
2
Substitute Y 0 (tn ) = f (tn , Y (tn )) and
d ∂ d ∂
Y 00 (tn ) =
f (t, Y (t)) = f (tn , Y (tn )) + Y (tn ) f (tn , Y (tn )),
dt tn ∂t dt ∂Y
∂ ∂
= f (tn , Y (tn )) + f (tn , Y (tn )) f (tn , Y (tn )),
∂t ∂Y
5.3.1 Modified Euler Method — Local truncation error (2/3)
h2 00
Y (tn + h) = Y (tn ) + hY 0 (tn ) + Y (tn ) + O h3 .
2
Substitute Y 0 (tn ) = f (tn , Y (tn )) and
d ∂ d ∂
Y 00 (tn ) =
f (t, Y (t)) = f (tn , Y (tn )) + Y (tn ) f (tn , Y (tn )),
dt tn ∂t dt ∂Y
∂ ∂
= f (tn , Y (tn )) + f (tn , Y (tn )) f (tn , Y (tn )),
∂t ∂Y
to get
K2 = hf (tn , Y (tn ))
∂ ∂
+ h2 α f (tn , Y (tn )) + βf (tn , Y (tn )) f (tn , Y (tn )) + O(h3 );
∂t ∂Y
Comparing
Comparing
Comparing
a1 + a2 = 1;
(5.12)
αa2 = βa2 = 1 .
2
5.3.2 Second order Runge-Kutta Schemes (3/3)
Since we have 3 equations and 4 unknowns (a1 , a2 , α, β), there are infinitely
many solutions.
5.3.2 Second order Runge-Kutta Schemes (3/3)
Since we have 3 equations and 4 unknowns (a1 , a2 , α, β), there are infinitely
many solutions.
Schemes of the form (5.11) can be extended to higher order methods. The
most widely used Runge-Kutta scheme is the 4th order scheme RK4 based on
Simpson’s rule.
1
yn+1 = yn + (K1 + 2K2 + 2K3 + K4 ),
6
where K1 = hf (tn , yn ),
h K1
K2 = hf tn + , yn + , (5.13)
2 2
h K2
K3 = hf tn + , yn + ,
2 2
K4 = hf (tn + h, yn + K3 ).
This scheme has local truncation error of order h5 , which can be checked in the
same way as the second order scheme, but involves rather messy algebra.