desc.equilibrium.Equilibrium.compute_flux_coords

Equilibrium.compute_flux_coords(real_coords, R_lmn=None, Z_lmn=None, tol=1e-06, maxiter=20, rhomin=1e-06)

Find the (rho, theta, zeta) that correspond to given (R, phi, Z).

Parameters:
  • real_coords (ndarray, shape(k,3)) – 2D array of real space coordinates [R,phi,Z]. Each row is a different coordinate.

  • R_lmn (ndarray) – spectral coefficients for R and Z. Defaults to eq.R_lmn, eq.Z_lmn

  • Z_lmn (ndarray) – spectral coefficients for R and Z. Defaults to eq.R_lmn, eq.Z_lmn

  • tol (float) – Stopping tolerance. Iterations stop when sqrt((R-Ri)**2 + (Z-Zi)**2) < tol

  • maxiter (int > 0) – maximum number of Newton iterations

  • rhomin (float) – minimum allowable value of rho (to avoid singularity at rho=0)

Returns:

flux_coords (ndarray, shape(k,3)) – flux coordinates [rho,theta,zeta]. If Newton method doesn’t converge for a given coordinate (often because it is outside the plasma boundary), nan will be returned for those values