본문내용
#include
void main()
{
double P, t, T, A, B, C, Y, Z;
{
for(P=0; P<=7; P=P+0.05)
{
for(t=1.2; t<=2.5; t=t+0.05)
{
T=1/t;
Y=0.06125*P*T*exp((-1.2)*(1-T)*(1-T));
while(1)
{
Y=Y;
A=(-0.06125)*P*T*exp((-1.2)*(1-T)*(1-T))+(Y+Y*Y+Y*Y*Y-Y*Y*Y*Y)/((1-Y)*(1-Y)*(1-Y))-(14.76*T-9.76*T*T+4.58*T*T*T)*Y*Y+(90.7*T-242.2*T*T+42.4*T*T*T)*(pow(Y,2.18+2.82*T));
B=(1+4*Y+4*Y*Y-4*Y*Y*Y+Y*Y*Y*Y)/((1-Y)*(1-Y)*(1-Y)*(1-Y))-(29.52*T-19.52*T*T+9.16*T*T*T)*Y+(2.18+2.82*T)*(90.7*T-242.2*T*T+42.4*T*T*T)*(pow(Y,1.18+2.82*T));
C=A/B;
Y=Y-A/B;
if(-C<0.000001)
{
Z=(0.06125*P*T/Y)*exp((-1.2)*(1-T)*(1-T));
printf("%lf%lf%lf\n",P,Z,t);
break;
}
else continue;
}
}
}
}
}
■ P, T, Z값의 출력
■ 그래프 도식
Pseudo reduced temperature
Pseudo reduced pressure, Pr
Compressibility factor, Z
2.5
1.8
1.7
2.4
2.0
1.5
1.6
1.4
1.2
1.3
void main()
{
double P, t, T, A, B, C, Y, Z;
{
for(P=0; P<=7; P=P+0.05)
{
for(t=1.2; t<=2.5; t=t+0.05)
{
T=1/t;
Y=0.06125*P*T*exp((-1.2)*(1-T)*(1-T));
while(1)
{
Y=Y;
A=(-0.06125)*P*T*exp((-1.2)*(1-T)*(1-T))+(Y+Y*Y+Y*Y*Y-Y*Y*Y*Y)/((1-Y)*(1-Y)*(1-Y))-(14.76*T-9.76*T*T+4.58*T*T*T)*Y*Y+(90.7*T-242.2*T*T+42.4*T*T*T)*(pow(Y,2.18+2.82*T));
B=(1+4*Y+4*Y*Y-4*Y*Y*Y+Y*Y*Y*Y)/((1-Y)*(1-Y)*(1-Y)*(1-Y))-(29.52*T-19.52*T*T+9.16*T*T*T)*Y+(2.18+2.82*T)*(90.7*T-242.2*T*T+42.4*T*T*T)*(pow(Y,1.18+2.82*T));
C=A/B;
Y=Y-A/B;
if(-C<0.000001)
{
Z=(0.06125*P*T/Y)*exp((-1.2)*(1-T)*(1-T));
printf("%lf%lf%lf\n",P,Z,t);
break;
}
else continue;
}
}
}
}
}
■ P, T, Z값의 출력
■ 그래프 도식
Pseudo reduced temperature
Pseudo reduced pressure, Pr
Compressibility factor, Z
2.5
1.8
1.7
2.4
2.0
1.5
1.6
1.4
1.2
1.3