create_statefbk_iosystem and optimal control enhancements by murrayrm · Pull Request #930 · python-control/python-control

@murrayrm

This PR has two primary changes. motivated by some debugging I was doing in #929:

  • The create_statefbk_iosystem function now allows you to pass an I/O system instead of the a gain (or gain schedule) for the controller. This allows a more general state feedback controller (like an MPC controller) to be created using create_statefbk_iosystem. (I needed this so that I could gain easy access to the inputs in issue #929, since the feedback function does not pass through the controller inputs as a system output, but create_statefbk_iosystem does.)
  • The create_mpc_iosystem function now properly allows keyword parameters that go to the underlying OptimalControlProblem, for example setting the minimization method. Prior to this, the keyword parameters were passed to OptimalControlProblem but were also passed to NonlinearIOSystem, where they would generate an error.
  • Unit tests and documentation updated as well. More specifically, the documentation for the solve_ocp function has been updated to make more clear how the final time point is handled (see issue #929 for some discussion on this).
  • Had to modify the install_examples.yml workflow to explicitly include the latest python version, otherwise an early version of matplotlib got installed that was not current enough to work with current code (not sure why this was suddenly required...).

@coveralls

Coverage Status

coverage: 95.012% (+0.002%) from 95.01% when pulling 5e217ee on murrayrm:mpc_enhancements-10Sep2023 into a11d3be on python-control:main.

@murrayrm murrayrm changed the title create_statefbk_iosystem and create_mpc_iosystem enhancements create_statefbk_iosystem and optimal control enhancements

Sep 15, 2023

@murrayrm murrayrm linked an issue

Sep 16, 2023

that may be closed by this pull request

sawyerbfuller


.. math::

J(x, u) = \sum_{k=0}^{N-1} L(x_k, u_k)\, dt + V \bigl( x_N \bigr).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does V(x_N) need big parens but L(.) does not?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

above, V(.) gets regular sized parens.

@sawyerbfuller

These seem like obvious improvements to make, so I see no issue with them. Just one tiny note in the comments.

sawyerbfuller

@murrayrm

@murrayrm

@murrayrm murrayrm deleted the mpc_enhancements-10Sep2023 branch

October 22, 2023 05:46