MatthewPeterKelly / OptimTraj

A trajectory optimization library for Matlab
MIT License
598 stars 207 forks source link

What is the deal with the undocumented MultiCheb method in OptimiTraj? #16

Open stumarcus314 opened 7 years ago

stumarcus314 commented 7 years ago

Is there any issue with the 'multiCheb' method? It doesn't seem to be documented in the users' guide, but it seems to give good answers for the demo examples and for my particular optimal control problem.

MatthewPeterKelly commented 7 years ago

You are welcome to use the Multi-Cheb method. If it converges, it will give very good solutions.

I "hid" it from the API because there are some situations where it will fail unexpectedly. I recall that one such failure occurs whenever you set the order of each segment to be too small (less than 6). In cases where it fails, it does so spectacularly. If you get good solutions for your problem, then it might actually be the best method to use.

If you're curious about this type of method, look at the documentation for GPOPS-II and some of the other papers by Anil Rao. It is technically a Chebyshev--Lobatto orthogonal collocation method with differential collocation constraints. After much reading, and several phone calls with Anil, I finally understand his solvers, and I have some insight into why Multi-Cheb fails in some cases, but I've not done careful testing. Some day I would love to write a good orthogonal collocation method with remeshing into OptimTraj, but I just don't have the time right now.

If anyone has a better idea of why this method is not reliable, or if you know an easy fix, then please let me know! Or just make a pull request.