MechJeb2

MechJeb2

4M Downloads

Post-PVG Pseudospectral Guidance

lamont-granquist opened this issue · 0 comments

commented

Tools

This will require linking to C/C++ dlls which are not part of the mono framework so a similar strategy will have to be used to Principia to link against those from C#. Although I do not expect them to need to be rebuilt since they're being used as libraries (akin to alglib) so the c-libs will just get checked into git directly and will not need to change much.

Those are:

  • IPOPT (Eclipse Public License - Copyleft)
  • PSOPT (LGPL 2.1)
  • OpenBLAS (BSD 3-clause)
  • LAPACK [maybe but hopefully just use AD] (BSD 3-clause)
  • MUMPS (CeCILL-C Copyleft) / MA27 (free? it is "archived") seem to be the only freely redistributable linear solvers usable by IPOPT, MUMPS is the only one that it is clear, might try contacting HSL about using one of their other solvers in open source work.

Also necessary will be algorithm differentiation, but there's one for F#/C#:

  • DiffSharp (BSD 2-clause)

I'm hoping that because DiffSharp and IPOPT/PSOPT can both use OpenBLAS that they interoperate well across C#/C++ interfaces, but that may be only a hope. Otherwise would probably need to use a C/C++ AD tool which would probably move the problem code to C/C++ which would likely then require more of a C/C++ build system for MechJeb which is what I'd want to greatly avoid.

Design Requirements

  • LGL pseudospectral collocation
  • HP method
  • Multi-phase (K intervals per phase, with a fixed N polynomial size per phase -- N of 6-10 generally)
  • No mesh refinement (although PSOPT supports it so maybe?)
  • Check residuals and refine K+N for next guidance iteration
  • Analytic Jacobian+Hessian from DiffSharp/AD.
  • Maybe: Initial trajectory guess from vacuum indirect solution.

Initial Use Cases

Core Optimizer UI Requirements

  • Can solve F9/F9H reusable rockets (no GUI/UX wiring)
  • Can solve for optimized rocket design (no GUI/UX wiring to the VAB)
  • Can solve optimal burn-coast-burn stock Kerbin ascents (no GUI/UX wiring)
  • Can solve arbitrary burn-coast phases (no GUI/UX wiring beyond PVGs coast)
  • Coşkun Thesis for optimized rocket design:

Details

  • Do all calculations in normal non-rotating xyz space instead of krazy kerbal space this time.

Unresolved Issues

  • Use simple vector for u(t) or use quaternions like Rea's Thesis?
  • What do I name it? PSG? I'm more of a Barça/Messi fan though.