Skip to content

Equilibrium solve on a canvas of dual numbers - #53

Merged
tomneiser merged 7 commits into
masterfrom
forward-ad-plasma
Nov 15, 2026
Merged

tomneiser merged 7 commits into
masterfrom
forward-ad-plasma

Conversation

@tomneiser

@tomneiser tomneiser commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Equilibrium solve on a canvas of dual numbers, so that FRESCO can sit inside a forward-mode AD chain (ForwardDiff). The Picard iterations carry the derivatives directly.

Dependencies: requires IMAS 7.5 and VacuumFields 6.3 (both released). The new test uses IMAS.retype / IMAS.seed and the element-type generic control matrices from VacuumFields.

Changes

  • Canvas takes the grid-range type as a parameter (RG<:AbstractRange{T}). Float64 grids stay StepRangeLen; a canvas of dual numbers uses whatever range returns. The Canvas(dd, Rs, Zs, ...) constructors accept any AbstractRange.
  • Profile scales in the profile's number type. PprimeFFprime, PressureJtoR and PressureJt get a type parameter S for ffp_scale / J_scale (was Float64). The default scale is one in the number type that the interpolant returns.
  • Element-type generic defaults: λ_regularize and the control offset vector follow the element type of the canvas.

Compatibility

Adding type parameters to Canvas and the three profile types breaks code that spells out their full parameter list. I found none in FUSE or IMAS. Constructors and field access are unchanged, and Float64 results are unchanged. A minor release (0.8) seems appropriate.

Note on the version

The branch starts from the v0.7.4 release commit (3fecc21), which is not on master. Master has its own 0.7.4 bump, so after merging master the version is unchanged.

Tests

New test/runtests_dual.jl: an equilibrium solve on a canvas of dual numbers against finite differences. Pkg.test() passes in CI (Julia 1.x) against the registered releases.

Part of a set with ProjectTorreyPines/FUSE.jl#1226, which tests the whole stack in its CI.

🤖 Generated with Claude Code

jmcclena and others added 5 commits August 9, 2026 22:39
… on dual numbers

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…mber type, element-type generic defaults

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fferences

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Conflict in flux_bounds!: master removed the try/catch with the diagnostic
plot, so the guard that skipped that plot for dual numbers is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tomneiser and others added 2 commits November 14, 2026 11:32
Dual-number support in the coil and control routines is available from that release.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@tomneiser
tomneiser marked this pull request as ready for review November 15, 2026 13:28
@tomneiser
tomneiser merged commit 168b41d into master Nov 15, 2026
2 checks passed
@tomneiser
tomneiser deleted the forward-ad-plasma branch November 15, 2026 16:20
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.

2 participants