Skip to content

[enhancement] HMS+HMS Mergers rejuvenation according to Schneider+2016#788

Open
ezapartas wants to merge 15 commits into
v2.3from
dimitris_masos_MSMSmergers_rejuvenation_averageX
Open

[enhancement] HMS+HMS Mergers rejuvenation according to Schneider+2016#788
ezapartas wants to merge 15 commits into
v2.3from
dimitris_masos_MSMSmergers_rejuvenation_averageX

Conversation

@ezapartas

@ezapartas ezapartas commented Jan 16, 2026

Copy link
Copy Markdown
Contributor
  • This PR is changing the default option in the POSYDON .ini file of HMS_HMS_merging_rejuvenation = True to stronger rejuvenation of MS+MS mergers (according to Glebbeek+2023, Schneider+2016, following the recent Wang+2025 too). So it should be considered a change in POSYDON results for few types mergers

-This PR includes already the changes in #785 and builds on it. If accepted, that PR becomes unnecessary

…d the possibility to match with total_mass_h1
@ezapartas ezapartas marked this pull request as draft January 16, 2026 06:55
@ezapartas

Copy link
Copy Markdown
Contributor Author

With @dimsour94 we tested it with various options run.

@ezapartas ezapartas marked this pull request as ready for review January 24, 2026 10:11
added the options and default values of of rel_mass_lost_HMS_HMS and HMS_HMS_merging_rejuvenation in the .ini file of the population.
@maxbriel maxbriel changed the base branch from main to v2.3 February 10, 2026 08:21
@maxbriel maxbriel changed the title HMS+HMS Mergers rejuvenation according to Schneider+2016 [enhancement] HMS+HMS Mergers rejuvenation according to Schneider+2016 Feb 10, 2026
@maxbriel maxbriel added the enhancement New feature or request label Feb 10, 2026
@maxbriel maxbriel added this to the v2.3 milestone Feb 13, 2026
Comment thread posydon/popsyn/population_params_default.ini Outdated
@sgossage

sgossage commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

We should merge PR#785 into main, then main into v2.3, then into this branch to incorporate the latest changes from PR#785, main, and v2.3.

4/23/26: I went ahead and merged v2.3 (which contains PR#785) into this.

@sgossage

sgossage commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

We should update the docs here with these changes.

4/24/26: I added some updates to the docs


merged_star.mass = (star_base.mass + comp.mass) * (1.-rel_mass_lost_HMS_HMS)

X_average_merged = (star_base.total_mass_h1 + comp.total_mass_h1 - (1.-rel_mass_lost_HMS_HMS) * X_initial) / merged_star.mass

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.

Are you sure these equations are correct?

$$ \left< X \right> = (M_{H,1} + M_{H,2} - (1-\phi)X_0)/M_\mathrm{merged} $$

The $(1-\phi)X_0$ part does not have any units, but is divided by mass... This is different than what's mentioned in Schneider+2016 on p2357:

$$ \left< X \right> = (M_{H,1} + M_{H,2} - \phi(M_1+M_2)X_0)/M_\mathrm{merged} $$

This is the same with the Y_average_merged.

Suggested change
X_average_merged = (star_base.total_mass_h1 + comp.total_mass_h1 - (1.-rel_mass_lost_HMS_HMS) * X_initial) / merged_star.mass
X_average_merged = (star_base.total_mass_h1 + comp.total_mass_h1 - (rel_mass_lost_HMS_HMS *(star_base.mass + comp.mass)* X_initial)) / merged_star.mass

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@maxbriel I think you are right. Thanks for catching this! @dimsour94 can you confirm?

mass_weight2='mass'))

# The change of masses occurs after the calculation of weighted averages
merged_star.mass = (star_base.mass + comp.mass) * (1.-self.rel_mass_lost_HMS_HMS)

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.

This line needs to be edited. It uses self.rel_mass_lost_HMS_HMS, which is set to a string in the rejuvenated case. This will fail.

Either move this inside the else statement or make sure it's compatible with the rejuvenated case.

# first we calculate the mass loss percentage:
if self.rel_mass_lost_HMS_HMS == "Glebbeek+2013":
# Eq. 4 of Glebbeek+2013
rel_mass_lost_HMS_HMS = (0.3 * q) / ((1.0 + q) ** 2.0)

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.

