Small fixes based on Caltech CDS 112 course by murrayrm · Pull Request #849 · python-control/python-control

@murrayrm

This PR contains some small fixes that I discovered while teaching CDS 112 at Caltech in Winter 2023:

  • Fixed bug in create_statefbk_iosystem that didn't proper handle 1D gain schedules.
  • flatsys.point_to_point generates an error if you specify a cost or constraint with less than 3 time points.
  • Sampling a LinearIOSystem returns a LinearIOSystem (before it returned a StateSpace system).
  • Added an add_unused keyword parameter to interconnect that allows unused inputs or outputs to be added as inputs or outputs of the interconnected system (useful for doing a "partial" interconnection).
  • create_mpc_iosystem now allows system and signal names to be specified via appropriate keywords.
  • Changed type keyword for create_statefbk_iosystem to controller_type (linear or nonlinear). Using type generates a deprecation warning.
  • Added control_indices and state_indices to create_statefbk_iosystem to allow partial interconnection (eg, for inner/outer loop construction).
  • Updated unit tests, docstrings, and comments.

This was linked to issues

Jan 14, 2023

@coveralls

Coverage Status

Coverage: ?%. Remained the same when pulling 10bcd65 on murrayrm:cds112_fixes-12Jan2023 into 55730b6 on python-control:main.

@coveralls

Coverage Status

Coverage: 94.876% (-0.007%) from 94.883% when pulling 574cf69 on murrayrm:cds112_fixes-12Jan2023 into 08dcc95 on python-control:main.

bnavigator

type : 'linear' or 'nonlinear', optional
controller_type : 'linear' or 'nonlinear', optional

Choose a reason for hiding this comment

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

That's an API change. The milestone should be 0.10.0 (or 1.0.0) then.

Choose a reason for hiding this comment

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

I put in code to handle legacy calls, so type will still work. See line 732.

@bnavigator

Rebased onto current main, in order to resolve conflicts due to #857

@murrayrm murrayrm marked this pull request as ready for review

March 13, 2023 05:55

@murrayrm murrayrm deleted the cds112_fixes-12Jan2023 branch

March 24, 2023 04:28