freegs.control.ConstrainPsi2DAdvanced#
- class freegs.control.ConstrainPsi2DAdvanced(target_psi, weights=1.0, current_lims=None, max_total_current=None)[source]#
Bases:
objectAdjusts coil currents to minimise the square differences between psi[R,Z] and a target psi.
Attempts to also constrain the coil currents as in the ‘constrain’ class.
- __init__(target_psi, weights=1.0, current_lims=None, max_total_current=None)[source]#
- target_psinorm2D (R,Z) array
Must be the same size as the equilibrium psi
- weightsfloat or 2D array of same size as target_psinorm
Relative importance of each (R,Z) point in the fitting By default every point is equally weighted Set points to zero to ignore them in fitting.
- current_bounds: List of tuples
Optional list of tuples representing constraints on coil currents to be used when reconstructing the equilibrium from the geqdsk file. [(l1,u1),(l2,u2)…(lN,uN)]
Create an instance, specifying the constraints to apply
Methods
__init__(target_psi[, weights, ...])target_psinorm : 2D (R,Z) array
psi_difference(currents, eq)Sum of the squares of the differences between the achieved psi and the target psi.