GPEC is a Julia implementation of the GPEC suite for magnetohydrodynamic (MHD) analysis of fusion plasmas. It performs a three-stage analysis pipeline:
- Equilibrium reconstruction from experimental data (EFIT, CHEASE) or analytical models — solves the Grad-Shafranov equation, computes flux surfaces, safety factor q(ψ), and builds field quantity splines.
- Ideal MHD stability analysis via Newcomb's criterion (DCON-style ODE integration) — identifies singular surfaces where q = m/n, computes force-free eigenfunctions ξ(ψ,θ), evaluates the tearing stability parameter Δ' at each rational surface, and checks fixed/free boundary stability.
- Perturbed equilibrium — quantifies the self-consistent plasma response to external magnetic perturbations (RMPs, error fields, correction coils). Key outputs include resonant flux, island half-widths, and the Chirikov overlap parameter — the principal diagnostics for ELM suppression, error field correction, and disruption avoidance.
Full documentation: https://openfusiontoolkit.github.io/GPEC/dev/
GPEC is configured via a gpec.toml file. To run an analysis on a directory containing that file:
./gpec path/to/directoryTo use GPEC programmatically from Julia:
using GeneralizedPerturbedEquilibrium
GeneralizedPerturbedEquilibrium.main(["path/to/directory"])See Setup for full installation instructions.
The Git workflow, commit message conventions, and the regression-testing harness are documented in the Developer Notes.