Runge-Kutta 4th order method
Apps in the last two posts (see here and here) differ in another important regard: the first app plots analytical solution of one ODE, while the second plots numerical solution of another ODE. Numerical solution is chosen, because it is impossible to obtain analytical solution.
Here, in this post, we will numerically solve ODE:
\begin{equation} \frac{d}{d t} x = - \left( x + a \right)^2 . \label{eq:rk4-ode} \end{equation}
It is simple enough to have analytical solution and thus we can compare two different numerical solution methods: Euler method and Runge-Kutta 4th order method.