Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing order of particles in SeBa output file #1084

Open
floriskummer opened this issue Oct 29, 2024 · 2 comments
Open

Changing order of particles in SeBa output file #1084

floriskummer opened this issue Oct 29, 2024 · 2 comments
Labels

Comments

@floriskummer
Copy link

Describe the bug
When running a binary star with the SeBa code via AMUSE, the order of the stars (primary or secondary) that is printed in the output file "starev.data" changes depending on the masses of the objects. Currently, the least massive star at each time step is printed first, and the more massive last, while the initial primary should always be printed first.

To Reproduce
In line 20 of interface.cc in the seba directory of AMUSE, I set: static bool is_logging_of_evolve_enabled = true;, in order for starev.data to be created.
Additionally, in lines 71, 118 and 131, I set bi->get_starbase()->dump(starev, false); to bi->get_starbase()->dump(starev, true);, to get more readable output.

Then, run a python script to create and run a binary system:

from amuse.community.seba.interface import SeBa
from amuse.datamodel import Particles
from amuse.units import units, constants

stars = Particles(2)
stars[0].mass = 20|units.MSun
stars[1].mass = 10|units.MSun

binary = Particles(1)
binary.semi_major_axis = 1e4|units.RSun
binary.eccentricity = 0
binary.child1 = stars[0]
binary.child2 = stars[1]

code = SeBa()
code.parameters.metallicity = 0.02
code.particles.add_particles(stars)
code.binaries.add_particles(binary)
channel_stars = code.particles.new_channel_to(stars)
channel_binary = code.binaries.new_channel_to(binary)
channel_binary_reverse = binary.new_channel_to(code.binaries)
channel_stars.copy()
channel_binary.copy()

time = min(code.particles.time_step)
end_time = 25|units.Myr

while time < end_time:
    code.evolve_model(time)
    channel_stars.copy()
    channel_binary.copy()
    time += min(code.particles.time_step)

Expected behavior
The initial primary should always be printed first, and the initial secondary last. When running a binary directly from SeBa this works, because both stars are assigned a unique identity (0 for the primary, and 1 for the secondary). Instead, when running from AMUSE, both stars are assigned an identity of 0, which likely leads to the confusion of which star to print first.

Logs
At line 217 & 218 of the starev.data file (similarly line 3 & 4 of the SeBa.data file that is simultaneously created), mass ratio reversal takes place as the more massive star transitions from an agb star to black hole (from 14.75 to 4.67 solar masses, while the secondary star has roughly 10)

3 2 0 9.69349 12120.1 0     0 3 9.99906 4.89852 4.38063 0 0 8 14.7532 1355.65 3.52315 7.10802
3 2 0 9.69349 9215.76 0.728488     0 19 4.66614 1.98311e-05 5.6125 4.66614 0 3 9.99906 4.89852 4.38063 0
@spzwart
Copy link
Contributor

spzwart commented Oct 29, 2024 via email

@rieder
Copy link
Member

rieder commented Oct 29, 2024

Hi Simon,
I don't agree, since clearly there is a difference in how SeBa operates on its own and via AMUSE.
As Floris writes: both stars are supposed to have a unique identity, but these seem to be identical when running SeBa from AMUSE... I think this is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants