pyoculus.fields.cylindrical_grid_interpolated_field

class pyoculus.fields.cylindrical_grid_interpolated_field.AxisymmetricCylindricalGridField(R, Z, B_R, B_Z, B_phi, F_psi, pertfield: CylindricalBfield = None)

Axisymmetric magnetic field provided by interpolating a grid of points given in the R-Z plane.

Tokamak equilibrium solvers often provide the relevant data in a grid of points in the R-Z plane.

classmethod from_matlab_file(filename, with_perturbation=False)

filename: string specifying the name of the .mat file containing the grid of points.

for example, MEQ equilibrium solver calculates the magnetic data in Matlab, the user needs to save the data in a .mat file and provide the filename to this function.

classmethod from_matlab_file_with_added_B(filename, B_R_s, B_Z_s, F_psi_s, with_perturbation=False)

filename: string specifying the name of the .mat file containing the grid of points.

for example, MEQ equilibrium solver calculates the magnetic data in Matlab, the user needs to save the data in a .mat file and provide the filename to this function.

B_axi(xx)

xx: numpy array of shape (3,) specifying the coordinates at which the magnetic field is to be evaluated

B(xx)

xx: numpy array of shape (3,) specifying the coordinates at which the magnetic field is to be evaluated

B_interpolated(xx)

Evaluate magnetic field directly, for comparison with the derivation of the flux funcitons. xx: numpy array of shape (3,) specifying the coordinates at which the magnetic field is to be evaluated

A_R(xx)

xx: numpy array of shape (3,) specifying the coordinates at which the vector potential is to be evaluated return value of A_R for this specific point

A_unperturbed(xx)

xx: numpy array of shape (3,) specifying the coordinates at which the vector potential is to be evaluated

A(xx)

xx: numpy array of shape (3,) specifying the coordinates at which the vector potential is to be evaluated

dBdX(xx)

xx: numpy array of shape (3,) specifying the coordinates at which the magnetic field gradient is to be evaluated return Bfield, jacobian matrix for a specific point

class pyoculus.fields.cylindrical_grid_interpolated_field.AxisymmetricGridPerturbation(R, Z, F_psi_cosphi, F_psi_sinphi)

Axisymmetric magnetic field perturbation provided by interpolating a grid of points given in the R-Z plane.

B_R(xx)

xx: numpy array of shape (3,) specifying the coordinates at which the magnetic field is to be evaluated

B(xx)

Returns the contravariant magnetic fields at the given coordinates.

Parameters:
  • coords (array) – The coordinates at which to calculate the magnetic fields.

  • *args – Additional parameters.

A(xx)

xx: numpy array of shape (3,) specifying the coordinates at which the magnetic potential is to be evaluated

dBdX(xx, *args)

Gradient of the total field function at the point coords. Where (dBdX)^i_j = dB^i/dX^j with i the row index and j the column index of the matrix.