Magnetic Flux

plasmaboundaries.magnetic_flux.derivatives(f, order)

Computes the derivatives of function. Does not computes xy or yx derivatives.

Parameters:
  • f (callable f(x, y, c_i, pkg)) – function
  • order (int) – order of differenciation
Returns:

(fx^order, fy^order)

Return type:

(sympy.Add, sympy.Add)

plasmaboundaries.magnetic_flux.psi(X, Y, c_i, A, config, pkg='numpy')

Computes the value of magnetic flux at point (X, Y) according to coefficients ci.

Parameters:
  • X (float or numpy.array) – x coordinate
  • Y (float or numpy.array) – y coordinate
  • c_i (list) – list of floats, the ci coefficients
  • A (float) – plasma parameter
  • config (str) – shape of the plasma ‘non-null’, ‘single-null’, ‘double-null’.
  • pkg (str, optional) – if set to ‘numpy’ (resp. ‘sympy’), numpy (resp. sympy) objects will be used. Defaults to ‘numpy’.
Raises:

ValueError – If argument pkg is not in [‘numpy’, ‘np’, ‘sympy’, ‘sp’]

Returns:

value(s) of magnetic flux

Return type:

float or numpy.array or sympy.Add