GithubHelp home page GithubHelp logo

zhouazhou98 / pylgr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tenavi/pylgr

0.0 0.0 0.0 173 KB

A basic Python implementation of a Legendre-Gauss-Radau pseudospectral method for computational optimal control.

License: MIT License

Python 100.00%

pylgr's Introduction

PyLGR

Note: this repository is no longer maintained. The benchmark_ocp repository contains a regularly updated implementation of this code's functionality.


pylgr is a basic Python implementation of a Legendre-Gauss-Radau (LGR) pseudospectral (PS) method for infinite horizon computational optimal control. The optimal control problem (OCP) is collocated in time at LGR points, turning it into a constrained nonlinear programming problem which we solve with sequential least squares quadratic programming (SLSQP). Rough estimates for the costates are extracted based on the covector mapping theorem.


The code has been tested with the following dependencies:

python>=3.6
numpy>=1.19.5
scipy>=1.5.4
pytest>=7.0.1
matplotlib>=3.3.4

The code can be installed using the following command:

pip install -e .

You can then import pylgr in any python script. The main function is pylgr.solve_ocp. Documentation can be accessed by the python command help(pylgr.solve_ocp).


The test suite can be run from the main directory with the command

pytest unit_tests -s -v

Plotting can be enabled in test_solve.py inside each individual test function.


See the following references for details on the LGR PS approach:

Fahroo, F. and Ross, I. M. "Pseudospectral Methods for Infinite-Horizon Optimal Control Problems," Journal of Guidance, Control, and Dynamics, Vol. 31, No. 4, July–Aug. 2008, pp. 927-936. doi: 10.2514/1.33117

Ross, I. M., Gong, Q., Fahroo, F., and Kang, W., "Practical Stabilization Through Real-Time Optimal Control," Proceedings of the 2006 American Control Conference, Inst. of Electrical and Electronics Engineers, Piscataway, NJ, June 2006, pp. 14–16. doi: 10.1109/ACC.2006.1655372.

pylgr's People

Contributors

tenavi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.