Skip to content

PE toroidal torque nonzero for ideal-MHD runs — track imag/real ratio as a Hermiticity check #333

Description

@logan-nc

Summary

perturbed_equilibrium/energies/toroidal_torque is nonzero (~0.7% of the plasma energy) for ideal-MHD runs, where it should be identically zero. It should be tracked as a Hermiticity diagnostic rather than as a physical torque.

Physics

In src/PerturbedEquilibrium/Response.jl:107:

state.toroidal_torque = -2 * nn * imag(py)      # py = ⟨Φ_resp, Λ⁻¹·Φ_resp⟩ / 4

The torque is the imaginary part of the plasma-energy quadratic form, which is nonzero only if the plasma inductance Λ has a nonzero anti-Hermitian part (see the comment at Response.jl:54). In pure ideal MHD the energy principle is self-adjoint → δW real → Λ Hermitian → imag(py) = 0 → torque ≡ 0. A real toroidal torque arises only from the drift-kinetic dissipation added to the Euler–Lagrange operator when kinetic_factor > 0.

Observation

The diiid_n1 case is a pure ideal run (kinetic_source = "fixed", kinetic_factor = 0.0), yet reports toroidal_torque ≈ ±0.05. With plasma_energy = real(py) ≈ 3.4 J, that is |imag(py)/real(py)| ≈ 0.7% — residual numerical anti-Hermiticity in the computed ideal Λ (vacuum grri/grre coupling, the BVP solve, spline error, possibly reg_spot), not physics.

Evidence it is numerical noise: during #313 a grid change (removing the Δ′ knot ladder) flipped its sign at unchanged magnitude (−0.051 → +0.051) — a near-zero quantity whose sign is numerically ill-defined.

Suggested fix (harness)

regression-harness/cases/diiid_n1.toml ([quantities.pe_toroidal_torque], ~L342) currently has noise_threshold = 1e-12, so it tracks ~0.7% numerical noise and reports grid perturbations as large percentage swings. For ideal runs, track the ratio |imag(py)/real(py)| as a Hermiticity check with a physically meaningful floor (e.g. 1e-2), rather than the raw torque. This turns a noisy tracked value into a genuine correctness invariant (ideal Λ should be Hermitian to within tolerance).

Optional (code)

Consider zeroing toroidal_torque (or Hermitian-projecting Λ) when kinetic_factor == 0, and/or documenting the field as a Hermiticity diagnostic in the ideal regime.

References

  • src/PerturbedEquilibrium/Response.jl:54,99-107
  • regression-harness/cases/diiid_n1.toml:342-348

Surfaced during review of #313.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions