Institute for Physics and Astronomy, University of Potsdam
November 14, 2024
2nd-order Runge-Kutta (RK2)
\[ k_1=\Delta t \cdot f(t_i,y_i)\\ k_2=\Delta t \cdot f \left( t_i+\frac{\Delta t}{2},y_i+\frac{k_1}{2} \right) \\ y_{i+1}=y_i+k_2\\ \]
4th-order Runge Kutta (classic RK, RK4)
\[ y_{i+1}=y_i+\frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)\\ k_1=\Delta t \cdot f(t_i,y_i)\\ k_2=\Delta t \cdot f(t_i+\frac{\Delta t}{2},y_i+\frac{k_1}{2})\\ k_3=\Delta t \cdot f(t_i+\frac{\Delta t}{2},y_i+\frac{k_2}{2})\\ k_4=\Delta t \cdot f(t_i+\Delta t,y_i+k_3) \]
Slopes used for the Runge-Kutta method; \(h = \Delta t\)
Comparison of Runge-Kutta with other methods for the solution of the ODE: \(y'=sin^2(t)*y\)
Verlet’s (Störmer) algorithm
\[ \vec{x}_{i+1}=2\vec{x}_i-\vec{x}_{i-1}+(\Delta t)^2\vec{a}_i+\mathcal{O}(\Delta t)^4\\ \vec{v}_i=\frac{\vec{x}_{i+1}-\vec{x}_{i-1}}{2\Delta t}+\mathcal{O}(\Delta t)^2 \]
Comparison of energies of a charged particle moving in a given B-field, with its trajectory calculated using the RK4 and Boris algorithms (Qin et al. (2013))
Credits: Spenvis (ESA’s SPace ENVironment Information System) Models description
Valid when the gyroradius (\(\rho= \frac{mv}{qB}\)) and gyroperiod (\(\propto \frac{1}{\Omega} = \frac{m}{qB}\)) are much smaller than the length scale of transverse gradients and characteristic oscillation periods of the background EM fields.
The motion of a charged particle is described in terms of variables representing the gyration around B-field lines and the motion of its guiding center.
For the solar corona, typical gyroradii are \(10^{-3} m\) for electrons and \(10^{-2} m\) for protons, much smaller than typical characteristic lengths scales.
Important: Memory limit of your computer.
You can download the Jupyter notebook here: https://www.app.physik.uni-potsdam.de/~jbenacek/ASPS/lecture04-handson.ipynb