program part ! Program to test numerical methods for integrating particle orbits in ! a magnetic field implicit none double precision vx0, vy0, vx1, vy1 double precision dt integer i vx0=1 ; vy0=0 ; dt=0.001 do i=1,1000 vx1 = vx0 + dt*vy0 vy1 = vy0 - dt*vx0 vx0=vx1 vy0=vy1 enddo print *, "Energy = ", vx1**2+vy1**2 end program part