program oct1416 real x(2),t,dt,tfinish,xe,f1,f2 integer i,steps x(1)=1 x(2)=-1 dt = 0.01 tfinish=20 steps=tfinish/dt open(unit=13,file="data.d") do 10 i=1,steps xe=51.0/47.0*cos(sqrt(3.0/2.0)*t)-sqrt(2.0/3.0)* c sin(sqrt(3.0/2.0)*t)-4.0/47.0*cos(5.0*t) write(13,*) t,x(1),x(2),xe x(1)=x(1)+f1(x,t)*dt x(2)=x(2)+f2(x,t)*dt t=t+dt 10 continue xe=51.0/47.0*cos(sqrt(3.0/2.0)*t)-sqrt(2.0/3.0)* c sin(sqrt(3.0/2.0)*t)-4.0/47.0*cos(5.0*t) write(13,*) t,x(1),x(2),xe close(13) stop end real function f1(x,t) real x(2),t f1 = x(2) return end real function f2(x,t) real x(2),t f2=0.5*(4.0*cos(5.0*t)-3.0*x(1)) return end