Question: Trajectory algorithm only working for first step?

I'm trying to calculate the trajectory of a 3-particle system. I defined my parameters. Wrote a do loop. Got the number of iterations I expected. But when I look at the tables of position for each particle after I run the loop, the trajectory only changes for the first iteration, then it stays the same. In other words, it shows that the particle moved slightly after the first increment of time, but thereafter it doesn't move.


 

for i to N do x[11] := x[1]+tau*vx[1]+(1/2)*tau^2*F[x1]; y[11] := y[1]+tau*vy[1]+(1/2)*tau^2*F[y1]; x[21] := x[2]+tau*vx[2]+(1/2)*tau^2*F[x2]; y[21] := y[2]+tau*vy[2]+(1/2)*tau^2*F[y2]; x[31] := x[3]+tau*vx[3]+(1/2)*tau^2*F[x3]; y[31] := y[3]+tau*vy[3]+(1/2)*tau^2*F[y3]; R[1] := [op(R[1]), [x[11], y[11]]]; R[2] := [op(R[2]), [x[21], y[21]]]; R[3] := [op(R[3]), [x[31], y[31]]]; V[1] := [op(V[1]), [vx[11], vy[11]]]; V[2] := [op(V[2]), [vx[21], vy[21]]]; V[3] := [op(V[3]), [vx[31], vy[31]]] end do:

101

(5)

 

Please Wait...