Post Reply 
Side benefit from Runge-Kutta methods for ODE
09-27-2018, 02:11 AM
Post: #5
RE: Side benefit from Runge-Kutta methods for ODE
(09-26-2018 10:45 PM)Valentin Albillo Wrote:  Why the inefficiency ? Well, taking as an example the 4th order Runge Kutta method you mention, it performs 4 evaluations of f(x) per step, and (being exactly equivalent to Simpson's rule) it's exact for polynomials only up to degree 3.

The 4 evaluations are:

\(\begin{aligned}
k_{1}&=f(t_{n},y_{n}),\\
k_{2}&=f\left(t_{n}+\frac{h}{2},y_{n}+\frac{h}{2}k_{1}\right),\\
k_{3}&=f\left(t_{n}+\frac{h}{2},y_{n}+\frac{h}{2}k_{2}\right),\\
k_{4}&=f\left(t_{n}+h,y_{n}+k_{3}\right).
\end{aligned}\)

But since the function \(f\) only depends on \(t\) we end up with:

\(\begin{aligned}
k_{1}&=f(t_{n}),\\
k_{2}&=f\left(t_{n}+\frac{h}{2}\right),\\
k_{3}&=f\left(t_{n}+\frac{h}{2}\right),\\
k_{4}&=f\left(t_{n}+h\right).
\end{aligned}\)

Thus \(k_{2}=k_{3}\).

This reduces:

\(y_{n+1}=y_{n}+\tfrac{h}{6}\left(k_{1}+2k_{2}+2k_{3}+k_{4}\right)\)

to:

\(y_{n+1}=y_{n}+\tfrac{h}{6}\left(k_{1}+4k_{2}+k_{4}\right)\)


Compare this to the function evaluations of the 3rd-order method:

\(\begin{aligned}
k_{1}&=f(t_{n},y_{n}),\\
k_{2}&=f\left(t_{n}+\frac {h}{2},y_{n}+\frac {h}{2}k_{1}\right),\\
k_{3}&=f(t_{n}+h,y_{n}-hk_{1}+2hk_{2}).
\end{aligned}\)

Here we end up with:

\(\begin{aligned}
k_{1}&=f(t_{n}),\\
k_{2}&=f\left(t_{n}+{\frac {h}{2}}\right),\\
k_{3}&=f(t_{n}+h).
\end{aligned}\)

\(y_{n+1}=y_{n}+\tfrac{h}{6}\left(k_{1}+4k_{2}+k_{3}\right)\)

Therefore we can see that RK4 degrades to RK3.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Side benefit from Runge-Kutta methods for ODE - Thomas Klemm - 09-27-2018 02:11 AM



User(s) browsing this thread: 1 Guest(s)