# Lambert problem solver needed for custom gravity in Python

I need to solve the Lambert problem, however, I have a custom gravity model.

My ODE of motion is:

def ode_solve(y):
r=sqrt(y[1]**2 + y[2]**2 + y[3]**2)
n=1/(r**3+r**2+r)

dy[1] = y[4]
dy[2] = y[5]
dy[3] = y[6]
dy[4] = -y[1]*n/r
dy[5] = -y[2]*n/r
dy[6] = -y[3]*n/r

return dy


For the Earth I used the izzo.lambert(Earth.k, r0, r, tof) function from poliastro package on Python. However, the function requires the gravitational parameter (Earth or Sun), and I can't customize it.

Is there a way to solve the Lambert problem for custom gravity on Python?

• I've never used Julia, it's my allergy to curly braces that gets me stuck every time I try. If you get this working in Julia it would be really wonderful if you post a supplemental answer with that.
– uhoh
May 21 '19 at 15:44
• I've pinged the author of poliastro here, there may be a solution using poliastro. You can also think about going to the Github site and asking there as well. Here's the orbit integrator example pastebin.com/sp3DnuCB If I put it inside a BVP solver I'll post a real answer.
– uhoh
May 21 '19 at 16:08
• ping received :) I am open to dedicate it some time (it's not straightforward) but I'd like @Leeloo to clarify whether this is homework, and if that's the case for which University (if possible) or if the statement can be shared. May 22 '19 at 6:19
• @astrojuanlu Thanks for your support! This is a case for my research. I would share the papers later May 22 '19 at 6:37
• Awesome.......! May 22 '19 at 8:46