sisotool small visual cleanup, new feature to show step response of different input-output than loop by sawyerbfuller · Pull Request #531 · python-control/python-control
Conversation
This PR adds a new feature to sisotool that allows it to show the step response of a system that is not the loop transfer function L. Some visual cleanup including reducing oversized axis tick labels.
- To see a the step response of a more complicated system that includes a feedforward controller, or any other input-output pair, you can do so by passing sisotool a 2 input, 2-output system. The gain you choose when you click the rlocus plot gets inserted between output[0] and input[0], and then the step response is between input[1] and output[1].
- Doubled the click threshold size in rlocus because I had a hard time aiming the mouse well enough to get successful click events.
👍
- Pictures please?
- Please cover the 2-in, 2-out case and the MIMO Exception with tests: https://coveralls.io/builds/36879506/source?filename=control%2Fsisotool.py#L162
Comment on lines +124 to +137
|
|
||
| # test supply tvect | ||
| sisotool(sys, tvect=np.arange(0, 1, .1)) | ||
|
|
||
| # test discrete-time | ||
| sisotool(sysdt, tvect=5) | ||
|
|
||
| # test MIMO compatibility | ||
| # sys must be siso or 2 input, 2 output | ||
| with pytest.raises(ControlMIMONotImplemented): | ||
| sisotool(sys221) | ||
| # does not raise an error: | ||
| sisotool(sys222) | ||
|
|
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move these to separate tests.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, thanks for the suggestions. still getting the hang of best practices for testing
| ax_step.lines[0].get_data()[1][:10], step_response_moved, 4) | ||
|
|
||
| # test supply tvect | ||
| sisotool(sys, tvect=np.arange(0, 1, .1)) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if that works
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
