where $Z_1$ and $Z_2$ are the charge of the alpha particle and the gold nucleus respectively, $e$ is the elementary charge, $\epsilon_0$ is the vacuum permittivity and $r$ is the distance between the alpha particle and the gold nucleus. Apply Newton's law of motion, the trajectory of the alpha particle can be calculated by the following equation:
$$\frac{d^2\vec{r}}{dt^2} = \frac{Z_1Z_2e^2}{4\pi\epsilon_0m\vec{r}^2}\hat{r}$$
where $m$ is the mass of the alpha particle. We can rewrite the equation in the following form:
For Adaptive Runge-Kutta, we perform a fourth order Runge-Kutta with time step $dt$ and two half time step $dt/2$. We compare the result of the two half time step with the result of the full time step. If the difference $|\delta{c}|$ is smaller than a certain tolerance, we accept the result of the full time step. Otherwise, we perform two half time step again. We repeat this process until the difference is smaller than the tolerance.
graph LR
A(T) -->|+dt|D(T+dt)
A -->|+dt/2|C(T+dt/2)
C -->|+dt/2|D
Loading
Since the local truncation error of fourth order Runge-Kutta is $O(h^5)$, therefore, our truncation error for current time step will be $|\delta{c}|^{1/5}$. Assume that the local truncation error's tolerance we set is $\epsilon$, then the fraction of these two value can help us to determine the time step for next step. by following equation:
Since this is only the estimation of the time step, we introduce two safety factor $s_1<1$ and $s_2>1$ to make sure that the time step will not be too small or too large. Therefore, the final time step will follow these condition :
$S_2\tau_{old} \text{\ \ , if \ } S_1\tau_{est}>S_2\tau_{old}$
$\tau_{old}/S_2 \text{\ \ , if \ } S_1\tau_{est}<\tau_{old}/S_2$