Skip to content

MIMO impulse and step response #514

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 3 commits into from
Jan 20, 2021

Conversation

murrayrm
Copy link
Member

This PR implements MIMO impulse and step responses, mirroring the style and functionality of frequency response functions for MIMO systems. It resolves issue #512 and is consistent with the discussion issue #453. Specifically:

  • If a system is MIMO, calling step_response or impulse_response will generate an array of responses (indexed by output, input, and time).
  • Consistent with frequency response methods, if a system is SISO then by default the output will just be indexed by time.
  • Input and output axes that are single dimensional can be removed by using the squeeze=True keyword.
  • SISO systems can be tried as MIMO systems (retaining the output and input axes in the response) using the squeeze=False keyword.

Note that the response for initial_response and forced_response is not indexed by the input (since there is no input in one case and a specifically applied input in the other). The processing of the squeeze keyword is the same: by default SISO systems will be returned without the output axis, use squeeze=True to remove single dimensional axes from MIMO systems, use squeeze=False to force SISO systems to be treated like MIMO systems.

Other (small changes):

  • Updated unit tests to make sure all of the squeezing rules are properly implemented with the new MIMO functionality.
  • Found a bug in the way that the transpose keyword was working: it changed [output, input, time] to [time, input, output] instead of [time, output, input]. This was caught when adding unit tests.
  • Found some errors in the MATLAB unit tests where the return arguments were in the wrong order (didn't show up with SISO only responses).

@murrayrm murrayrm linked an issue Jan 19, 2021 that may be closed by this pull request
@murrayrm murrayrm added this to the 0.9.0 milestone Jan 19, 2021
@coveralls
Copy link

coveralls commented Jan 19, 2021

Coverage Status

Coverage increased (+0.004%) to 87.611% when pulling 28bbe7f on murrayrm:mimo_impulse_step_response into 0a08ff2 on python-control:master.

If present, the response represents ony the listed input.

output : int, optional
If present, the response represents ony the listed input.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If present, the response represents ony the listed input.
If present, the response represents only the listed output.

Copy link
Contributor

@sawyerbfuller sawyerbfuller left a comment

Choose a reason for hiding this comment

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

Looks good to me with one small doc change.

also: not changed in this PR but maybe the right place to fix it: on line 20 in config.py is a duplicated setting:
'control.squeeze_time_response': True,

@murrayrm murrayrm force-pushed the mimo_impulse_step_response branch from 6e64f92 to 28bbe7f Compare January 20, 2021 06:58
@murrayrm murrayrm merged commit 1502d38 into python-control:master Jan 20, 2021
@murrayrm murrayrm deleted the mimo_impulse_step_response branch January 24, 2021 16:43
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.

allow arrays of step, impulse responses for LTI systems
3 participants