







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








dr dt
= v dv dt
m
Using Taylor ....
x(t + dt) = x(t) + v(t)dt + a(t)dt^2 /2 + O(dt^3 )
leading to
xn+1 = xn + vndt + andt^2 / 2
Subtracting x(t − dt) from x(t + dt) find
v(t) = x(t + dt) − x(t − dt) + O(dt^3 )
leading to
vn+1 = xn+2 − xn 2 dt Substiting for xn+2 using previous equation:
vn+1 = vn + dt 2
(an + an+1)
leapfrog algorithm Accurate to O(dt^2 )
Almost as simple to implement in code.
If many mutually interacting particles:
Fa =
∑ b
Fab
where label b runs over all particles in system
dxa dt
= va dva dt
= Fa/ma
Get a pair of (vector) equations for each parti- cle. Simulating system requires summing over all particles.
Fab = Ae −
(ra−r r 0 b
) 2
√ b/A. Stable integration.
To carry out a sum over all balls use for com- mand eg.
for ball in system: ball.pos=ball.pos+ball.vel*dt+...