32 #define eps 0.001//epsilon definition
38 #define ABS(x) (((x) > 0) ? (x) : (-(x)))
44 #define M_PI 3.14159265358979323846
71 int code_length,
double deltat)
80 for (
int k=0; k<code_length; k++)
84 double b=
M_PI*velocity_max*deltat;
88 k-round(code_length/2))+
90 k-round(code_length/2));
93 k-round(code_length/2));
94 double tn=h*(s1+4*s4)/3;
95 double ta=tn+2*
eps*tn;
112 k-round(code_length/2+.5));
115 tn = h*(s1+2*s2+4*s4)/3;
119 sum_code=sum_code+code[k];
122 for (
int k=0; k<code_length; k++)
123 code[k]=code[k]/(deltat*sum_code);
159 return( pow((xi/2)/(sin(xi/2)),0.5)*
161 pow(
uniform_w(velocity_max,xi/deltat),0.25)*
167 return ( pow(
uniform_w(velocity_max,0),0.25)) ;
195 if (
ABS(xi)>velocity_max*
M_PI)
return(0);
206 double a=velocity_max/1000;
208 double b=velocity_max;
215 double tn=h*(s1+4*s4)/3;
216 double ta=tn+2*
eps*tn;
234 tn = h*(s1+2*s2+4*s4)/3;
264 return(1/(
ABS(velocity)));