rebound
rebound copied to clipboard
changing orbital elements by hand
Hi all,
Hopefully this is a quick question: when I change the orbital elements of a particle e.g.
sim.integrate(integrate_a_little)
sim.particles[1].e += delta_e # NC: kick the eccentricity
sim.integrate(integrate_further)
Is REBOUND self-consistently updating the particle's velocity vector to satisfy the new eccentricity? I think the answer is yes. But wanted to confirm I'm not missing something subtle.
Thanks, Nick
No, that doesn't work. There are too many options (are you changing e keeping all other parameters fixed? are you changing e but keeping the position of the body the same?). You could check modify_orbits_direct in REBOUNDx for how to do this by hand yourself
Thanks Dan. What exactly is REBOUND doing then, when one applies the line sim.particles[1].e += delta_e
? Because REBOUND does not throw an error. My impression based on the outputs was that it was changing eccentricity while keeping the position of the body the same.
Sorry, looks like Hanno did update this so that this will work! It's updating e while keeping all other orbital elements the same
which I think implies that you're changing the body's position
Thanks. Could you point me to where in the REBOUND source code these changes are applied?
https://github.com/hannorein/rebound/blob/main/rebound/particle.py#L720
That's correct. I think this implementation makes sense in some case, or is at least self consistent. But use it with caution. There are many potential conceptual pitfalls. Jacobi versus heliocentric, etc...