请求帮助,请大家帮忙从14行开始找一下问题所在,谢谢
double CF2DH_FieldCalc_512L::uf_g(double ad_t, double ad_r, double ad_x){ //ad_x:深度x, ad_r:半径r, ad_t, 时间t
double l_u;
double l_rs;
double l_fx;
double l_fr;
double l_p;
double l_g;
l_u = 50*(1.0 - exp(-ad_t/5) )*exp(-ad_t/9);
l_p = exp(-ad_t /4);
double Ap =2.00;
l_p = sSpecimen.energy*Ap*1.0E10*(1.0 - l_p )* l_p;
l_fr =2*exp(-ad_r*ad_r/5);
if( ad_x <= 2e-2);
{
l_rs = 2 * l_u / 10000 ;
if (l_rs ==0.0) return 0.0;
double l_tmp;
l_tmp = ad_x /l_rs;
if (l_tmp >=1) return 0.0;
l_fx = 1.0 - 7/5 *(l_tmp - 1/5);
l_g =5/3* l_p / l_rs * l_fx * l_fr;
return l_g;
}
else
{
l_rs = 2 *l_u / 72980 ;
if (l_rs ==0.0) return 0.0;
double l_tmp;
l_tmp = ad_x /l_rs;
if (l_tmp >=1) return 0.0; l_fx = 1.0 - 7.0/5.0 *(l_tmp - 1.0/5.0);
l_g =5/3* l_p / l_rs * l_fx * l_fr;
return l_g;
}
}
这个程序想表达的是:
ad_x是个变量
当 ad_x <= 2e-2时,函数l_rs = 2 * l_u / 10000 ;
l_fx = 1.0 - 7/5 *(l_tmp - 1/5);
l_g =5/3* l_p / l_rs * l_fx * l_fr;,
而当ad_x > 2e-2时,函数 l_rs = 2 *l_u / 72980 ;
l_fx = 1.0 - 7/5 *(l_tmp - 1/5);
l_g =5/3* l_p / l_rs * l_fx * l_fr;
l_g 是 l_p, l_rs, l_fx , l_fr的函数,其中只有l_rs, l_fx是关于ad_x的函数;
且当l_rs ==0.0时 return 0.0,当l_tmp >=1时 return 0.0;,其他情况return l_g;,请精通的好心人
帮我从14行开始看看哪里有问题,万分感谢!!