ericagol / NbodyGradient.jl

N-body integrator computes derivatives with respect to initial conditions for TTVs, RV, Photodynamics & more
MIT License
20 stars 9 forks source link

Allow circular orbits in initial conditions #83

Open langfzac opened 2 years ago

langfzac commented 2 years ago

Right now this fails

a = Elements(m=1.0)
b = Elements(m=9e-5, P=1000.0)
ic = ElementsIC(0.0, 2, a, b)
s = State(ic)

All non-specified orbital elements are set to 0. The state positions and velocities return nans.

ericagol commented 2 years ago

Yes, this is a long-standing problem which I never fixed. The problem is that in the initial conditions code, some of the algebra involves a division by the eccentricity. This can (should) be not too difficult to fix, but I never did it - instead I just call it with a very small value for eccentricity... a hack.