freegsnke.equilibrium_update module

Defines the FreeGSNKE equilibrium Object, which inherits from the FreeGS4E equilibrium object.

Copyright 2025 UKAEA, UKRI-STFC, and The Authors, as per the COPYRIGHT and README files.

This file is part of FreeGSNKE.

FreeGSNKE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

FreeGSNKE is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

You should have received a copy of the GNU Lesser General Public License along with FreeGSNKE. If not, see <http://www.gnu.org/licenses/>.

class freegsnke.equilibrium_update.Equilibrium(*args, **kwargs)[source]

Bases: Equilibrium

FreeGS4E equilibrium class with optional initialization.

__init__(*args, **kwargs)[source]

Instantiates the object.

adjust_psi_plasma()[source]

Operates an initial rescaling of the psi_plasma guess so to ensure a viable O-point and at least an X-point within the domain.

Only use after appropriate coil currents have been set as desired!

initialize_from_equilibrium()[source]

This function loads a pickle file containing an initial guess for the plasma flux (and the corners of the grid points it is located on).

Interpolation is carried out and mapped to the computational grid specified in the eq class.

psi_func(R, Z, *args, **kwargs)[source]

Scipy interpolation of plasma_psi function. Replaces the original FreeGS interpolation. It now includes a check which leads to the update of the interpolation when needed.

Parameters:
  • R (ndarray) – R coordinates where the interpolation is needed

  • Z (ndarray) – Z coordinates where the interpolation is needed

Returns:

Interpolated values of plasma_psi

Return type:

ndarray