-
Notifications
You must be signed in to change notification settings - Fork 69
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
Binary evolution is not stable against timestep changes #1277
Comments
I think the problem description might be better phrased as "Binary evolution is not stable against some timestep choices" - i.e. I don't think (though I confess I haven't tested this) that the issue is that the mechanism of custom timesteps is causing a problem, just that the timestep durations are causing evolution to occur in a manner we don't expect. To test that, run a binary with detailed output, grab the timesteps and run it again using those timesteps as custom timesteps. If that produces a different outcome then yes, custom timesteps are a problem and we need to fix the mechanism. If not, then the problem is the choice of timesteps, and that might just be (for now) how COMPAS works (possibly related to #1259 and #24 - in that we know there are convergence issues that are timestep dependent). Wait - you said you did the test I suggested above? Hmmm. Let me think about that. |
The only difference in the test I described should be this paragraph in the documentation: "Note that COMPAS will use the timestep exactly as read - the timesteps read from the timesteps file are not quantised by COMPAS, and neither will they be truncated to any limit (e.g. ABSOLUTE_MINIMUM_TIMESTEP from constants.h) or multiplied by any timestep multiplier set by the timestep-multiplier option. Furthermore, no check will be made after the timestep is taken to limit the radial expansion of the star being evolved." Otherwise, evolution should proceed the same way for both binaries. |
@jeffriley I'm not at my computer right now, but I did actually try running a binary with the same time steps, and it worked just fine. It's only a problem if I then change something else minor, like in this case, the choice of tidal prescription (which should not hugely affect the binary orbital properties) |
Ah - you did change the tides prescription. Should we expect exactly the same evolution under different tides prescriptions? We know KAPIL2024 is sensitive to timestep duration, don't we? |
Hmmm. Ok, I might run some tests later (busy today) |
I ran both with the latest code version (03.07.04), but with one change: I added
|
I did this with COMPAS v03.07.05:
and harvested the timesteps from the detailed output file, creating timesteps file 'timesteps.txt' I then did this:
and the resultant detailed output file was exactly the same as the first run. Both runs resulted in:
I then did this
and got a very different outcome. Evolution was much shorter, and the result was:
I then did this:
and got a different result:
So, if we let COMPAS determine what timesteps to take, we get (I think) the result we were expecting, but if we force-feed it the smaller timesteps required for KAPIL2024 tides, things go awry (well, differently - maybe awry). But are we terribly surprised by that? EDIT: Just checked - the timesteps file I created is exactly the same as the timesteps file uploaded by @veome22 (which was presumably the timesteps file used by @ilyamandel) |
Hi @jeffriley, The match between
and
shows that all is well and your functionality for saving and forcing timesteps works great. The mismatch between 2) and
is not a problem per se; we have different tides prescriptions, so the binary evolution may well be different. At first I thought that the mismatch between 3) and
was an issue, because this indicates that one of those runs has not converged. And I even ran
to check, enforcing smaller timesteps. But this returned the same result as 4), so it doesn't seem to be a convergence issue. But then it occurred to me that because the evolution of the system with tides proceeds a bit differently, we may be taking shorter vs. longer timesteps in the wrong places when comparing 3) and 4). For example, at the same timestep we may have a HG star in 4), which requires smaller timesteps because of its rapid evolution, but an already stripped HeMS star in 3) [because those timesteps are taken from a run with tides, and tides, say, forced the the binary closer, leading to earlier stripping], which allowed for longer timesteps. So 4) ends up taking timesteps that are too large for the binary it is evolving, and gets flawed results. So the summary is, no obvious problem based on this example. Now, whether tides are behaving correctly is a separate problem, I haven't checked that. |
@veome22 I don't think there is a problem here - are you ok to close this, or do you want to do some more tests first? |
Hi @jeffriley and @ilyamandel , thank you for the tests! I am happy to not call this a bug, but the reason I flagged this as an issue was that, as far as I understand, stellar evolution should not be affected by tides. I think Ilya's diagnosis is correct, and the stellar type at each timestep when using different tidal prescriptions is not consistent between simulations, so taking smaller/larger timesteps can make a substantial difference. But why do the differences arise in the first place? In the simulation with tides, the primary evolves on the MS until Time= In the simulation WITHOUT tides, Everything about the primary is the same, and the same size timestep is taken. The only difference is that the semi-major axis is I'm happy to close this issue if there's a reasonable (non-bug) explanation for the difference in stellar evolution. |
I don't see that - maybe we're looking at different binaries? I run
harvest the timesteps, then run
The first run results in
whereas the second run results in
but in both cases the primary evolves off the MS to a HG star at the same timestep. The difference is that in the second run the primary immediately evolves to a HeMS star, then the stars merge. In the first run the primary says as a HG star for many timesteps, then evolves to HeMS where it stays for a while, then HeHG for a bit, then BH. |
Okay, maybe I will need to test again using the latest COMPAS version. In any case, it's likely that this is not a serious issue. I'll try first thing tomorrow and let you know |
Quick update-- the stellar evolution is indeed fine when using custom timesteps. I don't know how, but maybe the latest COMPAS version fixed things. I now believe that the drastically different outcomes are indeed caused by something with the tidal implementation, which I will investigate. For now, I will close this issue. Thanks @jeffriley and @ilyamandel ! |
Providing custom time steps seems to result in very different binary evolution outcomes. I'm trying to use custom time steps to ensure an apples-to-apples comparison between different tidal mechanisms. But taking the time steps from
KAPIL2024
and using them with any other tidal prescription (NONE
,PERFECT
) seems to result in a very early stellar merger. Weirdly, the same binary usually forms a DCO with all tidal prescriptions when not using custom time steps.To Reproduce
Runing the following binary simulation with
--tides-prescription KAPIL2024
:produces
0: DCO formed: (Main_Sequence_>_0.7 -> Black_Hole) + (Main_Sequence_>_0.7 -> Black_Hole)
.Running the same binary, but with
--tides-prescription NONE
and using--timesteps-filename
timesteps.txt, generated from theKAPIL2024
simulation:results in
0: User-provided timesteps not consumed: (Main_Sequence_>_0.7 -> Naked_Helium_Star_MS) + (Main_Sequence_>_0.7 -> Main_Sequence_>_0.7)
.As far as I can tell, there is a huge difference when the primary goes from HG to HeMS sometime after$t=5.035870$ Myr. In both
KAPIL2024
tides as well asNONE
tides with default time steps, the HeMS step results in a much wider binary. But when using custom timesteps, theNONE
tides system decides to significantly shrink the orbit instead.The conditions at the end of HG are very similar across the board, so it is unclear why such drastically different outcomes happen.
Screenshot:
KAPIL2024
vsNONE
tides + custom time steps.Versioning:
COMPAS v03.07.05
The text was updated successfully, but these errors were encountered: