!Runge-Kutta Method !Give the value of x0 and n here !where x0 is initial value at time t=0 and n is number of iteration !Time for which program runs is n*dt where dt=0.001 which can be changed !in the program !Output is stored in fort.54 as time vesus x ! Solution for this differentoal equation is ! t=log(((1/sin(x0))+(cos(x0)/sin(x0)))/((1/sin(x))+(cos(x)/sin(x)))) ! where log is to the base e (natural log) PROGRAM PROBLEM !2 implicit real*8(a-h,o-z) pi=4d0*datan(1d0) x0=Pi/2d0 dt=0.001d0 n=10000 WRITE(6,*)SIN(x0) DO i1=0,n-1 rk1=SIN(x0) rk2=SIN(x0+0.5d0*dt*rk1) rk3=SIN(x0+0.5d0*dt*rk2) rk4=SIN(x0+dt*rk3) x0new=x0+(dt/6d0)*(rk1+2d0*rk2+2d0*rk3+rk4) WRITE(54,*)dt*DFLOAT(i1),x0 !x0new=x0+dt*SIN(x0) x0=x0new END DO END