program second implicit none real xe(2),t,dt,x2(2),fe1,fe2,f21,f22 xe(1) = 0 xe(2) = 0 x2(1) = 0 x2(2) = 0 dt = 0.1 open(13,file='data.d') do 20 t=0,20,dt write(13,15) t,xe(1),xe(2),x2(1),x2(2),0.5*t*sin(t) fe1 = xe(2) fe2 = -xe(1)+cos(t) f21 = x2(2) f22 = -x2(1)+cos(t) xe(1) = xe(1) + fe1*dt xe(2) = xe(2) + fe2*dt x2(1) = x2(1)+f21*dt+0.5*(-x2(1)+cos(t))*dt**2 x2(2) = x2(2)+f22*dt+0.5*(-x2(2)-sin(t))*dt**2 20 continue write(13,15) t,xe(1),xe(2),x2(1),x2(2),0.5*t*sin(t) close(13) 15 format(6(F8.2)) end