Skip to content

Feature/galerkin plasma energy - #666

Draft
matt-pharr wants to merge 3 commits into
feature/analysis-plots-overhaulfrom
feature/galerkin-plasma-energy
Draft

matt-pharr wants to merge 3 commits into
feature/analysis-plots-overhaulfrom
feature/galerkin-plasma-energy

Conversation

@matt-pharr

Copy link
Copy Markdown
Collaborator

Placeholder PR for ideal/matched galerkin and matched riccati plasma energy matrices.

…ner-layer matching and publish their plasma response

Groundwork for Galerkin inner-layer matching for PE, with the abstraction changes it needs on the Galerkin,
Δ′ and matching side. Galerkin results now carry the solution, plasma energy matrix and free-boundary
energies a Forward result does, and drive the perturbed-equilibrium response.

Galerkin plasma response
- The solve records edge_response, the edge momentum FΞ′ + KΞ of every solution column, from the edge
  rows of the stiffness before the boundary conditions replace them. On the error-field (EF) columns
  (a unit edge displacement per mode, no big-solution drive) it is W_P·ψ₀² [Glasser 2016, Eq. 66];
  it agrees with Forward and Riccati to 2e-7 and converges at fourth order in nx.
- With error_field_response (renamed from rpec_flag) the EF columns are published as the ideal-closed
  solution and wp, and with vac_flag the free-boundary energies, so plasma_response accepts the result.
  Both flags now default to true. MatchProblem's ideal keyword and the [Match] ideal key are removed: the
  Galerkin solve is itself the ideal solution.
- A matched Galerkin result publishes its complex edge response W_eff = (F_EF + F_plasma·cout)/ψ₀² and
  its free-boundary energies; the anti-Hermitian part is the torque absorbed in the inner layers.
  plasma_response refuses every :matched result until matched singular coupling is defined.
- free_run takes the plasma energy matrix wp, so Forward, Galerkin and matched results share it, and
  FreeBoundaryStability/W_plasma is written from result.wp.

Δ′ payload
- DeltaPrimeData has one meaning per field: raw_freeboundary, raw_fixedboundary, ef (Δ_EF, the
  response to a unit edge displacement with the edge otherwise fixed) and the PEST-3 blocks of both
  boundaries (PEST3Blocks, from pest3_decompose). Consumers read fields, not the integrator.
- Galerkin and Riccati both compute both boundaries. Galerkin re-solves its big-solution columns with
  the vacuum edge for the free-boundary Δ′ (free_boundary_delta_prime, default true); Riccati takes the
  fixed-boundary Δ′ and Δ_EF from one Dirichlet-edge BVP and gains the same error_field_response flag.
- With error_field_response the Galerkin tearing Δ′ was the fixed-boundary one; it is now free-boundary.
- Matching pairs Δ_EF with raw_fixedboundary. Riccati paired it with its free-boundary Δ′, which gave
  matched coefficients and bpen wrong by order one at low rotation (4% at 1 kHz on the LAR deck); they
  now agree with Galerkin to ~1e-3. The [Match] deck guard checks error_field_response alone.
- TearingProblem takes fixed_boundary=true for the fixed-boundary Δ′ (a conformal wall on the plasma);
  tearing refuses a result that lacks the requested boundary instead of falling back to a stub.

Renames (clean break)
- [Galerkin] rpec_flag → error_field_response; Delta_coil → Delta_EF (DeltaPrimeData.ef,
  SingularSurfaces/Delta_EF); MatchResult.rpec_eig → forced_eigenvalue (Match/forced_eigenvalue).
- SingularSurfaces/Delta_prime_raw → Delta_prime_raw_freeboundary, plus Delta_prime_raw_fixedboundary
  and the *_fixedboundary PEST-3 blocks; Riccati now also writes pest3_A/B/Gamma.
- Harness cases diiid_n1_riccati and gal_resistive_diiid follow the new paths and track the
  fixed-boundary Δ′ diagonal.
@matt-pharr matt-pharr self-assigned this Nov 9, 2026
@matt-pharr
matt-pharr added this pull request to stack #651 November 9, 2026 14:23
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

This pull request is missing a reviewer.

If you are not ready to name them, mark this pull request as a draft.
docs/development/contributors.md suggests lead developers to ask.
Merging is not blocked here, but no pull request may be merged without human review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant