You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I've been playing around with your very nice solver--thanks for putting those into the public domain!
I noticed that there's a sign error for the Jupiter force calculation. It probably doesn't matter for Jupiter mass planets, but when integrating planets closer to each other in mass, then that error will become important. The force function should be
def force(r,planet,ro,vo):
if planet == 'earth':
return force_es(r) + force_ej(r,ro)
if planet == 'jupiter':
return force_js(r) + force_ej(r,ro)
Also, it would be beneficial to forward-integrate the motions of both planets in the Runge-Kutta solver symmetrically for cases where the planets are closer to each other and/or similar in mass. Here's a way to do that:
Hi there, I've been playing around with your very nice solver--thanks for putting those into the public domain!
I noticed that there's a sign error for the Jupiter force calculation. It probably doesn't matter for Jupiter mass planets, but when integrating planets closer to each other in mass, then that error will become important. The force function should be
def force(r,planet,ro,vo):
if planet == 'earth':
return force_es(r) + force_ej(r,ro)
if planet == 'jupiter':
return force_js(r) + force_ej(r,ro)
Also, it would be beneficial to forward-integrate the motions of both planets in the Runge-Kutta solver symmetrically for cases where the planets are closer to each other and/or similar in mass. Here's a way to do that:
def RK4Solver(t,re,ve,rj,vj,h):
k11e = dr_dt(t,re,ve,'earth',rj,vj)
k21e = dv_dt(t,re,ve,'earth',rj,vj)
k11j = dr_dt(t,rj,vj,'jupiter',re,ve)
k21j = dv_dt(t,rj,vj,'jupiter',re,ve)
Finally, you can avoid the case distinction in the gravity term if you write the force terms as (e.g.):
def force_es(r):
return = -rGGMe*Ms/(r[0]**2+r[1]2)(3./2.)
The text was updated successfully, but these errors were encountered: