Skip to content

fix derivatives in EOS inversion - #1142

Merged
Debraheem merged 6 commits into
mainfrom
MZ/fix_eos_iteration
Dec 3, 2026
Merged

Debraheem merged 6 commits into
mainfrom
MZ/fix_eos_iteration

Conversation

@zingale

@zingale zingale commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

There are 2 places where the conversion from ln to log10 was incorrect:

  • in the egas as input, both of the d/dln* derivatives need the ln10 scaling
  • when log10(P) is input, then the ln10 factor in the numerator and denominator should cancel

Making this change, the number of EOS calls in the test suite case goes from 14 -> 4.

It seems like the log10(P) input is used in the RSP code and time-dependent convection. I don't
think the egas input is widely used.

I've added the number of EOS calls to the test output so it is easy to see the performance difference.

@zingale
zingale requested a review from fxt44 as a code owner November 27, 2026 18:06
@zingale zingale added the eos Equation of state module label Nov 27, 2026
@Debraheem

Copy link
Copy Markdown
Member

@VincentVanlaer might be related to the pre-ms eos inversion issues you found?

@VincentVanlaer

Copy link
Copy Markdown
Member

That wasn't an issue in the derivatives, but the values itself

@Debraheem
Debraheem merged commit ae5a202 into main Dec 3, 2026
8 checks passed
@zingale
zingale deleted the MZ/fix_eos_iteration branch December 3, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eos Equation of state module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants