3 ms·
Whoa! I didn't know of the Python syntax for complex numbers (1j). I was confusing the number 1 with lower case l and wondering where the "lj" symbol is coming
by exDM69 11y ago
Whoa! I didn't know of the Python syntax for complex numbers (1j). I was confusing the number 1 with lower case l and wondering where the "lj" symbol is coming from. Apparently you also need to use exp() from scipy, Python's standard math.exp() can't handle complex numbers (at least in python2).
The model in the blog post was obviously a simplified model. It assumes circular and coplanar trajectories, both of which are good approximations for back-of-a-napkin calculations such as this one but not super accurate for real life analysis.
In the hopes that there are some programmers interested in astrodynamics or celestial mechanics, I'll shamelessly take this opportunity to promote a related programming project of mine: https://github.com/rikusalminen/twobody https://github.com/rikusalminen/twobody
It's a simple C library that solves some fundamental problems in celestial mechanics, including state of the art solvers for time of flight (ie. solving Kepler's equation using the Laguerre-Conway method) and can work in 3D and with elliptic (and hyperbolic and parabolic) trajectories. It may seem a bit cryptic (I wish I had the time to write docs), but if you're familiar with the field, you should be able to understand most of it.