Skip to content

Fix Ge qCrit interpolation - #1486

Merged
ilyamandel merged 2 commits into
TeamCOMPAS:devfrom
Dylan-Hebrail:fix-issue-1484-Ge-qcrit
Sep 24, 2026
Merged

ilyamandel merged 2 commits into
TeamCOMPAS:devfrom
Dylan-Hebrail:fix-issue-1484-Ge-qcrit

Conversation

@Dylan-Hebrail

Copy link
Copy Markdown
Contributor

This fixes the interpolation in MainSequence::InterpolateGeEtAlQCrit(), addressing both problems presented in #1484.

The radius and mass interpolation factors used (upper - x) / (upper - lower), which reversed the interpolation. These are changed to (x - lower) / (upper - lower).

The beta interpolation selected the beta interval [0, 0.5] or [0.5, 1], but used the global beta value as the interpolation factor. This change rescales beta locally within the selected interval before interpolating.

The modified code builds successfully using Clang on macOS. I tested it by producing the same plot as shown in Issue #1484, it now looks like this:
image

The change removed the sawtooth aspect matching the grid points.

Addresses #1484.

@ilyamandel ilyamandel 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.

Hi @Dylan-Hebrail ,
This looks great, thank you so much for doing this (and sorry for the very late response -- took me a long time to catch up after travelling).
Just one request: could you please also update changelog.h to assign this a new version number and a brief comment?

@reinhold-willcox

Copy link
Copy Markdown
Collaborator

Looks good! Could you also make the identical fixes to the relevant parts of the HeMS file?

@Dylan-Hebrail

Copy link
Copy Markdown
Contributor Author

Hi @ilyamandel, @reinhold-willcox,

I updated the PR with your requests! In HeMS, the relevant function only interpolates for R and M so I changed only these two interpolation factors.

@jeffriley jeffriley 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.

All good from me. Thanks Dylan!

@ilyamandel ilyamandel 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.

Thank you, @Dylan-Hebrail !

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.

4 participants