If rel_mass_lost_HMS_HMS is set to a string, self.rel_mass_lost_HMS_HMS will also become a string. Since you're using rel_mass_lost_HMS_HMS variable later without the self, it's okay, but the original code uses and expects self.rel_mass_lost_HMS_HMS as a float. This should be edited to account for!

merged_star.mass = (star_base.mass + comp.mass) * (1.-rel_mass_lost_HMS_HMS)

X_average_merged = (star_base.total_mass_h1 + comp.total_mass_h1 - (1.-rel_mass_lost_HMS_HMS) * X_initial) / merged_star.mass
Y_average_merged = (star_base.total_mass_he4 + comp.total_mass_he4 - (1.-rel_mass_lost_HMS_HMS) * Y_initial) / merged_star.mass

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.

Same issue as with X_average_merged

merged_star.center_he4 = Y_average_merged
merged_star.surface_he4 = Y_average_merged

for key in STARPROPERTIES:

@maxbriel maxbriel May 7, 2026

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.

What would you like to happen to the surface abundances: " c12", "n14", and "o16"?


# The change of masses occurs after the calculation of weighted averages
merged_star.mass = (star_base.mass + comp.mass) * (1.-self.rel_mass_lost_HMS_HMS)
merged_star.total_mass_h1 = merged_star.center_h1 * merged_star.mass

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.

You've already set the total_mass_h1 in the rejuvenated case. This will always overwrite that value here. Should this be moved inside the else block?

Comment on lines +269 to +271
# Not used?
#X_average1 = star_base.total_mass_h1 / star_base.mass
#X_average2 = comp.total_mass_h1 / comp.mass

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.

Remove comments

merged_star.surface_he4 = Y_average_merged

for key in STARPROPERTIES:
# these stellar attributes become np.nan

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.

Shift comment to correct indentation

Suggested change
# these stellar attributes become np.nan
# these stellar attributes become np.nan

#X_average1 = star_base.total_mass_h1 / star_base.mass
#X_average2 = comp.total_mass_h1 / comp.mass

Z_div_Zsun_init = star_base.metallicity

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.

Are there other variables you want/need to check that they exists?

@maxbriel

maxbriel commented May 7, 2026

Copy link
Copy Markdown
Collaborator

@ezapartas @dimsour94 I've reviewed the PR and you will need to verify a few things in the implementation, because it currently brakes some of the other evolution. Furthermore, it seems that the average abundances equations are not the same as in Schneider+2016.

We can probably work through it with/for you, if you're okay with the suggested changes.

Currently causes binary candidates to fail in our dev-tools suite.

@maxbriel

maxbriel commented May 7, 2026

Copy link
Copy Markdown
Collaborator

In the old test suite, binary 4 fails. This is probably due to the change from float to a string for rel_mass_loss_HMS_HMS.
This PR:

🚨 Binary Evolution Failed!
Exception: TypeError
Message: unsupported operand type(s) for -: 'float' and 'str'

Evolution steps before failure (3 steps):
     step_names     state      event               S1_state  S1_mass               S2_state  S2_mass  orbital_period
0  initial_cond  detached       ZAMS  H-rich_Core_H_burning    9.846  H-rich_Core_H_burning    9.611           3.821
1  step_HMS_HMS      RLO2       oCE2  H-rich_Core_H_burning    4.213  H-rich_Core_H_burning   10.952           5.138
2       step_CE    merged  oMerging2  H-rich_Core_H_burning    4.213  H-rich_Core_H_burning   10.952           5.138



--------------------------------------------------------------------------------------------------------------------------------------------
No warning(s) raised during evolution

on v2.3:

     step_names     state      event               S1_state  S1_mass                S2_state  S2_mass  orbital_period
0  initial_cond  detached       ZAMS  H-rich_Core_H_burning    9.846   H-rich_Core_H_burning    9.611           3.821
1  step_HMS_HMS      RLO2       oCE2  H-rich_Core_H_burning    4.213   H-rich_Core_H_burning   10.952           5.138
2       step_CE    merged  oMerging2  H-rich_Core_H_burning    4.213   H-rich_Core_H_burning   10.952           5.138
3   step_merged    merged        CC2       massless_remnant    0.000  H-rich_Core_C_depleted    9.466             NaN
4       step_SN    merged       <NA>       massless_remnant    0.000                      NS    1.914             NaN
5      step_end    merged        END       massless_remnant    0.000                      NS    1.914             NaN





--------------------------------------------------------------------------------------------------------------------------------------------
No warning(s) raised during evolution

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants