!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.50 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
WRITE(50,*)dt*DFLOAT(i1),x0
x0new=x0+dt*SIN(x0)
x0=x0new
END DO
END