Title: Optimal control module by murrayrm · Pull Request #549 · python-control/python-control · GitHub
Open Graph Title: Optimal control module by murrayrm · Pull Request #549 · python-control/python-control
X Title: Optimal control module by murrayrm · Pull Request #549 · python-control/python-control
Description: This PR adds a new optimal control module, control.optimal, that implements finite horizon optimal control problems with constraints, including rudimentary model predictive control (MPC). The underlying algorithms are not super-efficient, so this is more of a "reference implementation" than something that you could use on a large problem, but it does allow you to explore ideas around tradeoffs in various types of cost functions, constraints, and other concepts. The PR includes unit tests and documentation on the use of the module. (The motivation for this PR is that I'll be teaching an optimal control class next year, and I'd like to have some tools around that students can use to get a feel for the concepts. The hope is to implement most of the concepts that are in my (very incomplete) notes on "Optimization-Based Control".) A few notes (for feedback): I have called the module control.optimal and it is not loaded by default. So, like the scipy.optimize package, you have to load the module separately if you want to use it (control.flatsys is also like this, so there is a precedent). I'm initially called the module obc (for optimization-based control, but decided that optimalwas probably better (and matchedoptimize`, used in SciPy). The module is basically just a wrapper around the scipy.optimize.minimize function: it essentially takes the element of an optimal control problem and creates an optimization problem for SciPy to solve. For this reason I have tried to make things consistent with scipy.optimize when possible (eg, the form of constraints, the way results are returned). The unit tests are a bit finicky and seem to depend on what system they are tested on. Everything is working in GitHub Actions, but you'll see some conditional checks in the code for things that work differently there versus my local machine. For this reason, it would be useful if people can try things out on other platforms and let me know what happens. Finally, as noted already above, the code is not super efficient, particularly for continuous time systems. You'll see this if you run the examples/steering-optimal.py script, which takes about 30 seconds to do solve some pretty straightforward problems. It also takes about 15 seconds for control/tests/optimal_test.py to run on my Mac, which can get annoying (a full pytest run takes about a 45 seconds, so this is 30% for just one module). Other changes along the way: Added in some functionality to check for unrecognized keywords in the config.py parsing function _get_param. 28 Feb 2021: Added a new 'bezier' basis function in flatsys, though only a partial implementation (needed for examples of optimizing over a set of basis functions). 28 Feb 2021: Added a benchmark directory with some airspeed velocity (asv) benchmarks for optimal control. These are mainly for development purposes, but might be something we use more generally at a future date. Comments and advice welcome!
Open Graph Description: This PR adds a new optimal control module, control.optimal, that implements finite horizon optimal control problems with constraints, including rudimentary model predictive control (MPC). The unde...
X Description: This PR adds a new optimal control module, control.optimal, that implements finite horizon optimal control problems with constraints, including rudimentary model predictive control (MPC). The unde...
Opengraph URL: https://github.com/python-control/python-control/pull/549
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:93be09dd-f4fb-426d-01cc-cf70965ec035 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 989C:222D40:4C7C53:664F98:697C1FA4 |
| html-safe-nonce | 755e8706381367010e00781b1012007ea37f6235660577a799226274448d2d34 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODlDOjIyMkQ0MDo0QzdDNTM6NjY0Rjk4OjY5N0MxRkE0IiwidmlzaXRvcl9pZCI6IjY0ODk0MjE5MzY0Nzk0NDQ5MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 850f3a2d21fb1a7212fca9cc7fec679162cb0f67cec76d477e5d5ba7796fd831 |
| hovercard-subject-tag | pull_request:577027033 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-control/python-control/pull/549/checks |
| twitter:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| og:image:alt | This PR adds a new optimal control module, control.optimal, that implements finite horizon optimal control problems with constraints, including rudimentary model predictive control (MPC). The unde... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | da4f0ee56809799586f8ee546b27f94fe9b5893edfbf87732e82be45be013b52 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-control/python-control git https://github.com/python-control/python-control.git |
| octolytics-dimension-user_id | 2285872 |
| octolytics-dimension-user_login | python-control |
| octolytics-dimension-repository_id | 22791752 |
| octolytics-dimension-repository_nwo | python-control/python-control |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22791752 |
| octolytics-dimension-repository_network_root_nwo | python-control/python-control |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 787d8d274e314f52ce6d846c7581f9476d8dc736 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width