POSYDON-code / POSYDON

POSYDON is a next-generation single and binary-star population synthesis code incorporating full stellar structure and evolution modeling with the use of MESA.
BSD 3-Clause "New" or "Revised" License
29 stars 19 forks source link

CO-H(e)MS period outside grid being failed fix #255

Closed maxbriel closed 7 months ago

maxbriel commented 7 months ago

The CO-H(e)MS looping fix was too strong and would cause too many systems to fail.

This fix checks if the period is outside the grid period and then redirects the binary back to detached.

example binary at 1Zsun

STAR1 = SingleStar(**{'mass': 58.947503,
                      'state': 'H-rich_Core_H_burning'})
STAR2 = SingleStar(**{'mass': 56.660506,
                      'state': 'H-rich_Core_H_burning'})

BINARY = BinaryStar(STAR1, STAR2,  
                    **{'time': 0.0, 'state': 'detached', 'event': 'ZAMS', 'orbital_period':211.300659, 'eccentricity': 0.0},
                    properties = sim_pop)
maxbriel commented 7 months ago

There seems to be a bit more going on. With this fix I'm also finding that binaries that have eccentricity are being caught by the check. I will rethink the check to make sure it is more selective.

Screenshot 2024-02-21 at 10 21 40
maxbriel commented 7 months ago

I've added more specific selection criteria for grid mass limit checks for the CO-HMS_RLO, CO-HeMS, and CO-HeMS_RLO steps. At the same time, I've removed the looping check, because it turns out to be too restrictive and does not let through binaries that are outside the grid and can be evolved by the detached step. I'm evolving a population to check if this new version works correctly.

Example 1

``` STAR1 = SingleStar(**{'mass':29.580210, 'state': 'H-rich_Core_H_burning'}) STAR2 = SingleStar(**{'mass': 28.814626, 'state': 'H-rich_Core_H_burning'}) BINARY = BinaryStar(STAR1, STAR2, **{'time': 0.0, 'state': 'detached', 'event': 'ZAMS', 'orbital_period':40.437993, 'eccentricity': 0.0}, properties = sim_pop) ``` Screenshot 2024-02-21 at 10 55 08

Example 2

``` STAR1 = SingleStar(**{'mass': 58.947503, 'state': 'H-rich_Core_H_burning'}) STAR2 = SingleStar(**{'mass': 56.660506, 'state': 'H-rich_Core_H_burning'}) BINARY = BinaryStar(STAR1, STAR2, **{'time': 0.0, 'state': 'detached', 'event': 'ZAMS', 'orbital_period':2011.300659, 'eccentricity': 0.0}, properties = sim_pop) BINARY.evolve() ``` Screenshot 2024-02-21 at 10 55 46

Example 3

``` STAR1 = SingleStar(**{'mass': 109.540207, 'state': 'H-rich_Core_H_burning',}) STAR2 = SingleStar(**{'mass': 84.344530, 'state': 'H-rich_Core_H_burning',}, ) BINARY = BinaryStar(STAR1, STAR2, **{'time': 0.0, 'state': 'detached', 'event': 'ZAMS', 'orbital_period':5.651896, 'eccentricity': 0.0}, properties = sim_pop) BINARY.evolve() ``` Screenshot 2024-02-21 at 10 56 42

Example 4

``` STAR1 = SingleStar(**{'mass': 68.226377, 'state': 'H-rich_Core_H_burning',}) STAR2 = SingleStar(**{'mass': 68.174513, 'state': 'H-rich_Core_H_burning',}, ) BINARY = BinaryStar(STAR1, STAR2, **{'time': 0.0, 'state': 'detached', 'event': 'ZAMS', 'orbital_period':3.000680, 'eccentricity': 0.0}, properties = sim_pop) BINARY.evolve() ``` Screenshot 2024-02-21 at 10 57 11