GPEC — Generalized Perturbed Equilibrium Code

GPEC is a Julia implementation of the GPEC suite for magnetohydrodynamic (MHD) analysis of fusion plasmas. It performs a three-stage analysis pipeline:

  1. 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.
  2. 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.
  3. 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.

Quick Start

GPEC is configured via a gpec.toml file. To run an analysis on a directory containing that file:

./gpec path/to/directory

To use GPEC programmatically from Julia:

using GeneralizedPerturbedEquilibrium
GeneralizedPerturbedEquilibrium.main(["path/to/directory"])

See Setup for full installation instructions.

Contributing

The Git workflow, commit message conventions, and the regression-testing harness are documented in the Developer Notes.

Overview

Documentation

  • Setup — Installation instructions for macOS and Windows (WSL)
  • Workflow — Full pipeline description: inputs, outputs, and key physics per module
  • API Reference — Detailed function and type documentation for each module
  • Citations — Papers underpinning GPEC's algorithms
  • Developer Notes — Git workflow, commit conventions, and the regression-testing harness

Contact

GPEC is developed and maintained by Nikolas Logan (ncl2128@columbia.edu) and Jong-Kyu Park (jkpark@snu.ac.kr) as lead developers.

New users and developers are warmly encouraged to reach out — whether you have questions about running GPEC, want to discuss the physics, or are interested in contributing or collaborating, please get in touch.

For bug reports and feature requests, please open an issue on the GitHub repository.