Analysis Module

The Analysis module provides post-processing and visualization utilities for GPEC simulation outputs.

Submodules

  • ForceFreeStates: Plotting functions for DCON-style ideal MHD stability results
  • Equilibrium: Plotting functions for equilibrium objects
GeneralizedPerturbedEquilibrium.AnalysisModule
Analysis

Post-processing and visualization utilities for GPEC simulation outputs.

Submodules

  • ForceFreeStates: Plotting functions for DCON-style ideal MHD stability results
  • Equilibrium: Plotting functions for equilibrium objects
source

ForceFreeStates

GeneralizedPerturbedEquilibrium.Analysis.ForceFreeStates.plot_eigenmode_summaryMethod
plot_eigenmode_summary(h5path; save_path=nothing)

Three-panel summary of the free-boundary energy matrix eigenmodes, analogous to the DCON summary plot produced by OMFIT GPEC.

Panels:

  • Top: |eigenvector| vs index for the least stable mode
  • Bottom-left: heatmap of |W_t| (eigenvectors) vs mode index
  • Bottom-right: |eigenvalue| on log scale vs mode index

Eigenvectors are scaled by χ₁ = 2π ψ₀ × 10⁻³ to match GPEC conventions.

Arguments

  • h5path: Path to a GPEC HDF5 output file with vacuum data (vac_flag = true)

Keyword arguments

  • save_path: If provided, save the figure to this path (default: nothing)

Returns

A Plots.jl plot object.

source
GeneralizedPerturbedEquilibrium.Analysis.ForceFreeStates.plot_mode_displacementMethod
plot_mode_displacement(h5path; modes=1:5, save_path=nothing)

Plot Im(ξψ) vs ψN for the least stable eigenmode, showing one curve per requested poloidal mode number m.

Arguments

  • h5path: Path to a GPEC HDF5 output file (e.g. "gpec.h5")

Keyword arguments

  • modes: Iterable of m values to plot (default: 1:5)
  • save_path: If provided, save the figure to this path (default: nothing)

Returns

A Plots.jl plot object.

source
GeneralizedPerturbedEquilibrium.Analysis.ForceFreeStates.plot_stability_criterionMethod
plot_stability_criterion(h5path; save_path=nothing)

Plot the stability criterion (smallest eigenvalue of W⁻¹, crit) vs ψ_N. A sign change in crit during integration indicates an ideal fixed-boundary instability.

Arguments

  • h5path: Path to a GPEC HDF5 output file

Keyword arguments

  • save_path: If provided, save the figure to this path (default: nothing)

Returns

A Plots.jl plot object.

source

Equilibrium

GeneralizedPerturbedEquilibrium.Analysis.Equilibrium.plot_flux_surfacesMethod
plot_flux_surfaces(plasma_eq; n_psi=11, n_theta=13)

Plot flux surface contours (constant ψ, blue) and field-line angle contours (constant θ, red) in physical (R, Z) space.

Arguments

  • plasma_eq: A GeneralizedPerturbedEquilibrium.Equilibrium.PlasmaEquilibrium object

Keyword arguments

  • n_psi: Number of constant-ψ contours to draw (default: 11)
  • n_theta: Number of constant-θ contours to draw (default: 13)

Returns

A Plots.jl plot object.

source