This is a two dimension simulation, so there are components for the force. Runga-Kutta Method solve first order differential equation. So force equation (second order ) need to be break into two first order equation. Change \frac{d^2 \vec{V}}{dt^2}=q \vec{V}\times\vec{B} into \frac{d\vec{x}}{dt}= V and \frac{d\vec{V}}{dt}=q \vec{V}\times\vec{B} For the above two equations, each one have two components. So you will have 4 equations for Runga-Kutta Method solver. :-)