rebound icon indicating copy to clipboard operation
rebound copied to clipboard

changing orbital elements by hand

Open nchoksi4456 opened this issue 2 years ago • 7 comments

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

nchoksi4456 avatar Mar 12 '22 18:03 nchoksi4456

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

dtamayo avatar Mar 12 '22 19:03 dtamayo

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.

nchoksi4456 avatar Mar 12 '22 19:03 nchoksi4456

Sorry, looks like Hanno did update this so that this will work! It's updating e while keeping all other orbital elements the same

dtamayo avatar Mar 12 '22 19:03 dtamayo

which I think implies that you're changing the body's position

dtamayo avatar Mar 12 '22 19:03 dtamayo

Thanks. Could you point me to where in the REBOUND source code these changes are applied?

nchoksi4456 avatar Mar 12 '22 19:03 nchoksi4456

https://github.com/hannorein/rebound/blob/main/rebound/particle.py#L720

dtamayo avatar Mar 12 '22 19:03 dtamayo

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...

hannorein avatar Mar 12 '22 19:03 hannorein