41 unsigned short i, j, n_func, ial, iby, ibz;
42 unsigned short i_alpha, i_By, i_Bz;
43 unsigned short j_alpha, j_By, j_Bz;
50 double V_al[3], V_by[3], V_bz[3];
52 double DTV_v_drift [N_Func];
53 double DTV_t_drift [N_Func];
54 double DTV_delta_t [N_Func];
55 double DTV_t_width_m[N_Func];
56 double DTV_t_width_p[N_Func];
67 case 1: n_func = N_Func;
68 for ( j=0 ; j<N_Func ; j++ ) {
72 DTV_t_width_m[j] = -1;
73 DTV_t_width_p[j] = -1;
80 default: printf (
"*** ERROR, MB_DT_drift_time: invalid interpolate value = %d\n",
interpolate);
88 printf (
"\nMB_DT_drift_time: Function called with values:\n\n");
89 printf (
"MB_DT_drift_time: x = %f\n",
x );
90 printf (
"MB_DT_drift_time: alpha = %f\n",
alpha);
91 printf (
"MB_DT_drift_time: by = %f\n",by );
92 printf (
"MB_DT_drift_time: bz = %f\n",bz );
93 printf (
"MB_DT_drift_time: ifl = %d\n",ifl );
100 printf (
"*** ERROR, MB_DT_drift_time: invalid ifl value = %d\n",ifl);
104 dist = ( ifl == 0 ) ?
x :
x-DT_Cell_HalfWidth;
120 printf(
"MB_DT_drift_time:\n");
121 printf(
"MB_DT_drift_time: i_alpha j_alpha alpha_value's %d %d %.0f %.0f\n",i_alpha,j_alpha,
alpha_value[i_alpha],
alpha_value[j_alpha]);
122 printf(
"MB_DT_drift_time: i_By j_By By_value's %d %d %.2f %.2f\n",i_By ,j_By ,
By_value[i_By] ,
By_value[j_By]);
123 printf(
"MB_DT_drift_time: i_Bz j_Bz Bz_value's %d %d %.2f %.2f\n",i_Bz ,j_Bz ,
Bz_value[i_Bz] ,
Bz_value[j_Bz]);
128 for ( j=0 ; j<n_func ; j++ ) {
130 ial = (j&4) ? j_alpha : i_alpha;
131 iby = (j&2) ? j_By : i_By ;
132 ibz = (j&1) ? j_Bz : i_Bz ;
134 for ( i=0 ; i<
N_Par_t ; i++ ) par_t[i] =
fun_t[ial][iby][ibz][i];
137 OffSet = par_t[N_Par_t-1];
139 DTV_v_drift[j] = par_t[0];
141 DTV_t_drift[j] =
MB_DT_time (dist, par_t) + DTV_delta_t[j] + OffSet;
146 printf(
"MB_DT_drift_LOOP: OffSet = %f\n",OffSet);
147 printf(
"MB_DT_drift_LOOP: dist, v_drift, t_drift, lin, t_width_m, t_width_p = %f %f %f %f %f %f\n",
148 dist, DTV_v_drift[j], DTV_t_drift[j], DTV_delta_t[j], DTV_t_width_m[j], DTV_t_width_p[j]) ;
156 DT->v_drift = DTV_v_drift[0];
157 DT->delta_t = DTV_delta_t[0];
158 DT->t_drift = DTV_t_drift[0];
159 DT->t_width_m = DTV_t_width_m[0];
160 DT->t_width_p = DTV_t_width_p[0];
176 printf(
"MB_DT_drift_time: dist, v_drift, t_drift, lin, t_width_m, t_width_p = %f %f %f %f %f %f\n",
177 dist,
DT->v_drift,
DT->t_drift,
DT->delta_t,
DT->t_width_m,
DT->t_width_p) ;
unsigned short MB_DT_Check_boundaries(double distime, double alpha, double by, double bz, short ifl) const
static const double alpha_value[11]
double MB_DT_time(double, double *) const
double MB_DT_sigma_t_p(double, double *) const
static const double By_value[5]
static const double fun_sigma_t[11][5][5][7]
double MB_DT_delta_t(double, double *) const
double MB_DT_sigma_t_m(double, double *) const
double MB_DT_MLInterpolation(double *al, double *by, double *bz, double *f) const
static const double Bz_value[5]
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
static const double fun_t[11][5][5][19]