2
$\begingroup$

I am trying to simulate the motion of several charged particles that are free to move around but have repulsive forces between each other. These may be 10 electrons moving around causing an instantaneous Newtonian force on all other particles (not accounting for relativistic effects).

I want to run the simulation at discrete time steps (i.e. every 10ms). Is there any way to find the position and velocity of each particle at after each time step?

Originally, I thought I would just calculate each force at the beginning of the time step and then use these forces to calculate the positions and velocities for the next time step. The problem is that all particles have moved during the time step, so my assumption of a constant force acting on the particle during the time step will be wrong.

I could make the time steps really small so that the displacement of the other particles is nearly zero to approximate a stationary force. This would require more computations as well as still induce small errors.

Am I stuck with having to approximate this with error is there a way to compute and integral over each time step to find the next positions and velocities?

$\endgroup$
1
$\begingroup$

That sounds right.

There are always errors in numerical time integration. What you are describing is an explicit time integration scheme, where the quantities are computed in the current timestep from the quantities of the previous timestep. Depending on the time integration scheme you use, the error can be reduced. For example, Runge Kutta 4th order has a fourth order error, which means the solution is accurate up to the fourth power of the taylor expansion of the differential equation. Some of the error, like you said, comes from using the previous timestep to compute the current one.

There are implicit methods that use the "current" timestep, such as Backward Euler, however they often are less accurate than explicit methods and more difficult to implement, so if your solution seems stable, I recommend against using implicit schemes.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.