COSMIC-PopSynth / COSMIC

COSMIC (Compact Object Synthesis and Monte Carlo Investigation Code)
GNU General Public License v3.0
48 stars 59 forks source link

Replace get_velocities in elson.py #534

Open carlrodriguez opened 3 years ago

carlrodriguez commented 3 years ago

right now the get_velocities throws some integration warnings when sampling from an Elson profile, largely because when numerically integrating the distribution function, you get a lot of roundoff error when the energy goes to zero. this is fine, especially for a generic Elson profile, but the Plummer profile (which is Elson when gamma=4) has an analytic distribution function that can be sampled directly, and would be a lot faster and not throw errors (which don't effect the results, but looks sloppy).

Carl, put in a special case function to draw from that distribution function when gamma=4

carlrodriguez commented 3 years ago

This is done in the latest PR

carlrodriguez commented 2 years ago

So somehow this code never made it in? And the PR that supposedly fixed this is empty. Not sure what happened, but I'm going to have to code this up again and do another PR.