Example: Static inverse free-boundary equilibrium calculations (in DIII-D)


Here we generate a DIII-D equilibrium using the machine geometry and some discharge data in the FUSE.jl repository.

The equilibrium/profile parameters are a mix of data from the repository and completely made up; please experiment on your own and change them to more realistic values as you please!

Import packages

import matplotlib.pyplot as plt

import numpy as np

Create the machine object

# build machine

from freegsnke import build_machine

tokamak = build_machine.tokamak(
    active_coils_path="../machine_configs/DIII-D/DIII-D_active_coils.pickle",
    passive_coils_path="../machine_configs/DIII-D/DIII-D_passive_coils.pickle",
    limiter_path="../machine_configs/DIII-D/DIII-D_limiter.pickle",
    wall_path="../machine_configs/DIII-D/DIII-D_wall.pickle",
)
Active coils --> built from pickle file.
Passive structures --> built from pickle file.
Limiter --> built from pickle file.
Wall --> built from pickle file.
Magnetic probes --> none provided.
Resistance (R) and inductance (M) matrices --> built using actives (and passives if present).
Tokamak built.
# plot the machine

fig, ax = plt.subplots(figsize=(8, 10), dpi=80)

tokamak.plot(axis=ax, show=False)  # plots the active coils and passive structures
ax.plot(tokamak.limiter.R, tokamak.limiter.Z, "k-", linewidth=1.2)  # plots the limiter

ax.grid(alpha=0.5)
ax.set_aspect("equal")
ax.set_xlim(0.55, 2.85)
ax.set_ylim(-2.15, 2.15)
ax.set_xlabel(r"Major radius, $R$ [m]")
ax.set_ylabel(r"Height, $Z$ [m]")
Text(0, 0.5, 'Height, $Z$ [m]')
../_images/d34118b8043a7c3943bbfc47c3ebb82c0ed07dbf969470d56acf4ab447e64815.png

Instantiate an equilibrium

from freegsnke import equilibrium_update

eq = equilibrium_update.Equilibrium(
    tokamak=tokamak,      # provide tokamak object
    Rmin=0.95, Rmax=2.43, # radial range
    Zmin=-1.42, Zmax=1.42,# vertical range
    nx=129,               # number of radial grid points (needs to be of the form 2**n + 1)
    ny=129,               # number of vertical grid points (needs to be of the form 2**n + 1)
)

Instantiate a profile object

# equilibrium profiles from the FUSE DIII-D example
psi_n = np.array([0.0, 0.015624999999999951, 0.031249999999999903, 0.04687500000000016, 0.062499999999999806, 0.07812500000000007, 0.09375000000000001, 0.10937499999999997, 0.12499999999999992, 0.1406250000000002, 0.15624999999999983, 0.17187500000000008, 0.18750000000000003, 0.203125, 0.21874999999999994, 0.2343749999999999, 0.24999999999999983, 0.2656250000000001, 0.28125000000000006, 0.296875, 0.31249999999999994, 0.3281249999999999, 0.3437499999999999, 0.3593750000000001, 0.3749999999999998, 0.39062500000000006, 0.40625, 0.42187499999999994, 0.4374999999999999, 0.45312500000000017, 0.4687499999999998, 0.48437500000000006, 0.5, 0.515625, 0.5312499999999999, 0.546875, 0.5625000000000001, 0.5781250000000001, 0.5937499999999999, 0.609375, 0.6250000000000001, 0.640625, 0.6562499999999998, 0.6718750000000001, 0.6875000000000002, 0.703125, 0.7187499999999999, 0.734375, 0.7500000000000001, 0.765625, 0.7812499999999999, 0.796875, 0.8125000000000001, 0.8281250000000001, 0.84375, 0.8593749999999998, 0.8750000000000001, 0.890625, 0.90625, 0.9218750000000001, 0.9375, 0.953125, 0.9687499999999999, 0.984375, 1.0])
pprime_data = np.array([-52858.0359742854, -52134.66720863615, -51411.2984429869, -50687.929518182704, -49964.56075253345, -49241.1919868842, -48517.82306208001, -47794.45429643076, -47071.085530781515, -46347.71676513226, -45624.34784032807, -44900.97907467882, -44177.61030902957, -43454.241543380325, -42730.872618576126, -42007.50385292687, -41284.13508727763, -40560.76616247343, -39837.397396824184, -39114.02863117494, -38390.65986552568, -37667.29094072149, -36943.92217507224, -36220.55340942299, -35497.184484618796, -34773.81571896955, -34050.4469533203, -33327.07818767105, -32603.709262866854, -31880.340497217607, -31156.971731568356, -30433.602965919108, -29710.234041114913, -28986.86527546566, -28263.496509816414, -27540.127585012222, -26816.75881936297, -26093.390053713723, -25370.021288064472, -24646.652363260277, -23923.28359761103, -23199.914831961778, -22476.545907157586, -21753.177141508335, -21029.808375859084, -20306.439610209836, -19583.070685405644, -18859.701919756393, -18136.333154107142, -17412.96438845789, -16689.5954636537, -15966.22669800445, -15242.857884608718, -14519.489071212985, -13796.120273732746, -13072.751460337013, -12349.382646941282, -11626.013833545549, -10902.645020149816, -10179.276222669576, -9455.907409273845, -8732.53859587811, -8009.169782482379, -7285.80098500214, -6562.432171606408])
ffprime_data = np.array([-0.21224472378304216, -0.20940737311957705, -0.2065648196810223, -0.20371706187582844, -0.20086410129554494, -0.19800593794017174, -0.19514257180970887, -0.1922740029041563, -0.18940022963196465, -0.18652125358468333, -0.18363707635386176, -0.1807476947564011, -0.1778531087923013, -0.1749533216446613, -0.17204833172193157, -0.16913813743256279, -0.1662227403681043, -0.16330214052855616, -0.1603763379139183, -0.15744533156926116, -0.15450912244951434, -0.1515677103955229, -0.14862109524813188, -0.14566927716649625, -0.14271225599146106, -0.13975003172302633, -0.136782604361192, -0.13380997406511308, -0.1308321406756346, -0.12784910435191152, -0.1248608647756339, -0.12186742226511167, -0.11886877682034483, -0.1158649281230235, -0.11285587649145752, -0.10984162176649201, -0.10682216410728186, -0.10379750335467217, -0.10076763950866291, -0.0977325725692541, -0.09469230269560067, -0.09164682972854767, -0.08859615382725004, -0.08554027467339793, -0.08247919258530122, -0.07941290756295986, -0.07634141928806401, -0.07326472807892354, -0.0701828337763835, -0.06709573653959885, -0.06400343620941465, -0.06090593278583088, -0.05780322626884754, -0.054695316817619605, -0.051582204272992094, -0.048463888634965036, -0.04534037006269335, -0.04221164839702211, -0.0390777236379513, -0.03593859594463588, -0.032794265157920895, -0.029644731277806355, -0.026489994463447193, -0.02333005439653353, -0.020164911554530197])

