Skip to content

Core routines improvements - #20

Merged
georgeholt1 merged 44 commits into
mainfrom
core_routine_improv
Jul 29, 2025
Merged

Core routines improvements#20
georgeholt1 merged 44 commits into
mainfrom
core_routine_improv

Conversation

@nicamo

@nicamo nicamo commented Jun 4, 2025

Copy link
Copy Markdown
Contributor
  • Simplified and improved the way psi_boundary is identified for limiter plasmas.
  • Added new algorithm to identify the plasma domain that does not rely on the default routines in critical. This is more expensive and currently only gets triggered when the default routines fail
  • Removed reliance on the Givens rotations in the NK solver, as those did not allow for regularization. Introduced regularization specifically for collinear terms.
  • The regularization coefficients can now be fixed for each solver (static and dynamic) independently. This requires a small change to the API of the "stepping" object, which now needs to be provided with a static solver object (rather than instantiating its own like before)
  • Fixed the change-of-basis procedure in the mode decomposition procedure

@nicamo
nicamo requested a review from kpentland June 19, 2025 09:27
@kpentland

Copy link
Copy Markdown
Collaborator

This PR looks good - I've made a few minor updates myself:

We have added a new example notebook (number 10) on how to compute vertical instability timescales/growth rates and the associated quantities of an equilibrium. In particular, we:

  • explain how FreeGSNKE calculates the deformable growth rate for a given plasma equilibrium.
  • demonstrate different ways to visualise and plot (un)stable modes, Jacobian matrices, and how the plasma deforms under an unstable mode.
  • explain how to calculate the deformable) inductive stability margin parameter (from Portone).
  • explain how to calculate rigid (non-deformable) metrics such as the Leuer parameter (e.g. ratio of stabilisng to to destabilising metal forces).
  • explain how to use different options to decompose (i.e. omit high-freq) passive structure modes (saving runtime).

We have also stabilised these growth rate calculations by:

  • squashing a bug that was returning multiple unstable modes under some parameter combinations.
  • removed some numy.linalg.inv calculations (with numpy.linalg.solve) that were likely leading to numerical issues/instabilities.

We have also re-numbered the examples to account for the fact there are now over ten!

@kpentland kpentland left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm happy with the changes we've made here - ready to merge.

@kpentland kpentland added bug Something isn't working enhancement New feature or request labels Jun 21, 2025
@georgeholt1 georgeholt1 added the ready-for-final-tests Pull request is ready to run final pre-merge tests label Jul 15, 2025
@georgeholt1 georgeholt1 added ready-for-final-tests Pull request is ready to run final pre-merge tests and removed ready-for-final-tests Pull request is ready to run final pre-merge tests labels Jul 29, 2025
@georgeholt1 georgeholt1 added ready-for-final-tests Pull request is ready to run final pre-merge tests and removed ready-for-final-tests Pull request is ready to run final pre-merge tests labels Jul 29, 2025
@georgeholt1
georgeholt1 merged commit 1d4513b into main Jul 29, 2025
2 checks passed
@georgeholt1
georgeholt1 deleted the core_routine_improv branch July 29, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request ready-for-final-tests Pull request is ready to run final pre-merge tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants