2_Trajectories/borisSolver/magneticTrap.h
//bathtub trap of one coil on either side:
bathtub trap of one coil on either side.
bathtub trap of one coil on either side .
void bathTubField1Coil(double radius, double current, double z_coil1, double z_coil2,
                  double mu, double x_p, double y_p, double z_p,
		  double *background, double *bathField) {
  double *tempCoil1, *tempCoil2;
  int i;
  tempCoil1 = (double *)malloc(3*sizeof(double));
  tempCoil2 = (double *)malloc(3*sizeof(double));
  cirularCoilField(radius, current, z_coil1, mu, x_p, y_p, z_p, tempCoil1);
  cirularCoilField(radius, current, z_coil2, mu, x_p, y_p, z_p, tempCoil2);
  for (i=0;i<3;i++) {
    bathField[i] = tempCoil1[i] + tempCoil2[i] + background[i];
  }
  free(tempCoil1); free(tempCoil2);
}
void bathTubField1Coil ( double radius , double current , double z_coil1 , double z_coil2 , double mu , double x_p , double y_p , double z_p , double * background , double * bathField ) { double * tempCoil1 , * tempCoil2 ; int i ; tempCoil1 = ( double * ) malloc ( 3 * sizeof ( double ) ) ; tempCoil2 = ( double * ) malloc ( 3 * sizeof ( double ) ) ; cirularCoilField ( radius , current , z_coil1 , mu , x_p , y_p , z_p , tempCoil1 ) ; cirularCoilField ( radius , current , z_coil2 , mu , x_p , y_p , z_p , tempCoil2 ) ; for ( i = 0 ; i < 3 ; i ++ ) { bathField [ i ] = tempCoil1 [ i ] + tempCoil2 [ i ] + background [ i ] ; } free ( tempCoil1 ) ; free ( tempCoil2 ) ; }
bathtub trap of one coil on either side:
bathtub trap of one coil on either side :