TomWagg / cogsworth

A Python package for performing self-consistent population synthesis and galactic dynamics simulations
https://cogsworth.readthedocs.io/
MIT License
16 stars 3 forks source link

Can we set `max_ev_time` different for each binary? #1

Closed TomWagg closed 2 years ago

TomWagg commented 2 years ago

This'll be a question for @katiebreivik.

I'm currently evolving every binary in COSMIC for 13.7 billion years - this is not correct given that they each have different birth times. We should account for this. Either:

  1. Maybe there's a method in COSMIC to just set the max_ev_time individually 🤞🏻
  2. Or, we do something sneaky like force bcm to include a timestep of an exact time for each binary perhaps?
TomWagg commented 2 years ago

I thought that if I were to update the values of tphys for each of the initial binaries this might solve it but this seems to make it so that only one line of output is given in bpp rather than one for each kstar...

katiebreivik commented 2 years ago

Ahhhhh -- ok! so the population sampler (i.e. here) assigns tphysf by setting SF_start and SF_duration. I think you should be able to just recast tphysf with the true ages (and do the same thing with the metallicity as well by recasting metallicity) in the initialbinaries DataFrame.

TomWagg commented 2 years ago

Okay so I think this is approximately what I tried but it gave me strange results (bpp only having one line per binary). I set the metallicities here and I test changing tpyhs here with a toggle for comparing

(It is possible that I got the tphys definition backwards, I kept debating between =lookback_time and =max_ev_time - lookback_time)

TomWagg commented 2 years ago

If only I knew how to read 🙃 Setting tpyhsf rather than tphys does the trick!