from freegsnke.jtor_update import GeneralPprimeFFprime

profiles = GeneralPprimeFFprime(
    eq=eq,                 # equilibrium object
    Ip=1083742,            # plasma current [A]
    fvac=2.89,             # vacuum R * B_tor [T m]
    psi_n=psi_n,           # normalised poloidal flux
    pprime_data=pprime_data,   # pressure derivative profile
    ffprime_data=ffprime_data, # FF' profile
    Ip_logic=True,
)

Load the static nonlinear solver

from freegsnke import GSstaticsolver

GSStaticSolver = GSstaticsolver.NKGSsolver(eq, seed=42)

Constraints

# boundary and null constraints
Rx_upper, Zx_upper = 1.29, 1.12
Rx_lower, Zx_lower = 1.27, -1.17

null_points = [
    [Rx_upper, Rx_lower],
    [Zx_upper, Zx_lower],
]

isoflux_set = np.array([[[1.10, 2.23], [0.0, 0.0]]])

from freegsnke.inverse import Inverse_optimizer

constrain = Inverse_optimizer(
    null_points=null_points,
    isoflux_set=isoflux_set,
)

The inverse solve

GSStaticSolver.inverse_solve(
    eq=eq,
    profiles=profiles,
    constrain=constrain,
    target_relative_tolerance=5e-4,
    target_relative_psit_update=2e-3,
    max_solving_iterations=50,
    l2_reg=np.array([1e-14] * 24),
    verbose=True,
)
-----
Inverse static solve starting...
Successfully computed GS residual using initial plasma_psi and tokamak_psi guesses.
Initial relative error = 1.09e+00
-----
Iteration: 0
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-9.95e+01', '-9.95e+01', '3.76e+01', '5.16e+01', '3.36e+01', '4.69e+01', '-5.12e+03', '-3.35e+03', '-2.10e+02', '4.38e+03', '4.80e+03', '-4.23e+01', '-4.40e+03', '2.83e+03', '-3.30e+03', '-5.09e+03', '-3.43e+03', '-9.07e+02', '3.78e+03', '4.98e+03', '2.34e+02', '-3.87e+03', '2.63e+03', '-3.81e+03']
Constraint losses = 4.09e-01
Relative update of tokamak psi (in plasma core): 2.88e+07
Handing off to forward solve (with updated currents).
Relative error =  8.94e-01
-----
Iteration: 1
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['4.03e+00', '3.81e+00', '-1.15e+01', '-2.13e+01', '7.92e-01', '1.46e+01', '7.35e+02', '3.16e+02', '-1.20e+02', '-4.06e+02', '-2.05e+02', '-8.04e+02', '1.24e+02', '1.18e+02', '5.48e+02', '7.77e+02', '4.40e+02', '-4.00e+01', '-7.67e+02', '-7.86e+02', '-6.88e+02', '3.73e+02', '-2.71e+02', '7.42e+02']
Constraint losses = 5.93e-02
Relative update of tokamak psi (in plasma core): 1.74e-02
Handing off to forward solve (with updated currents).
Relative error =  6.86e-01
-----
Iteration: 2
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['5.37e+00', '5.16e+00', '-1.18e+01', '-2.09e+01', '3.37e-02', '1.27e+01', '7.01e+02', '3.04e+02', '-1.06e+02', '-3.78e+02', '-1.99e+02', '-7.81e+02', '9.82e+01', '9.78e+01', '4.97e+02', '7.40e+02', '4.20e+02', '-3.44e+01', '-7.26e+02', '-7.50e+02', '-6.67e+02', '3.43e+02', '-2.67e+02', '6.92e+02']
Constraint losses = 5.74e-02
Relative update of tokamak psi (in plasma core): 2.22e-02
Handing off to forward solve (with updated currents).
Relative error =  4.54e-01
-----
Iteration: 3
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['6.21e+00', '6.00e+00', '-1.18e+01', '-2.04e+01', '-7.35e-01', '1.14e+01', '6.56e+02', '2.83e+02', '-9.20e+01', '-3.35e+02', '-1.71e+02', '-7.59e+02', '6.02e+01', '9.38e+01', '4.42e+02', '6.94e+02', '3.96e+02', '-3.19e+01', '-6.89e+02', '-7.17e+02', '-6.41e+02', '3.16e+02', '-2.65e+02', '6.44e+02']
Constraint losses = 5.54e-02
Relative update of tokamak psi (in plasma core): 2.58e-02
Handing off to forward solve (with updated currents).
Relative error =  2.03e-01
-----
Iteration: 4
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['7.34e+00', '7.12e+00', '-1.20e+01', '-2.05e+01', '-1.73e+00', '1.04e+01', '6.25e+02', '2.67e+02', '-7.86e+01', '-2.90e+02', '-1.40e+02', '-7.60e+02', '1.47e+01', '9.63e+01', '3.90e+02', '6.65e+02', '3.81e+02', '-3.04e+01', '-6.73e+02', '-7.09e+02', '-6.29e+02', '3.01e+02', '-2.75e+02', '6.14e+02']
Constraint losses = 5.52e-02
Relative update of tokamak psi (in plasma core): 2.95e-02
Handing off to forward solve (with updated currents).
Relative error =  7.43e-02
-----
Iteration: 5
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['5.78e+00', '5.60e+00', '-7.63e+00', '-1.37e+01', '-2.92e+00', '6.63e+00', '3.56e+02', '1.42e+02', '-3.08e+01', '-9.64e+01', '-8.48e+00', '-5.03e+02', '-7.72e+01', '9.76e+01', '1.75e+02', '3.89e+02', '2.30e+02', '-2.16e+01', '-4.43e+02', '-4.83e+02', '-3.78e+02', '2.00e+02', '-2.11e+02', '3.77e+02']
Constraint losses = 3.64e-02
Relative update of tokamak psi (in plasma core): 2.13e-02
Handing off to forward solve (with updated currents).
Relative error =  5.03e-03
-----
Iteration: 6
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['2.02e+01', '2.10e+01', '-3.07e+01', '-1.33e+01', '1.64e+01', '-2.50e+01', '8.41e+02', '5.53e+02', '-1.87e+02', '-1.35e+03', '-1.42e+03', '-5.23e+02', '8.22e+02', '-8.95e+02', '7.18e+02', '6.88e+02', '2.33e+02', '6.84e+01', '3.36e+02', '5.50e+02', '-1.19e+03', '-6.66e+02', '4.91e+02', '-1.01e+02']
Constraint losses = 9.16e-02
Relative update of tokamak psi (in plasma core): 6.21e-02
Handing off to forward solve (with updated currents).
Relative error =  3.39e-02
-----
Iteration: 7
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-8.80e+00', '-8.75e+00', '1.09e+01', '1.29e+01', '1.98e+00', '-4.60e-01', '-2.56e+02', '-1.03e+02', '3.24e+01', '1.15e+02', '7.10e+01', '4.95e+02', '1.14e+02', '-4.99e-01', '-8.57e+01', '-2.64e+02', '-1.28e+02', '1.58e+01', '1.92e+02', '1.92e+02', '4.71e+02', '6.19e+01', '7.31e+01', '-1.35e+02']
Constraint losses = 2.20e-01
Relative update of tokamak psi (in plasma core): 2.93e-02
Handing off to forward solve (with updated currents).
Relative error =  4.41e-03
-----
Iteration: 8
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-1.20e+01', '-1.19e+01', '1.19e+01', '1.50e+01', '4.43e+00', '1.73e-01', '-3.40e+02', '-1.54e+02', '2.11e+01', '1.55e+02', '1.19e+02', '5.24e+02', '7.95e+01', '2.97e+01', '-1.16e+02', '-3.53e+02', '-1.94e+02', '-4.95e+00', '2.77e+02', '3.16e+02', '4.83e+02', '-8.88e+00', '1.58e+02', '-1.93e+02']
Constraint losses = 1.40e-01
Relative update of tokamak psi (in plasma core): 3.10e-02
Handing off to forward solve (with updated currents).
Relative error =  1.73e-03
-----
Iteration: 9
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['4.42e+00', '4.50e+00', '-6.21e+00', '-3.54e+00', '1.23e+00', '-4.10e+00', '3.62e+01', '1.79e+01', '-1.15e+01', '-6.11e+01', '-7.63e+01', '-1.75e+02', '-5.82e+01', '-7.06e+01', '-2.37e+01', '2.03e+01', '-1.99e+01', '-1.03e+01', '8.15e+01', '1.22e+02', '-2.29e+02', '-1.77e+02', '8.17e+01', '-7.98e+01']
Constraint losses = 5.20e-02
Relative update of tokamak psi (in plasma core): 3.23e-02
Handing off to forward solve (with updated currents).
Relative error =  2.06e-03
-----
Iteration: 10
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-1.43e+01', '-1.42e+01', '1.11e+01', '1.79e+01', '9.01e+00', '-2.19e+00', '-4.02e+02', '-1.82e+02', '2.63e+01', '1.77e+02', '1.20e+02', '5.41e+02', '4.70e+01', '2.52e+00', '-1.73e+02', '-4.27e+02', '-2.59e+02', '-3.62e+01', '3.54e+02', '4.56e+02', '4.83e+02', '-7.17e+01', '2.78e+02', '-2.16e+02']
Constraint losses = 5.24e-02
Relative update of tokamak psi (in plasma core): 3.32e-02
Handing off to forward solve (with updated currents).
Relative error =  2.93e-02
-----
Iteration: 11
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['7.26e+00', '7.25e+00', '-7.22e+00', '-8.59e+00', '-2.47e+00', '-8.27e-01', '1.84e+02', '8.46e+01', '-1.87e+01', '-1.09e+02', '-9.09e+01', '-2.95e+02', '-3.47e+01', '-3.49e+01', '6.97e+01', '1.86e+02', '9.63e+01', '7.08e+00', '-1.09e+02', '-1.25e+02', '-3.00e+02', '-4.70e+01', '-6.57e+01', '6.20e+01']
Constraint losses = 1.19e-01
Relative update of tokamak psi (in plasma core): 3.37e-02
Handing off to forward solve (with updated currents).
Relative error =  5.26e-04
-----
Iteration: 12
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['9.26e+00', '9.26e+00', '-1.01e+01', '-1.07e+01', '-1.59e+00', '-2.09e+00', '2.64e+02', '1.29e+02', '-2.24e+01', '-1.71e+02', '-1.56e+02', '-3.89e+02', '-2.37e+01', '-7.43e+01', '1.01e+02', '2.62e+02', '1.32e+02', '2.49e+00', '-1.52e+02', '-1.58e+02', '-4.01e+02', '-4.96e+01', '-6.16e+01', '1.13e+02']
Constraint losses = 4.52e-02
Relative update of tokamak psi (in plasma core): 3.55e-02
Handing off to forward solve (with updated currents).
Relative error =  3.71e-04
-----
Iteration: 13
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-9.33e+00', '-9.34e+00', '1.04e+01', '1.12e+01', '1.96e+00', '1.75e+00', '-2.38e+02', '-1.09e+02', '3.13e+01', '1.60e+02', '1.37e+02', '4.09e+02', '4.85e+01', '5.94e+01', '-9.21e+01', '-2.35e+02', '-1.11e+02', '-1.80e+00', '1.11e+02', '1.12e+02', '4.33e+02', '1.06e+02', '4.48e+01', '-6.29e+01']
Constraint losses = 1.09e-01
Relative update of tokamak psi (in plasma core): 3.11e-02
Handing off to forward solve (with updated currents).
Relative error =  3.99e-04
-----
Iteration: 14
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['6.85e+00', '6.84e+00', '-7.37e+00', '-8.24e+00', '-1.78e+00', '-1.04e+00', '1.72e+02', '7.77e+01', '-2.03e+01', '-1.06e+02', '-8.86e+01', '-2.97e+02', '-4.19e+01', '-3.59e+01', '6.24e+01', '1.72e+02', '8.37e+01', '1.99e+00', '-9.12e+01', '-9.72e+01', '-3.06e+02', '-6.51e+01', '-4.42e+01', '5.19e+01']
Constraint losses = 5.68e-02
Relative update of tokamak psi (in plasma core): 3.12e-02
Handing off to forward solve (with updated currents).
Relative error =  9.17e-04
-----
Iteration: 15
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-8.73e+00', '-8.74e+00', '9.94e+00', '1.04e+01', '1.41e+00', '1.91e+00', '-2.34e+02', '-1.10e+02', '2.88e+01', '1.62e+02', '1.42e+02', '3.84e+02', '3.53e+01', '6.52e+01', '-9.26e+01', '-2.30e+02', '-1.09e+02', '-5.55e-01', '1.10e+02', '1.08e+02', '4.08e+02', '9.15e+01', '3.79e+01', '-7.19e+01']
Constraint losses = 6.71e-02
Relative update of tokamak psi (in plasma core): 3.11e-02
Handing off to forward solve (with updated currents).
Relative error =  3.85e-04
-----
Iteration: 16
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['6.30e+00', '6.30e+00', '-6.90e+00', '-7.54e+00', '-1.41e+00', '-1.11e+00', '1.64e+02', '7.58e+01', '-1.95e+01', '-1.07e+02', '-9.16e+01', '-2.73e+02', '-3.07e+01', '-3.93e+01', '6.31e+01', '1.63e+02', '7.90e+01', '1.77e+00', '-8.39e+01', '-8.73e+01', '-2.86e+02', '-6.00e+01', '-3.68e+01', '5.11e+01']
Constraint losses = 9.59e-02
Relative update of tokamak psi (in plasma core): 3.07e-02
Handing off to forward solve (with updated currents).
Relative error =  3.69e-04
-----
Iteration: 17
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-6.51e+00', '-6.50e+00', '6.26e+00', '7.37e+00', '2.14e+00', '9.96e-01', '-1.74e+02', '-8.42e+01', '1.57e+01', '1.12e+02', '9.94e+01', '2.46e+02', '9.04e+00', '4.36e+01', '-7.25e+01', '-1.74e+02', '-9.24e+01', '-9.98e+00', '9.95e+01', '1.17e+02', '2.55e+02', '3.06e+01', '6.14e+01', '-6.14e+01']
Constraint losses = 2.27e-02
Relative update of tokamak psi (in plasma core): 1.96e-02
Handing off to forward solve (with updated currents).
Relative error =  5.69e-04
-----
Iteration: 18
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['6.27e+00', '6.27e+00', '-6.67e+00', '-7.44e+00', '-1.56e+00', '-1.04e+00', '1.67e+02', '7.82e+01', '-1.80e+01', '-1.07e+02', '-9.25e+01', '-2.65e+02', '-2.49e+01', '-3.95e+01', '6.54e+01', '1.67e+02', '8.32e+01', '3.45e+00', '-9.11e+01', '-9.82e+01', '-2.74e+02', '-4.80e+01', '-4.41e+01', '5.76e+01']
Constraint losses = 8.34e-02
Relative update of tokamak psi (in plasma core): 2.78e-02
Handing off to forward solve (with updated currents).
Relative error =  4.81e-04
-----
Iteration: 19
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-7.16e+00', '-7.16e+00', '7.91e+00', '8.59e+00', '1.48e+00', '1.29e+00', '-1.92e+02', '-8.94e+01', '2.18e+01', '1.24e+02', '1.07e+02', '3.13e+02', '3.25e+01', '4.65e+01', '-7.42e+01', '-1.91e+02', '-9.30e+01', '-1.35e+00', '1.02e+02', '1.05e+02', '3.25e+02', '6.23e+01', '4.26e+01', '-6.61e+01']
Constraint losses = 2.98e-02
Relative update of tokamak psi (in plasma core): 2.65e-02
Handing off to forward solve (with updated currents).
Relative error =  7.00e-04
-----
Iteration: 20
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['5.44e+00', '5.44e+00', '-5.87e+00', '-6.46e+00', '-1.27e+00', '-9.52e-01', '1.45e+02', '6.81e+01', '-1.62e+01', '-9.49e+01', '-8.22e+01', '-2.31e+02', '-2.12e+01', '-3.56e+01', '5.74e+01', '1.44e+02', '7.13e+01', '2.61e+00', '-7.67e+01', '-8.14e+01', '-2.41e+02', '-4.50e+01', '-3.54e+01', '4.86e+01']
Constraint losses = 1.05e-01
Relative update of tokamak psi (in plasma core): 2.57e-02
Handing off to forward solve (with updated currents).
Relative error =  3.57e-04
-----
Iteration: 21
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['6.30e-01', '6.30e-01', '-7.23e-01', '-8.04e-01', '-1.91e-01', '-7.51e-02', '1.07e+01', '3.57e+00', '-2.34e+00', '-5.39e+00', '-3.29e+00', '-3.05e+01', '-1.00e+01', '-5.30e-01', '1.83e+00', '1.07e+01', '4.00e+00', '-5.21e-01', '-3.21e+00', '-2.75e+00', '-3.17e+01', '-1.31e+01', '-1.48e+00', '-1.49e+00']
Constraint losses = 3.15e-03
Relative update of tokamak psi (in plasma core): 3.57e-03
Handing off to forward solve (with updated currents).
Relative error =  3.04e-04
-----
Iteration: 22
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-2.44e+00', '-2.44e+00', '2.45e+00', '2.82e+00', '7.76e-01', '3.89e-01', '-5.80e+01', '-2.66e+01', '6.17e+00', '3.54e+01', '3.02e+01', '9.80e+01', '1.34e+01', '1.29e+01', '-2.05e+01', '-5.82e+01', '-2.92e+01', '-2.11e+00', '3.07e+01', '3.50e+01', '1.01e+02', '2.12e+01', '1.84e+01', '-1.56e+01']
Constraint losses = 9.44e-03
Relative update of tokamak psi (in plasma core): 8.98e-03
Handing off to forward solve (with updated currents).
Relative error =  7.60e-04
-----
Iteration: 23
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['4.29e+00', '4.29e+00', '-4.48e+00', '-4.94e+00', '-1.10e+00', '-8.33e-01', '1.09e+02', '5.11e+01', '-1.10e+01', '-6.92e+01', '-6.10e+01', '-1.75e+02', '-1.89e+01', '-2.78e+01', '3.97e+01', '1.08e+02', '5.37e+01', '2.70e+00', '-5.72e+01', '-6.22e+01', '-1.82e+02', '-3.51e+01', '-2.89e+01', '3.41e+01']
Constraint losses = 3.22e-02
Relative update of tokamak psi (in plasma core): 1.70e-02
Handing off to forward solve (with updated currents).
Relative error =  6.41e-04
-----
Iteration: 24
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-4.30e+00', '-4.30e+00', '4.82e+00', '5.17e+00', '8.64e-01', '8.11e-01', '-1.11e+02', '-5.08e+01', '1.45e+01', '7.47e+01', '6.40e+01', '1.89e+02', '2.19e+01', '2.78e+01', '-4.32e+01', '-1.09e+02', '-5.15e+01', '-6.04e-01', '5.19e+01', '5.20e+01', '2.01e+02', '4.83e+01', '2.03e+01', '-3.04e+01']
Constraint losses = 4.10e-02
Relative update of tokamak psi (in plasma core): 1.65e-02
Handing off to forward solve (with updated currents).
Relative error =  3.60e-04
-----
Iteration: 25
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['3.35e+00', '3.35e+00', '-3.65e+00', '-4.08e+00', '-8.44e-01', '-4.85e-01', '8.60e+01', '3.89e+01', '-1.05e+01', '-5.36e+01', '-4.46e+01', '-1.47e+02', '-1.96e+01', '-1.77e+01', '3.24e+01', '8.59e+01', '4.18e+01', '8.33e-01', '-4.57e+01', '-4.83e+01', '-1.52e+02', '-3.18e+01', '-2.15e+01', '2.67e+01']
Constraint losses = 3.75e-02
Relative update of tokamak psi (in plasma core): 1.47e-02
Handing off to forward solve (with updated currents).
Relative error =  2.77e-04
-----
Iteration: 26
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-3.63e+00', '-3.63e+00', '3.83e+00', '4.25e+00', '9.20e-01', '6.43e-01', '-9.46e+01', '-4.44e+01', '9.70e+00', '5.98e+01', '5.20e+01', '1.51e+02', '1.58e+01', '2.28e+01', '-3.55e+01', '-9.44e+01', '-4.72e+01', '-2.01e+00', '5.17e+01', '5.60e+01', '1.56e+02', '2.78e+01', '2.55e+01', '-3.21e+01']
Constraint losses = 2.39e-02
Relative update of tokamak psi (in plasma core): 1.29e-02
Handing off to forward solve (with updated currents).
Relative error =  2.91e-04
-----
Iteration: 27
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['2.59e+00', '2.59e+00', '-2.76e+00', '-3.10e+00', '-6.71e-01', '-4.07e-01', '6.68e+01', '3.08e+01', '-7.75e+00', '-4.26e+01', '-3.62e+01', '-1.10e+02', '-1.26e+01', '-1.50e+01', '2.57e+01', '6.67e+01', '3.29e+01', '1.29e+00', '-3.53e+01', '-3.80e+01', '-1.15e+02', '-2.29e+01', '-1.74e+01', '2.08e+01']
Constraint losses = 4.02e-02
Relative update of tokamak psi (in plasma core): 1.10e-02
Handing off to forward solve (with updated currents).
Relative error =  1.97e-04
-----
Iteration: 28
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-1.80e+00', '-1.80e+00', '1.85e+00', '2.07e+00', '4.73e-01', '3.18e-01', '-4.87e+01', '-2.33e+01', '3.71e+00', '2.90e+01', '2.57e+01', '7.31e+01', '6.73e+00', '1.15e+01', '-1.76e+01', '-4.90e+01', '-2.54e+01', '-1.14e+00', '3.04e+01', '3.36e+01', '7.35e+01', '7.58e+00', '1.56e+01', '-2.08e+01']
Constraint losses = 6.98e-03
Relative update of tokamak psi (in plasma core): 6.01e-03
Handing off to forward solve (with updated currents).
Relative error =  4.76e-04
-----
Iteration: 29
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['2.86e+00', '2.86e+00', '-3.08e+00', '-3.41e+00', '-6.92e-01', '-4.78e-01', '7.60e+01', '3.54e+01', '-8.55e+00', '-4.92e+01', '-4.23e+01', '-1.22e+02', '-1.18e+01', '-1.80e+01', '2.99e+01', '7.57e+01', '3.74e+01', '1.41e+00', '-4.05e+01', '-4.32e+01', '-1.27e+02', '-2.37e+01', '-1.91e+01', '2.53e+01']
Constraint losses = 2.34e-02
Relative update of tokamak psi (in plasma core): 1.15e-02
Handing off to forward solve (with updated currents).
Relative error =  3.13e-04
-----
Iteration: 30
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-2.72e+00', '-2.71e+00', '2.88e+00', '3.33e+00', '8.16e-01', '3.09e-01', '-6.67e+01', '-2.95e+01', '8.95e+00', '4.13e+01', '3.33e+01', '1.18e+02', '1.73e+01', '1.20e+01', '-2.55e+01', '-6.69e+01', '-3.26e+01', '-1.35e+00', '3.43e+01', '3.75e+01', '1.23e+02', '2.85e+01', '1.85e+01', '-1.72e+01']
Constraint losses = 2.74e-02
Relative update of tokamak psi (in plasma core): 1.06e-02
Handing off to forward solve (with updated currents).
Relative error =  4.97e-04
-----
Iteration: 31
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['2.39e+00', '2.39e+00', '-2.57e+00', '-2.81e+00', '-5.51e-01', '-4.49e-01', '6.18e+01', '2.89e+01', '-7.02e+00', '-4.05e+01', '-3.52e+01', '-1.01e+02', '-1.05e+01', '-1.56e+01', '2.37e+01', '6.13e+01', '3.00e+01', '1.05e+00', '-3.14e+01', '-3.32e+01', '-1.06e+02', '-2.18e+01', '-1.44e+01', '1.91e+01']
Constraint losses = 2.29e-02
Relative update of tokamak psi (in plasma core): 9.71e-03
Handing off to forward solve (with updated currents).
Relative error =  4.92e-04
-----
Iteration: 32
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-2.44e+00', '-2.44e+00', '2.62e+00', '2.87e+00', '5.73e-01', '4.49e-01', '-6.40e+01', '-3.01e+01', '7.37e+00', '4.27e+01', '3.72e+01', '1.02e+02', '9.13e+00', '1.64e+01', '-2.55e+01', '-6.35e+01', '-3.12e+01', '-1.39e+00', '3.24e+01', '3.45e+01', '1.08e+02', '2.17e+01', '1.52e+01', '-1.98e+01']
Constraint losses = 2.01e-02
Relative update of tokamak psi (in plasma core): 8.94e-03
Handing off to forward solve (with updated currents).
Relative error =  4.66e-04
-----
Iteration: 33
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['2.03e+00', '2.03e+00', '-2.18e+00', '-2.41e+00', '-4.96e-01', '-3.50e-01', '5.24e+01', '2.43e+01', '-6.24e+00', '-3.44e+01', '-2.95e+01', '-8.63e+01', '-9.08e+00', '-1.27e+01', '2.05e+01', '5.21e+01', '2.55e+01', '1.02e+00', '-2.65e+01', '-2.83e+01', '-9.05e+01', '-1.90e+01', '-1.26e+01', '1.56e+01']
Constraint losses = 2.24e-02
Relative update of tokamak psi (in plasma core): 8.32e-03
Handing off to forward solve (with updated currents).
Relative error =  4.91e-04
-----
Iteration: 34
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-2.01e+00', '-2.01e+00', '2.20e+00', '2.45e+00', '4.80e-01', '3.00e-01', '-5.31e+01', '-2.43e+01', '6.58e+00', '3.43e+01', '2.88e+01', '8.85e+01', '9.98e+00', '1.16e+01', '-2.10e+01', '-5.29e+01', '-2.58e+01', '-6.21e-01', '2.77e+01', '2.91e+01', '9.22e+01', '1.89e+01', '1.26e+01', '-1.68e+01']
Constraint losses = 1.32e-02
Relative update of tokamak psi (in plasma core): 7.90e-03
Handing off to forward solve (with updated currents).
Relative error =  3.38e-04
-----
Iteration: 35
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['1.95e+00', '1.95e+00', '-2.09e+00', '-2.35e+00', '-5.17e-01', '-2.86e-01', '5.00e+01', '2.28e+01', '-5.93e+00', '-3.14e+01', '-2.64e+01', '-8.41e+01', '-1.05e+01', '-1.06e+01', '1.91e+01', '5.00e+01', '2.46e+01', '8.41e-01', '-2.67e+01', '-2.87e+01', '-8.71e+01', '-1.77e+01', '-1.32e+01', '1.55e+01']
Constraint losses = 2.39e-02
Relative update of tokamak psi (in plasma core): 8.13e-03
Handing off to forward solve (with updated currents).
Relative error =  2.96e-04
-----
Iteration: 36
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-2.16e+00', '-2.16e+00', '2.22e+00', '2.47e+00', '5.88e-01', '4.16e-01', '-5.49e+01', '-2.61e+01', '5.75e+00', '3.62e+01', '3.20e+01', '8.61e+01', '7.29e+00', '1.47e+01', '-2.13e+01', '-5.46e+01', '-2.74e+01', '-2.01e+00', '2.80e+01', '3.11e+01', '9.04e+01', '1.76e+01', '1.51e+01', '-1.62e+01']
Constraint losses = 1.15e-02
Relative update of tokamak psi (in plasma core): 7.61e-03
Handing off to forward solve (with updated currents).
Relative error =  1.25e-04
-----
Iteration: 37
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['1.78e+00', '1.78e+00', '-1.87e+00', '-2.10e+00', '-4.81e-01', '-2.94e-01', '4.53e+01', '2.10e+01', '-5.11e+00', '-2.90e+01', '-2.49e+01', '-7.43e+01', '-8.18e+00', '-1.06e+01', '1.73e+01', '4.52e+01', '2.24e+01', '1.16e+00', '-2.37e+01', '-2.59e+01', '-7.73e+01', '-1.55e+01', '-1.22e+01', '1.36e+01']
Constraint losses = 2.45e-02
Relative update of tokamak psi (in plasma core): 7.15e-03
Handing off to forward solve (with updated currents).
Relative error =  2.61e-04
-----
Iteration: 38
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-1.55e+00', '-1.55e+00', '1.77e+00', '1.82e+00', '2.26e-01', '3.71e-01', '-4.16e+01', '-1.97e+01', '4.73e+00', '2.85e+01', '2.54e+01', '6.76e+01', '6.27e+00', '1.21e+01', '-1.58e+01', '-4.09e+01', '-1.93e+01', '3.63e-02', '2.01e+01', '1.95e+01', '7.16e+01', '1.54e+01', '6.59e+00', '-1.36e+01']
Constraint losses = 7.02e-03
Relative update of tokamak psi (in plasma core): 6.12e-03
Handing off to forward solve (with updated currents).
Relative error =  3.63e-04
-----
Iteration: 39
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['1.55e+00', '1.56e+00', '-1.69e+00', '-1.82e+00', '-3.39e-01', '-3.09e-01', '4.06e+01', '1.91e+01', '-4.77e+00', '-2.74e+01', '-2.40e+01', '-6.56e+01', '-5.99e+00', '-1.08e+01', '1.60e+01', '4.01e+01', '1.95e+01', '7.33e-01', '-1.98e+01', '-2.07e+01', '-6.94e+01', '-1.48e+01', '-8.73e+00', '1.21e+01']
Constraint losses = 2.28e-02
Relative update of tokamak psi (in plasma core): 6.33e-03
Handing off to forward solve (with updated currents).
Relative error =  4.04e-04
-----
Iteration: 40
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-1.32e+00', '-1.32e+00', '1.42e+00', '1.59e+00', '3.33e-01', '1.96e-01', '-3.46e+01', '-1.59e+01', '3.75e+00', '2.11e+01', '1.78e+01', '5.74e+01', '7.25e+00', '7.19e+00', '-1.28e+01', '-3.47e+01', '-1.72e+01', '-3.64e-01', '1.96e+01', '2.09e+01', '5.87e+01', '1.05e+01', '9.33e+00', '-1.22e+01']
Constraint losses = 5.91e-03
Relative update of tokamak psi (in plasma core): 5.10e-03
Handing off to forward solve (with updated currents).
Relative error =  3.49e-04
-----
Iteration: 41
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['1.40e+00', '1.40e+00', '-1.51e+00', '-1.64e+00', '-3.10e-01', '-2.72e-01', '3.63e+01', '1.70e+01', '-4.13e+00', '-2.40e+01', '-2.10e+01', '-5.90e+01', '-5.84e+00', '-9.44e+00', '1.40e+01', '3.60e+01', '1.75e+01', '5.97e-01', '-1.83e+01', '-1.92e+01', '-6.20e+01', '-1.28e+01', '-8.16e+00', '1.12e+01']
Constraint losses = 1.80e-02
Relative update of tokamak psi (in plasma core): 5.60e-03
Handing off to forward solve (with updated currents).
Relative error =  2.63e-04
-----
Iteration: 42
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-1.37e+00', '-1.37e+00', '1.44e+00', '1.66e+00', '3.99e-01', '1.66e-01', '-3.51e+01', '-1.59e+01', '3.87e+00', '2.09e+01', '1.72e+01', '5.88e+01', '7.91e+00', '6.52e+00', '-1.30e+01', '-3.54e+01', '-1.78e+01', '-6.45e-01', '2.03e+01', '2.23e+01', '5.98e+01', '1.06e+01', '1.07e+01', '-1.20e+01']
Constraint losses = 7.36e-03
Relative update of tokamak psi (in plasma core): 5.22e-03
Handing off to forward solve (with updated currents).
Relative error =  3.84e-04
-----
Iteration: 43
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['1.20e+00', '1.20e+00', '-1.30e+00', '-1.45e+00', '-3.02e-01', '-1.84e-01', '3.15e+01', '1.44e+01', '-3.44e+00', '-1.94e+01', '-1.64e+01', '-5.21e+01', '-6.46e+00', '-6.72e+00', '1.17e+01', '3.15e+01', '1.56e+01', '3.72e-01', '-1.76e+01', '-1.87e+01', '-5.35e+01', '-9.79e+00', '-8.36e+00', '1.09e+01']
Constraint losses = 1.75e-02
Relative update of tokamak psi (in plasma core): 4.87e-03
Handing off to forward solve (with updated currents).
Relative error =  4.36e-04
-----
Iteration: 44
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-8.03e-01', '-8.01e-01', '9.18e-01', '1.07e+00', '2.23e-01', '3.00e-02', '-2.04e+01', '-8.39e+00', '3.04e+00', '1.12e+01', '7.99e+00', '3.96e+01', '7.94e+00', '1.72e+00', '-7.39e+00', '-2.06e+01', '-9.76e+00', '3.79e-01', '1.18e+01', '1.21e+01', '3.99e+01', '9.05e+00', '5.32e+00', '-6.44e+00']
Constraint losses = 4.17e-03
Relative update of tokamak psi (in plasma core): 3.75e-03
Handing off to forward solve (with updated currents).
Relative error =  3.70e-04
-----
Iteration: 45
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['1.00e+00', '1.00e+00', '-1.10e+00', '-1.20e+00', '-2.28e-01', '-1.74e-01', '2.54e+01', '1.15e+01', '-2.73e+00', '-1.52e+01', '-1.29e+01', '-4.41e+01', '-6.71e+00', '-5.45e+00', '8.59e+00', '2.54e+01', '1.23e+01', '-3.09e-02', '-1.40e+01', '-1.45e+01', '-4.50e+01', '-9.04e+00', '-6.12e+00', '8.60e+00']
Constraint losses = 1.26e-02
Relative update of tokamak psi (in plasma core): 4.19e-03
Handing off to forward solve (with updated currents).
Relative error =  4.62e-04
-----
Iteration: 46
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-9.93e-01', '-9.94e-01', '1.08e+00', '1.12e+00', '1.90e-01', '2.62e-01', '-2.41e+01', '-1.14e+01', '2.60e+00', '1.63e+01', '1.48e+01', '4.09e+01', '4.92e+00', '7.51e+00', '-8.21e+00', '-2.37e+01', '-1.11e+01', '-2.71e-01', '1.08e+01', '1.09e+01', '4.34e+01', '1.08e+01', '4.29e+00', '-6.15e+00']
Constraint losses = 5.97e-03
Relative update of tokamak psi (in plasma core): 3.88e-03
Handing off to forward solve (with updated currents).
Relative error =  2.66e-04
-----
Iteration: 47
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['8.72e-01', '8.71e-01', '-9.57e-01', '-1.05e+00', '-2.05e-01', '-1.48e-01', '2.17e+01', '9.78e+00', '-2.43e+00', '-1.30e+01', '-1.09e+01', '-3.84e+01', '-6.13e+00', '-4.57e+00', '7.28e+00', '2.17e+01', '1.04e+01', '-1.46e-02', '-1.17e+01', '-1.21e+01', '-3.93e+01', '-8.42e+00', '-5.20e+00', '6.88e+00']
Constraint losses = 1.12e-02
Relative update of tokamak psi (in plasma core): 3.70e-03
Handing off to forward solve (with updated currents).
Relative error =  2.60e-04
-----
Iteration: 48
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['-8.58e-01', '-8.59e-01', '9.37e-01', '1.00e+00', '1.85e-01', '1.80e-01', '-2.15e+01', '-1.00e+01', '2.73e+00', '1.48e+01', '1.30e+01', '3.62e+01', '3.82e+00', '5.94e+00', '-8.34e+00', '-2.12e+01', '-1.01e+01', '-3.68e-01', '9.64e+00', '9.92e+00', '3.87e+01', '9.58e+00', '4.14e+00', '-5.32e+00']
Constraint losses = 4.92e-03
Relative update of tokamak psi (in plasma core): 3.42e-03
Handing off to forward solve (with updated currents).
Relative error =  3.38e-04
-----
Iteration: 49
Using simplified Green's Jacobian (of constraints wrt coil currents) to optimise the currents.
Change in coil currents (being controlled): ['7.89e-01', '7.89e-01', '-8.45e-01', '-9.05e-01', '-1.82e-01', '-1.73e-01', '1.93e+01', '8.99e+00', '-2.13e+00', '-1.26e+01', '-1.11e+01', '-3.27e+01', '-4.08e+00', '-5.26e+00', '6.77e+00', '1.91e+01', '9.16e+00', '3.26e-01', '-9.23e+00', '-9.70e+00', '-3.43e+01', '-8.00e+00', '-4.26e+00', '5.14e+00']
Constraint losses = 1.02e-02
Relative update of tokamak psi (in plasma core): 3.17e-03
Handing off to forward solve (with updated currents).
Relative error =  5.54e-04
-----
Inverse static solve DID NOT CONVERGE. Tolerance 5.54e-04 (vs. requested 0.0005) reached in 50/50 iterations.
# refine with a forward solve (now the currents are known)
GSStaticSolver.solve(eq=eq, 
                     profiles=profiles, 
                     constrain=None, 
                     target_relative_tolerance=1e-9,
                     verbose=False, # suppress output
                     )
Forward static solve DID NOT CONVERGE. Tolerance 7.09e-05 (vs. requested 1.00e-09) reached in 100/100 iterations.
fig, ax = plt.subplots(figsize=(8, 10), dpi=80)

ax.grid(zorder=0, alpha=0.75)
ax.set_aspect("equal")
eq.tokamak.plot(axis=ax, show=False)  # plots the active coils and passive structures
eq.plot(axis=ax, show=False)          # plots the equilibrium
constrain.plot(axis=ax, show=False)   # plots the constraints
ax.plot(tokamak.limiter.R, tokamak.limiter.Z, "k-", linewidth=1.2)  # plots the limiter
ax.set_xlabel(r"Major radius, $R$ [m]")
ax.set_ylabel(r"Height, $Z$ [m]")
Text(0, 0.5, 'Height, $Z$ [m]')
../_images/dec0ce37f855760fc8163f49d47d0fb3fed2f053357d8d4b9aa20334ff983a3f.png
eq.tokamak.getCurrents()
{'OH0': np.float64(-71.29094955019433),
 'OH1': np.float64(-71.24491615552297),
 'OH2': np.float64(-30.13372287327493),
 'OH3': np.float64(-27.828032891164383),
 'OH4': np.float64(58.96799756090262),
 'OH5': np.float64(69.85338146577105),
 'PF6': np.float64(-1907.046305355562),
 'PF7': np.float64(-1787.9281143916767),
 'PF8': np.float64(-773.3281637974379),
 'PF9': np.float64(1774.0629349562735),
 'PF10': np.float64(2772.669907194681),
 'PF11': np.float64(-3200.429346368807),
 'PF12': np.float64(-3236.7790847084993),
 'PF13': np.float64(2350.598065482116),
 'PF14': np.float64(-843.3367632460836),
 'PF15': np.float64(-1889.3975296825529),
 'PF16': np.float64(-1788.5290040782347),
 'PF17': np.float64(-1027.8515800438256),
 'PF18': np.float64(1543.1235151471883),
 'PF19': np.float64(2960.1707739271424),
 'PF20': np.float64(-3158.2192548425437),
 'PF21': np.float64(-3233.313765156471),
 'PF22': np.float64(2326.156784155284),
 'PF23': np.float64(-1348.7521866199154),
 'VS0': np.float64(0.0),
 'VS1': np.float64(0.0),
 'VS2': np.float64(0.0),
 'VS3': np.float64(0.0),
 'VS4': np.float64(0.0),
 'VS5': np.float64(0.0),
 'VS6': np.float64(0.0),
 'VS7': np.float64(0.0),
 'VS8': np.float64(0.0),
 'VS9': np.float64(0.0),
 'VS10': np.float64(0.0),
 'VS11': np.float64(0.0),
 'VS12': np.float64(0.0),
 'VS13': np.float64(0.0),
 'VS14': np.float64(0.0),
 'VS15': np.float64(0.0),
 'VS16': np.float64(0.0),
 'VS17': np.float64(0.0),
 'VS18': np.float64(0.0),
 'VS19': np.float64(0.0),
 'VS20': np.float64(0.0),
 'VS21': np.float64(0.0),
 'VS22': np.float64(0.0),
 'VS23': np.float64(0.0)}