Skip to content

Allow arbitrary initial psi estimates#52

Merged
georgeholt1 merged 10 commits into
FusionComputingLab:mainfrom
timothy-nunn:new-initial-psi
Apr 10, 2026
Merged

Allow arbitrary initial psi estimates#52
georgeholt1 merged 10 commits into
FusionComputingLab:mainfrom
timothy-nunn:new-initial-psi

Conversation

@timothy-nunn
Copy link
Copy Markdown
Contributor

@timothy-nunn timothy-nunn commented Feb 9, 2026

Enables arbitrary initial psi estimates by providing a callable to (Equilibrium(..., psi=<some callable>)). The default behaviour remains unchanged where a Gaussian guess is used (now implemented in PsiGuessGaussian). Implemented a class to initialise psi from a parabolic Jtor assumption PsiGuessParabolicJtor (A.7 of Wai et al (2026))

Here is how the new initial psi guess compares to the default Gaussian:
image
image

The following slides show that, in this case, the initial guess does not have a large impact on the solvers ability to find a good solution. However, in some more complex equilibria this psi guess will be more favourable.
image
image

@kpentland kpentland self-assigned this Mar 3, 2026
@kpentland kpentland added the enhancement New feature or request label Mar 3, 2026
@kpentland kpentland self-requested a review March 3, 2026 14:01
Copy link
Copy Markdown
Collaborator

@kpentland kpentland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great @timothy-nunn!

Can you remind me what the purpose was for having this alternate guess? Different options are always good I suppose, especially when you can input your approximate boundary and Ip estimate.

On a similar vein, could you show a plot(s) of the existing default guess (for one of the examples in FreeGSNKE) and then the same guess using your new Jtor function? If possible can you plot psi_plasma and jtor for each one? It's hard to gauge what the new function is doing without seeing it.

It would be great to get some examples of this in action in FreeGSNKE. Maybe we make another notebook showing these plots and how it works for both forward and inverse solves?

Comment thread freegs4e/equilibrium.py Outdated
Comment thread freegs4e/equilibrium.py
Comment thread freegs4e/equilibrium.py
Comment thread freegs4e/equilibrium.py
Comment thread freegs4e/equilibrium.py Outdated
@kpentland
Copy link
Copy Markdown
Collaborator

kpentland commented Apr 1, 2026

All looking good @timothy-nunn, I'm happy to merge but perhaps we can make an example of how to use it in FreeGSNKE? Perhaps we could split the Example02 notebook into Example02a and 02b? We can show how to use this in 02b and any other more advanced features we come up with down the line? We can even check what effect this new guess has on the number of NK iterations taken until convergence...

Ready to go whenever you're happy @georgeholt1 !

@timothy-nunn
Copy link
Copy Markdown
Contributor Author

All looking good @timothy-nunn, I'm happy to merge but perhaps we can make an example of how to use it in FreeGSNKE? Perhaps we could split the Example02 notebook into Example02a and 02b? We can show how to use this in 02b and any other more advanced features we come up with down the line? We can even check what effect this new guess has on the number of NK iterations taken until convergence...

Ready to go whenever you're happy @georgeholt1 !

Hi @kpentland will do. My tests don't show any significant difference in convergence for Example 1 in FreeGSNKE

@georgeholt1 georgeholt1 merged commit 5b6cf06 into FusionComputingLab:main Apr 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants