desc.equilibrium.Equilibrium.set_initial_guess

Equilibrium.set_initial_guess(*args)

Set the initial guess for the flux surfaces, eg R_lmn, Z_lmn, L_lmn.

Parameters:
  • eq (Equilibrium) – Equilibrium to initialize

  • args

    either:
    • No arguments, in which case eq.surface will be scaled for the guess.

    • Another Surface object, which will be scaled to generate the guess. Optionally a Curve object may also be supplied for the magnetic axis.

    • Another Equilibrium, whose flux surfaces will be used.

    • File path to a VMEC or DESC equilibrium, which will be loaded and used.

    • Grid and 2-3 ndarrays, specifying the flux surface locations (R, Z, and optionally lambda) at fixed flux coordinates. All arrays should have the same length. Optionally, an ndarray of shape(k,3) may be passed instead of a grid.

Examples

Use existing equil.surface and scales down for guess:

>>> equil.set_initial_guess()

Use supplied Surface and scales down for guess. Assumes axis is centroid of user supplied surface:

>>> equil.set_initial_guess(surface)

Optionally, an interior surface may be scaled by giving the surface a flux label:

>>> surf = FourierRZToroidalSurface(rho=0.7)
>>> equil.set_initial_guess(surf)

Use supplied Surface and a supplied Curve for axis and scales between them for guess:

>>> equil.set_initial_guess(surface, curve)

Use the flux surfaces from an existing Equilibrium:

>>> equil.set_initial_guess(equil2)

Use flux surfaces from existing Equilibrium or VMEC output stored on disk:

>>> equil.set_initial_guess(path_to_saved_DESC_or_VMEC_output)

Use flux surfaces specified by points: nodes should either be a Grid or an ndarray, shape(k,3) giving the locations in rho, theta, zeta coordinates. R, Z, and optionally lambda should be array-like, shape(k,) giving the corresponding real space coordinates

>>> equil.set_initial_guess(nodes, R, Z, lambda)