- 积分
- 1
- 注册时间
- 2010-9-19
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2011-6-8 15:06:26
|
显示全部楼层
来自 江苏南京
本帖最后由 铁道科学 于 2011-6-8 15:20 编辑
看了一下,因为不大明白你的算法,暂时只能帮你把代码整理下,方便后面帮你的人看。- program PREOS
- implicit none
- integer i,n
- real,parameter :: R=83.14
- real,parameter :: Tc=187.564
- real,parameter :: Pc=45.592
- real,parameter :: error=0.0000001
- real :: p=319.144
- real :: T=187.564
- real :: w=0.01142
- real :: m,b,a,Tr,f,f1,Pr,Pa
- real :: v,v0
- real :: z1,z2
- read(*,*) v0,n
-
- m = 0.37464+1.54226*w-0.06992*w**2
- Tr = T/Tc
- a = 0.45724*(R**2)*(Tc**2)*(1.0+m*(1.0-Tr**0.5))**2/Pc
- b = 0.07780*R*Tc/Pc
-
- do i = 1,n
- f = v0**3-(R*T/P-b)*v0**2+(a/P-2*b*R*T/P-3*b**2)*v0-b*(a/P-b*R*T/P-b**2)
- f1 = 3*v0**2-2*v0*(R*T/P-b)+(a/P-2*b*R*T/P-3*b**2)
- v = v0-f/f1
- if(abs(v-v0)<error) exit
- v0 = v
- end do
-
- Pr = R*T/(V-b)
- Pa = -a/(v*(v+b)+b*(v-b))
- z1 = Pr/Pc
- z2 = Pa/Pc
-
- write(*,"('i=',i4)")i
- write(*,"('v=',f12.8)")v
- write(*,"('Pr=',f20.8)")Pr
- write(*,"('Pa=',f20.8)")Pa
- write(*,"('z1=',f20.8)")z1
- write(*,"('z2=',f20.8)")z2
- end
复制代码 |
|