I/O system class restructuring#916
Conversation
sawyerbfuller
left a comment
There was a problem hiding this comment.
A big drop - this looks great.
My only real concern is in regards to the tf2io and ss2io functions - are they implemented somehwere with a deprecation warning?
|
@sawyerbfuller I put back ss2io and tf2io. If you have a chance, try running this against some of your existing code to just confirm it works as expected (and to see what else you end up needing to change, if anything). |
24d7309 to
fc19cd6
Compare
|
Ok just checked through and pretty much everything I have works with this new code, bravo! (and bravo unit tests!). The two exceptions I found were:
sys = ct.interconnect([ct.ss(ct.drss(3,1, 1, dt=0.2), inputs='e', outputs='u'),
ct.ss(ct.drss(3,1, 1, dt=0.2), inputs='u', outputs='y')],
inputs='e', outputs='y')
sys.frequency_response(22)raises
|
|
The "bug" in the (note that you can also just call Fix for #1 is on its way. |
This PR restructures the input/output systems classes as described in issue #904 and summarized in the following diagram:
In addition, a number of deprecated functions were removed and various other changes related to I/O systems were made.
Summary of major changes:
NamedIOSystemclass has been renamedInputOutputSystemand serves as the parent class for all input/output system classes.LinearIOSystemsclass has been merged into theStateSpaceclass.NonlinearIOSystemcan now be created using thenlsys()factory function (instead of using the class name, so more likessandtf).series,parallel,feedback,append,neg) now work on all I/O system classes, including nonlinear systems.initial_response,step_response,forced_response) will now work for nonlinear functions (via an internal call toinput_output_response).impulse_responsefunction only works forLTIsystems.impulse_responsefunction no longer accepts theX0keyword.initial_responsefunction no longer accepts theinputkeyword.step_responsefunction still accepts theX0keyword (to allow for non-zero equilibrium points for nonlinear systems).__str__()method for I/O system classes now includes the name of the system and signals (viaInputOutputSystem.__str__()).ss2io,tf2io.pole,zero,LTI.{inputs,outputs, pole, zero},timebaseEqual. (Thepole()andzero()functions are still available in the MATLAB compatibility module,control.matlab.)connectfunction generates aDeprecationWarning(useinterconnectinstead).namediomodule are now in theiosysmodule.What you will need to change to run version 0.10.0 (this should go in the release notes):
LinearIOSystemclass with theStateSpaceclass.pole()andzero()withpoles()andzeros().Additional recommended changes:
ss2ioortf2iowith calls tossortf, including moving signal and system naming parameters into thessortfcall.StateSpace,TransferFunction, andNonlinearIOSystemwith calls to the equivalent factory functions:ss(),tf(),nlsys().