Consider a second order equation $F=ma=mddot{x}$.

In the language of Euler’s method

- $ddot{x}(t+dt)=F(t,x(t),dot x(t))$
- $dot{x}(t+dt)=dot x(t)+a(t)dt$
- $x(t+dt)=x(t)+dot x(t)dt$

Basically, the entire iteration was the second order force equation $F(t,x(t),dot x(t))$.

However, here one wanted to apply Runge–Kutta method(standard “RK4”, not Runge–Kutta–Nyström or else) to solve that equation.

For notation simplicity, let $vsim dot x$, $asim ddot x$(velocity and acceleration).

From $x(t),v(t),a(t)$:

$ka1=F(t,x(t),dot x(t))$; $kv1=v(t)+a(t)frac{dt}{2}$; $kx1=x(t)+v(t)frac{dt}{2}$;

$ka2=F(t+frac{dt}{2},kx1, kv1)$; $kv2=kv1+ka1cdot frac{dt}{2}$; $kx2=kx1+kv1cdot frac{dt}{2}$;

$ka3=F(t+frac{dt}{2},kx2, kv2)$; $kv3=kv2+ka2cdot dt$; $kx3=kx2+kv2cdot dt$;

and finally

$ka4=F(t+dt,kx3, kv3)$;

The final acceleration was collected to be

**Iteration Update Method 01**

$ddot x(t+dt)=(ka1+ka2cdot 2+ka3cdot 2+ka4)/6$; where

$dot x(t+dt)=dot x(t)+ddot x(t)dt$;

$x(t+dt)=x(t)+dot x(t)dt$

with such loop the iteration was able to run in RK4 method and things worked very nicely and coincided with the analytical calculation for an example which Euler method was known to fail.(Tested)

However, my question arise from a mistake where it made the code fail to work. It went like this:

In addition to the $ddot x(t+dt)$ condition, one further to average the speed directly,

**Iteration Update Method 02**

$ddot x(t+dt)=(ka1+ka2cdot 2+ka3cdot 2+ka4)/6$;

$dot x(t+dt)=(dot x(t)+kv1cdot 2+kv2cdot 2+kv3)/6$; and

$x(t+dt)=x(t)+dot x(t)dt$;

Notice that the new update method attempted to use the $dot x(t)$ to take care of the “overflow”. Intuitively, not only the acceleration $ddot x$ was “RK4”-ed, but also, the velocity $dot x$ was “RK4”-ed as well. However, thought still able to produce a sensible graph, the **Iteration Update Method 02** was proven to have failed after the analysis.

Question 1: Why **Iteration Update Method 01** worked? Even though it approximated $frac{d^2y(t)}{dt}=f(t,y(t),dot y(t))$ instead of $frac{d y(t)}{dt}=f(t,y(t))$?

Question 2: Why **Iteration Update Method 02** failed? Shouldn’t it work better since it averaged more stuff?