Skip to content

Implementation of beta fixed point solve, based on Jon M work. - #4640

Open
grmtrkngtn wants to merge 1 commit into
mainfrom
4637-replace-the-iterative-idempotence-treatment-of-plasma-beta-with-an-explicit-fixed-point-calculation
Open

grmtrkngtn wants to merge 1 commit into
mainfrom
4637-replace-the-iterative-idempotence-treatment-of-plasma-beta-with-an-explicit-fixed-point-calculation

Conversation

@grmtrkngtn

Copy link
Copy Markdown
Collaborator

Description

This PR replaces the iterative idempotence treatment of plasma beta with an explicit fixed-point solve.

Previously, beta_total_vol_avg could be treated as optimisation iteration variable ixc = 5, with equality constraint icc = 1 enforcing consistency between the total beta and its thermal, fast-alpha and beam components. This means that one of PROCESS's internal closure relationships is effectively being solved through the optimisation problem.

The change instead solves

$$ \beta = \beta_{\mathrm{fast\ alpha}} + \beta_{\mathrm{beam}} + \beta_{\mathrm{thermal}} $$

internally using scipy.optimize.fixed_point.

The thermal beta is calculated using the existing PlasmaBeta.calculate_plasma_beta() method in process.models.physics.physics.

The fixed-point calculation is performed within Caller for each model evaluation. The trial value of beta_total_vol_avg is applied after the optimisation variables have been set, ensuring that the fixed-point value is not overwritten by set_scaled_iteration_variable().

The existing MFILE/output idempotence handling is otherwise retained.

Validation

The low_aspect_ratio_DEMO.IN.DAT case was run with ixc = 5 removed while retaining beta consistency constraint icc = 1.

The case converges to essentially the same solution as main, while constraint 1 remains satisfied with zero residual. This demonstrates that the beta closure is being provided by the internal fixed-point calculation rather than by VMCON varying beta_total_vol_avg.

As a result, beta_total_vol_avg no longer needs to be exposed to the optimiser as ixc = 5. Once the fixed-point implementation is fully adopted, icc = 1 can also be removed from the optimisation problem because the same closure is enforced internally.

@grmtrkngtn
grmtrkngtn requested a review from a team as a code owner October 1, 2026 15:30
@grmtrkngtn grmtrkngtn added the Convergence Solver or convergence-related problems label Oct 1, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.92%. Comparing base (4885172) to head (6c34f15).

Files with missing lines Patch % Lines
process/core/caller.py 25.00% 18 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4640   +/-   ##
=======================================
  Coverage   49.92%   49.92%           
=======================================
  Files         151      151           
  Lines       30236    30239    +3     
=======================================
+ Hits        15094    15098    +4     
+ Misses      15142    15141    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CoronelBuendia

Copy link
Copy Markdown
Contributor

Hmm.. this only happens when beta is used to calculate things that relate to how beta is calculated.

As far as I am aware, this was only happening in the Saamuli pedestal temperature scaling $\beta = f(T_{e,ped} = g(\beta))$ that was used for EU-DEMO, hence the constraint/Picard iteration. But this pedestal model no longer exists in open-source PROCESS.

Where is the fixed point problem now for the open-source PROCESS LAR point? I just think it's really important to identify what these "circular loops" are.

More importantly, are you sure this is a complete closure of the plasma calculation chain, or are there other fixed point issues?

@timothy-nunn timothy-nunn self-assigned this Oct 2, 2026
@timothy-nunn
timothy-nunn requested a review from a team October 5, 2026 07:52
@timothy-nunn

Copy link
Copy Markdown
Collaborator

Going to invite comments from as many @ukaea/process-model-review on this one, thanks @CoronelBuendia for already commenting. @grmtrkngtn I will do a code review once modeller questions/concerns have been answered/addressed.

@timothy-nunn timothy-nunn 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.

Does this PR not remove the need for the beta consistency equation? Why does this need to wait for another PR?

@grmtrkngtn

Copy link
Copy Markdown
Collaborator Author

Does this PR not remove the need for the beta consistency equation?

Yes, that is the primary motivation.

Why does this need to wait for another PR?

I'm not sure what you mean, it doesn't need another PR - it's independent of anything else.

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

Labels

Convergence Solver or convergence-related problems

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace the iterative idempotence treatment of plasma beta with an explicit fixed-point calculation

4 participants