Skip to content

update star dxh star pointer for solver when editing lnR - #1115

Merged
Debraheem merged 1 commit into
mainfrom
EbF/bugfix/update_dxh_lnR_in_solver
Nov 17, 2026
Merged

Debraheem merged 1 commit into
mainfrom
EbF/bugfix/update_dxh_lnR_in_solver

Conversation

@Debraheem

@Debraheem Debraheem commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Copy the reconstructed change in lnR to dxh_lnR so the radius equation evaluates the same displacement as the solver state. MESA was previously evaluating the radius residual and its derivative using the values stored before edit_lnR reconstructed the radius.

Generally, this appears to lower radius residuals in models with u and v flag, helping models converge. Hard to know how big of a change without detailed testing, but it should provide a minor boost to convergence in hydro models.

In my TDC Cepheid 9M test, this single change substantially reduced the radius residuals, however this model relies on hydro heavily, so the impact is more extreme .

I ran both of these models on a single core/thread on my M1-max macbook.

Metric Without fix With fix
Accepted steps 19,980 19,980
Total Newton iterations 88,351 81,201
Mean Newton iterations per step 4.42 4.06
Retries 0 0
Median peak radius residual after iteration 2 7.73 x 10^-7 1.24 x 10^-11
Median peak radius residual at acceptance, using the reconstructed radius 1.50 x 10^-12 3.18 x 10^-13
Wall time 19 min 29 s 18 min 44 s
radius_residual_comparison

Copy the reconstructed change in lnR to dxh_lnR so the radius equation evaluates the same displacement as the solver state.
@Debraheem Debraheem added bug Something isn't working solver hydrodynamics labels Nov 12, 2026
@Debraheem

Copy link
Copy Markdown
Member Author

I believe this mistake was introduced somewhere in svn between r12778 and r15140(has this issue) during a refactor.

@Debraheem
Debraheem merged commit 1ea6abd into main Nov 17, 2026
5 checks passed
Debraheem added a commit that referenced this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working hydrodynamics solver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant