program ode1
real::rho,g,p
!defining rho=density, p=pressure, g=gravity
f(p,z)=-rho*g
print*,"Enter the stepsize:"
read(*,*)h
open(1,file='a.dat',status='unknown')
!assuming the pre values
z=0;p=10000;g=9.8
!iteration starts
1 write(1,*)z,p
rho=1.276*exp(z/8000)
p=p+h*f(p,z)
z=z+h
if(z<=16000) goto 1
end
real::rho,g,p
!defining rho=density, p=pressure, g=gravity
f(p,z)=-rho*g
print*,"Enter the stepsize:"
read(*,*)h
open(1,file='a.dat',status='unknown')
!assuming the pre values
z=0;p=10000;g=9.8
!iteration starts
1 write(1,*)z,p
rho=1.276*exp(z/8000)
p=p+h*f(p,z)
z=z+h
if(z<=16000) goto 1
end
Comments
Post a Comment