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
`binary.evolve()` crash due to separation not present when giving the orbital_period on initialisation #387
When running the following binary, it crashes due to the "separation" not being available for the RLO calculation.
Even though the orbital_period and masses are given, it feels counterintuitive that the separation is not automatically calculated.
Similarly, there are some other properties that are not initialised when creating your own binary, which are by default initialised for a POSYDON ZAMS binary. Should this be done as well when initiating a binary manually at ZAMS?
Yes, the __init__ of each class should always create and initialize all the element of an object of that class, which are called without being checked for their existence.
When running the following binary, it crashes due to the "separation" not being available for the RLO calculation. Even though the orbital_period and masses are given, it feels counterintuitive that the separation is not automatically calculated.
Similarly, there are some other properties that are not initialised when creating your own binary, which are by default initialised for a POSYDON ZAMS binary. Should this be done as well when initiating a binary manually at ZAMS?
Traceback
TypeError Traceback (most recent call last) Cell In[22], line 1 ----> 1 BINARY.evolve() File ~/Documents/POSYDON_versions/POSYDON_PISN/posydon/binary_evol/binarystar.py:210, in BinaryStar.evolve(self) 206 while (self.event != 'END' and self.event != 'FAILED' 207 and self.event not in self.properties.end_events 208 and self.state not in self.properties.end_states): 209 signal.alarm(MAXIMUM_STEP_TIME) --> 210 self.run_step() 212 n_steps += 1 213 if max_n_steps is not None: File ~/Documents/POSYDON_versions/POSYDON_PISN/posydon/binary_evol/binarystar.py:239, in BinaryStar.run_step(self) 234 raise ValueError( 235 "Next step name '{}' does not correspond to a function in " 236 "SimulationProperties.".format(next_step_name)) 238 self.properties.pre_step(self, next_step_name) --> 239 next_step(self) 240 finally: 241 self.append_state() File ~/Documents/POSYDON_versions/POSYDON_PISN/posydon/binary_evol/DT/step_detached.py:1392, in detached_step.__call__(self, binary) 1389 print("initial omega_in_rad_per_year", omega_in_rad_per_year) 1390 return omega_in_rad_per_year -> 1392 if (ev_rlo1(binary.time, [binary.separation, binary.eccentricity]) >= 0 1393 or ev_rlo2(binary.time, [binary.separation, binary.eccentricity]) >= 0): 1394 binary.state = "initial_RLOF" 1395 return File ~/Documents/POSYDON_versions/POSYDON_PISN/posydon/binary_evol/DT/step_detached.py:1220, in detached_step.__call__.