d1=0.001,d2=1.5;
while(1)
{
d3=(d1+d2)/2.0;
Re=1.534*Q*del*1000/(d3*u);
R1=0.001;
R2=1.0;
while(1)
{
R3=(R1+R2)/2.0;if(fr(k,d3,Re,R3)>1e-6)R1=R3; if(fr(k,d3,Re,R3)<-1e-6)R2=R3;if(fabs(fr(k,d3,Re,R3))<1e-6)break;
}
R=R3; if(fd(R,z,d3)>1e-6)d1=d3;
if(fd(R,z,d3)<-1e-6) d2=d3;if(fabs(d3-d1)<1e-6&&fabs(d3-d2)<1e-6)break;
}
d=d3; printf("摩阻系數(shù)為R=%e,管徑為d=%em\n\n\n",R,d); printf("雷諾數(shù)為Re=%e\n\n\n",Re);
}
[qq]785430264[/qq]