Skip to content

Fixes to various optimization-based control functions #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 19, 2022

Conversation

murrayrm
Copy link
Member

@murrayrm murrayrm commented Mar 13, 2022

I recently finished teaching an optimization-based controls course and found a but of small things in the code that needing fixing/improving:

  • Parameters were not being passed properly to differentially flat systems.
  • Basis functions derived from BasisFamily were not calling BasisFamily.__init__.
  • Changed constraints keyword in optimal.solve_ocp and flatsys.point_to_point to trajectory_constraints for more consistency (legacy keyword still works).
  • Initial conditions for simulation of discrete time systems was being passed as a list instead of an ndarray, which caused some odd behavior and wasn't consistent with continuous time system usage.
  • Added check for constraint types in optimal control problem setup (rather than when solving the optimal control problem).
  • Fixed small inconsistency in the way discrete time was handled in setting up an I/O system for model predictive control (should be inherited from system, not passed separately).
  • Unused keywords in OptimalControlProblem now generate an error (mentioned here).
  • To be consistent with the normal problem formulation, the discrete time optimal cost calculation no longer includes the endpoint (use terminal_cost instead).
  • create_mpc_iosystem now re-computes the optimal controller when returning the output, which eliminates an unintended one-step delay in the MPC dynamics.
  • Added unit tests.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 93.601% when pulling f807b33 on murrayrm:cds112 into e10855e on python-control:master.

@murrayrm murrayrm added this to the 0.9.2 milestone Mar 19, 2022
@murrayrm murrayrm merged commit 4ef15c4 into python-control:master Mar 19, 2022
@murrayrm murrayrm deleted the cds112 branch March 19, 2022 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants