106 unsigned short i,
j, n_func, ial, iby, ibz;
107 unsigned short i_alpha, i_By, i_Bz;
108 unsigned short j_alpha, j_By, j_Bz;
114 double V_al[3], V_by[3], V_bz[3];
116 double DXV_v_drift [N_Func];
117 double DXV_x_drift [N_Func];
118 double DXV_delta_x [N_Func];
119 double DXV_x_width_m[N_Func];
120 double DXV_x_width_p[N_Func];
130 switch(interpolate) {
131 case 1: n_func = N_Func;
132 for ( j=0 ; j<N_Func ; j++ ) {
136 DXV_x_width_m[
j] = -1;
137 DXV_x_width_p[
j] = -1;
144 default: printf (
"*** ERROR, MB_DT_drift_distance: invalid interpolate value = %d\n",interpolate);
152 printf (
"\nMB_DT_drift_distance: Function called with values:\n\n");
153 printf (
"MB_DT_drift_distance: time = %f\n",
time );
154 printf (
"MB_DT_drift_distance: alpha = %f\n",
alpha);
155 printf (
"MB_DT_drift_distance: by = %f\n",by );
156 printf (
"MB_DT_drift_distance: bz = %f\n",bz );
176 printf(
"MB_DT_drift_distance:\n");
177 printf(
"MB_DT_drift_distance: i_alpha j_alpha alpha_value's %d %d %.0f %.0f\n",i_alpha,j_alpha,
alpha_value[i_alpha],
alpha_value[j_alpha]);
178 printf(
"MB_DT_drift_distance: i_By j_By By_value's %d %d %.2f %.2f\n",i_By ,j_By ,
By_value[i_By] ,
By_value[j_By]);
179 printf(
"MB_DT_drift_distance: i_Bz j_Bz Bz_value's %d %d %.2f %.2f\n",i_Bz ,j_Bz ,
Bz_value[i_Bz] ,
Bz_value[j_Bz]);
184 for ( j=0 ; j<n_func ; j++ ) {
186 ial = (j&4) ? j_alpha : i_alpha;
187 iby = (j&2) ? j_By : i_By ;
188 ibz = (j&1) ? j_Bz : i_Bz ;
190 for ( i=0 ; i<
N_Par_x ; i++ ) par_x[i] =
fun_x[ial][iby][ibz][i];
193 OffSet = par_x[N_Par_x-1];
195 DXV_v_drift[
j] = par_x[0];
197 DXV_x_drift[
j] =
MB_DT_dist (
time, par_x) + DXV_delta_x[
j] - OffSet*par_x[0];
198 DXV_x_width_m[
j] =
MB_DT_sigma_t_m (DXV_x_drift[j], par_sigma_t) * DXV_v_drift[
j];
199 DXV_x_width_p[
j] =
MB_DT_sigma_t_p (DXV_x_drift[j], par_sigma_t) * DXV_v_drift[
j];
202 printf(
"MB_DT_drift_LOOP: OffSet = %f\n",OffSet);
203 printf(
"MB_DT_drift_LOOP: time, v_drift, x_drift, lin, x_width_m, x_width_p = %f %f %f %f %f %f\n",
204 time, DXV_v_drift[j], DXV_x_drift[j], DXV_delta_x[j], DXV_x_width_m[j], DXV_x_width_p[j]) ;
210 if ( interpolate == 0 ) {
212 DX->v_drift = DXV_v_drift[0];
213 DX->delta_x = DXV_delta_x[0];
214 DX->x_drift = DXV_x_drift[0];
215 DX->x_width_m = DXV_x_width_m[0];
216 DX->x_width_p = DXV_x_width_p[0];
232 printf(
"MB_DT_drift_distance: time, v_drift, x_drift, lin, x_width_m, x_width_p = %f %f %f %f %f %f\n",
233 time, DX->v_drift, DX->x_drift, DX->delta_x, DX->x_width_m, DX->x_width_p) ;
static const double fun_sigma_t[11][5][5][7]
static const double Bz_value[5]
double MB_DT_delta_x(double, double *) const
static const double By_value[5]
double MB_DT_dist(double, double *) const
double MB_DT_sigma_t_p(double, double *) const
void MB_DT_Get_grid_points(double alpha, double by, double bz, unsigned short *p_alpha, unsigned short *p_By, unsigned short *p_Bz, unsigned short *q_alpha, unsigned short *q_By, unsigned short *q_Bz) const
double MB_DT_MLInterpolation(double *al, double *by, double *bz, double *f) const
unsigned short MB_DT_Check_boundaries(double distime, double alpha, double by, double bz, short ifl) const
static const double fun_x[11][5][5][15]
double MB_DT_sigma_t_m(double, double *) const
static const double alpha_value[11]