高手们看看哪里出错了
#include"math.h"#include"stdio.h"
main()
{
int i,j,k,n;
static double a[5]={0.92,0.6,0.58,0.41,0.10};
static double b[5]={0.7,0.58,0.43,0.35,0.228};
static double d[5]={0.345,0.005,0.065,0.115,0.230};
double t[7],xt[7],ta,aw,r[5],aaw,la[5],cc,eps,qloss;
xt[0]=1720.0; t[0]=1720; eps=0.0001; ta=293;
aaw=2.56;
for(i=1;i<7;i++) t[i]=720;
j=0;
do{
j=j+1;
for(i=0;i<5;i++)
la[i]=a[i]+b[i]*(t[i]+t[i+1])/2/1000;
for(i=0;i<5;i++)
r[i]=la[i]/d[i];
for(i=1;i<5;i++)
xt[i]=r[i-1]/(r[i-1]+r[i])*xt[i-1]+r[i]/(r[i-1]+r[i])*t[i+1];
aw=aaw*pow((t[5]-ta),0.25)+4.54*(pow((t[5]/100),4)-pow((ta/100),4))/(t[5]-ta
xt[5]=r[4]/(aw+r[4])*xt[4]+aw/(aw+r[4])*ta;
k=0; for(i=1;i<6;i++)
for(i=1;i<6;i++)
{ cc=abs(xt[i]-t[i]);
if(cc>eps) k=k+1;
}
for(i=0;i<6;i++)
t[i]=xt[i];
}while(k>0);
qloss=la[0]/d[0]*(t[0]-t[1]);
for(i=0;i<6;i++)
printf("tt(%d)=%e\n",i,xt[i]);
printf("qloss=%e,%d\n",qloss,j);
}
高手们指点一下,谢谢啦
用这个程序应该能计算出
T[0]=1720
T[1]=1478
T[2]=1474
T[3]=1413
T[4]=1267
T[5]=371