desc.equilibrium.Equilibrium.map_coordinates

Equilibrium.map_coordinates(coords, inbasis, outbasis=('rho', 'theta', 'zeta'), guess=None, params=None, period=(inf, inf, inf), tol=1e-06, maxiter=30, full_output=False, **kwargs)Source

Given coordinates in inbasis, compute corresponding coordinates in outbasis.

First solves for the computational coordinates that correspond to inbasis, then evaluates outbasis at those locations.

Parameters:
  • coords (ndarray, shape(k,3)) – 2D array of input coordinates. Each row is a different point in space.

  • inbasis (tuple of str) – Labels for input and output coordinates, eg (“R”, “phi”, “Z”) or (“rho”, “alpha”, “zeta”) or any combination thereof. Labels should be the same as the compute function data key

  • outbasis (tuple of str) – Labels for input and output coordinates, eg (“R”, “phi”, “Z”) or (“rho”, “alpha”, “zeta”) or any combination thereof. Labels should be the same as the compute function data key

  • guess (None or ndarray, shape(k,3)) – Initial guess for the computational coordinates [‘rho’, ‘theta’, ‘zeta’] corresponding to coords in inbasis. If None, heuristics are used based on in basis and a nearest neighbor search on a coarse grid.

  • params (dict) – Values of equilibrium parameters to use, eg eq.params_dict

  • period (tuple of float) – Assumed periodicity for each quantity in inbasis. Use np.inf to denote no periodicity.

  • tol (float) – Stopping tolerance.

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

  • full_output (bool, optional) – If True, also return a tuple where the first element is the residual from the root finding and the second is the number of iterations.

  • kwargs (dict, optional) – Additional keyword arguments to pass to root such as maxiter_ls, alpha.

Returns:

  • coords (ndarray, shape(k,3)) – Coordinates mapped from inbasis to outbasis.

  • info (tuple) – 2 element tuple containing residuals and number of iterations for each point. Only returned if full_output is True

Notes

guess must be given for this function to be compatible with jit.