2

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?

uhoh
  • 148,791
  • 53
  • 476
  • 1,473
Leeloo
  • 833
  • 11
  • 29
  • 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 https://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. – astrojuanlu May 22 '19 at 06:19
  • @astrojuanlu Thanks for your support! This is a case for my research. I would share the papers later – Leeloo May 22 '19 at 06:37
  • Awesome.......! – astrojuanlu May 22 '19 at 08:46
  • Re Is there a way to solve the Lambert problem for custom gravity?" Most certainly not for your custom gravity model. Lambert's problem assumes spherical gravity. Based on this assumption, it's possible to solve the boundary value problem without integrating multiple times over. Lambert's problem instead solves for the conic sections (except for diametrically opposed initial and final points, there are always at least two). You have a general boundary value problem, and if your custom gravity has behaviors like spherical gravity, you have a nasty boundary value problem. (continued) – David Hammen May 23 '19 at 14:07
  • Most BVP solvers assume a unique solution. With spherical gravity, there are always at least two solutions. This may create a challenge with regard to using a generic BVP solver. – David Hammen May 23 '19 at 14:11
  • @DavidHammen What would you suggest? – Leeloo May 23 '19 at 14:22
  • @Leeloo - Various python packages provide boundary value solvers. You could try one of those. Some care and feeding may be needed. If that doesn't work, you can roll your own. For example, estimate the Jacobian of the position at the end time with respect to initial velocity, and use the error and the Jacobian to update the initial velocity. (Shooting method variant.) – David Hammen May 23 '19 at 16:05

1 Answers1

1

Summarizing some answers from the poliastro issue:

The Lambert problem is nothing more than the two body boundary value problem under the assumption of Newtonian dynamics and spherical gravity. Therefore, to solve a case with a different gravity field, you would need to write the equations of motion and use a boundary-value problem solver. I don't know of any ways to adapt existing Lambert algorithms to custom gravity models, because they are already written with that assumption in mind, and you would have to basically unroll all the equations.

astrojuanlu
  • 1,052
  • 7
  • 19