openlunar / trajectory

Trajectory optimization tools for lunar missions
2 stars 2 forks source link

Patched conic: sequential gradient restoration algorithm needs to become SciPy-compatible #2

Open translunar opened 4 years ago

translunar commented 4 years ago

Right now the patched conic optimization code is written in pure Python.

I attempted to use SciPy to handle the Newton's method portion of the code, but found it to be infeasible because the SciPy implementation of Newton's method doesn't know what to do when the function is undefined on the other side of the root.

I also attempted to use SciPy's minimize_scalar function, but this, too, struggled with undefined function values. I ended up writing my own, for which the code is not terribly clean.

Finally, it's not totally clear to me how to implement SGRA and SCGRA (C for conjugate) in a framework which makes it compatible with SciPy.

Note: "SciPy" here is used interchangeably with "Numpy" since they seem to use the same optimization code.