大家帮忙看看我的程序啊!急!
对C语言不精通,我编了个程序希望,大家帮忙看看啊,看我的程序错在哪里啊,谢谢!#include "math.h"
double fftsf(x) (定义积分函数)
double x;
{ double y;
y=f11(x);
return(y);
}
double fftsf(x)
{ double y;
y=f(12);
return(y);
}
double f11(double x,double e,double fc,double z) ( 定义被积分函数)
{
if((e<=0.002)&&(e>=0))
f11=fc*((2*(e-z*x))/0.002-((e-z*x)/0.002)*((e-z*x)/0.002));
else if((e<=0.0033)&&(e>=0.002))
f11=fc*(1-0.15*((e-z*x)-0.002)/0.0013);
return (f11);
else
printf("error\n");
}
double f12(double x,double z,double fc,double e)
{
f12=fc*((2*(e-z*x))/0.002-((e-z*x)/0.002)*((e-z*x)/0.002))
return (f12);
}
#include "stdio.h"
#include "9ffts.c"
main()
{
double a,eps,e,k,fc,ft,fy1,fy2,es1,es2,h,as1,as2,as,ey1,ey2;
double z,xx1,xx2,gh1,gh2,t11;b;
double a12,b12,t12,h0;
k=0.50;
fc=16.7;
ft=1.78;
fy1=354.00;
fy2=354.00;
es1=210000.00;
es2=210000.00;
h=350.00;
as1=0.0;
as2=461.0;
as=35.0;
h0=h-as;
ey1=fy1/es1;
ey2=fy2/es2;
while(e<=0.0033)
z=e/(k*h0);
xx1=300.00;
xx2=-300.00;
gh1=0.002/z;
gh2=0.0001/z;
a=0.0; b=k*h0-gh1; eps=0.000001; (积分上限,下限,积分精度)
t11=ffts(a,b,eps,f11);
a=k*h0-gh1; b=k*h0; eps=0.000001;
t12=ffts(a,b,eps,f12);
yn=t11+t12; (积分求和)
while ((xx2<=yn)&&(yn<=xx1))
z=e/(k*h0);
scanf("%f,%f,%f",&e,&k,&z);
if(yn<xx2)
do {k=k+0.0001;}
while (xx2<=yn);
if(yn>xx1)
do {k=k-0.0001;}
while (yn<=xx1);
printf("%f\n","%f\n",&z,&yn); ( 输出结果)
return 0;
}
[[it] 本帖最后由 liaobiao0903 于 2008-7-29 10:36 编辑 [/it]]