Simply download the project files and run INSTALL_Direct_Method_Examples.m. Then you can use Run_All_Examples.m to run each method.
Please see the README at: https://github.com/danielrherber/optimal-control-direct-method-examples
Daniel R. Herber (2019). Optimal Control Direct Method Examples (https://www.github.com/danielrherber/optimal-control-direct-method-examples), GitHub. Retrieved .
Inspired by: Basic Implementation of Multiple-Interval Pseudospectral Methods to Solve Optimal Control Problems
Create scripts with code, output, and formatted text in a single executable document.
Daniel R. Herber (view profile)
Thanks for pointing out this error! I have just uploaded a fix to the GitHub repository.
Catherine Cai (view profile)
I can not run INSTALL_Direct_Method_Examples.m.
As "INSTALL_DTQP_Project has not been defined."
Daniel R. Herber (view profile)
Thank you for your comment and rating chou fly.
You are correct that those files are not directly included in this submission, but they will be automatically downloaded from MFX 51104 if you run the install file (INSTALL_Direct_Method_Examples.m).
chou fly (view profile)
LGL_nodes(), LGL_Dmatrix(), LGL_weights() are mising, which can be found here
https://cn.mathworks.com/matlabcentral/fileexchange/51104-basic-implementation-of-multiple-interval-pseudospectral-methods-to-solve-optimal-control-problems