| 查看: 474 | 回复: 0 | ||
[求助]
udf程序调试
|
|
各位前辈: 大家好,我这里有一个程序,调试时显示以下信息: Error: C:\Users\user\Desktop\udf unsteady temperature w 1.c: line 27: parse error. Error: C:\Users\user\Desktop\udf unsteady temperature w 1.c: line 38: y: undeclared variable 程序如下: #include <udf.h> #include <math.h> #define ERF_PI 3.141592653589793 #define ERF_N 100 double erf(double x)////erf(x) = the cumulation of { 2/sqrt(pi)*exp(-z*z) } from 0 to x; //error function { // 2/sqrt(pi) * { ∑[(-1)^n / n! * x^(2n+1)/(2n+1)] + x } double res = x; double factorial = 1; //n! double x_pow = x; int one = 1, n; for( n=1; n<100; n++ ){ factorial *= n; one *= -1; x_pow *= x*x; res += one / factorial * x_pow / ( 2*n+1 ); } res *= 2 / sqrt(ERF_PI); return res; } double norm_cdf(double y)//cumulation distribution function of standard normal distribution { real time = CURRENT_TIME; y=(time-5.98023)/3.3487-3.3487/5.90205 return ( 1 + erf( y / sqrt(2) ) ) / 2; } DEFINE_PROFILE(unsteady_temperature, t, i) { real time = CURRENT_TIME; real temperature; face_t f; begin_f_loop(f, t) { temperature = -4.6376+6.9448*exp(1.1742-time/5.90205)*(erf(y/sqrt(2))+1)/2; F_PROFILE(f, t, i) = temperature; } end_f_loop(f, thread) } 望各位前辈给我指点 |
» 猜你喜欢
垃圾破二本职称评审标准
已经有6人回复
三无产品还有机会吗
已经有5人回复
投稿返修后收到这样的回复,还有希望吗
已经有7人回复
压汞仪和BET测气凝胶孔隙率
已经有4人回复
博士申请都是内定的吗?
已经有14人回复
谈谈两天一夜的“延安行”
已经有13人回复
氨基封端PDMS和HDI反应快速固化
已经有11人回复
之前让一硕士生水了7个发明专利,现在这7个获批发明专利的维护费可从哪儿支出哈?
已经有11人回复
论文投稿求助
已经有4人回复
Applied Surface Science 这个期刊。有哪位虫友投过的能把word模板发给我参考一下嘛
已经有3人回复













回复此楼