# include <stdio.h>
# include <malloc.h>
# include <stdlib.h>
void main ()
{
long double *y=NULL,*x=NULL,a=0.0,R=0.0,R1=0.0,xf=0.0,xd=0.0,xw=0.0; int ii=0,ij=0,num=0,num1=0,a1=1;
printf("估计需要多少塔板:");
scanf ("%d",&num1);
y=(long double *)malloc(sizeof(long double)*num1);
x=(long double *)malloc(sizeof(long double)*num1);
printf("输入相对挥发度α:");
scanf ("%lf",&a);
printf ("输入精馏段回流比R:"); scanf("%lf",&R); printf ("输入精馏段回流比R1:"); scanf("%lf",&R1);
printf ("输入进料易挥发组分摩尔分数xf:");
scanf("%lf",&xf);
printf ("输入塔顶易挥发组分摩尔分数xd:");
scanf("%lf",&xd);
printf ("输入塔釜易挥发组分摩尔分数xw:");
scanf("%lf",&xw);
printf ("开始计算理论踏板n");
*y=xd;
for (ii=0;ii<=num1;ii++)
{
*(x+ii)=*(y+ii)/(a-(a-1)*(*(y+ii)));
printf("根据相平衡关系式x%d=%lfn",ii+1,*(x+ii));
if (*(x+ii)<=xw)
{
printf("理论踏板%dn",num);
break;
}
if (*(x+ii)>=xf)
{
*(y+ii+1)=R/(R+1)*(*(x+ii))+xd/(R+1);
printf ("根据精馏段操作线方程y%d=%lfn",ii+2,*(y+ii+1)); num++;
printf("第%d块板n",num);
}
else
{
} } } while(a1) { printf("n第%d块板是最佳进料板nn",ii+1); a1=0; } *(y+ii+1)=(R1+1)/R1*(*(x+ii))+xw/R1; printf ("根据提馏段操作线方程y%d=%lfn",ii+2,*(y+ii+1)); num++; printf("第%d块板n",num);
百度搜索“爱华网”,专业资料,生活学习,尽在爱华网