-
Notifications
You must be signed in to change notification settings - Fork 438
Updated system class functionality #721
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
Conversation
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
* LTI is NamedIOSystem instead of StateSpace, TransferFunction, and FRD * implement _process_namedio_keywords and use for system/signal name, dt * move timebase functions from lti to namedio * move statesp/_ss code to iosys/ss and iosys/copy to namedio/copy * clean up duplicate object/sysname warnings * updated unit tests
This is a nice re-architecting that gives named signals for tfs and ss systems.
|
I think this was in a previous commit, but the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a refactoring of the code that is used to implement the I/O and LTI systems classes, building on some of the changes started in PR #710 and adding new functionality (and consistency). There are quite a few changes, but everything is either new functionality or backward compatible and so existing code does not need to change.
Summary of changes:
LTI
class to usepoles()
andzeros()
for retrieving poles and zeros, withpole()
andzero()
generating aPendingDeprecationWarning
(which is ignored by default in Python). (The MATLAB compatibility module still usespole()
andzero()
.)TimeResponseData
andFrequencyResponseData
objects now implement ato_pandas()
method that creates a simple pandas dataframe.FrequencyResponseData
class is now used as the output for frequency response produced byfreqresp()
and a new functionfrequency_response
has been defined, to be consistent with theinput_output_response
function. AFrequencyResponseData
object can be assigned to a tuple to provide magnitude, phase, and frequency arrays, mirroringTimeResponseData
functionality from PR Time response data class #649.LTI
class is now a subclass ofNamedIOSystem
(formerly_NamedIOSystem
), which allows state space and transfer functions systems to have system and signal names. In addition, the separate_NamedIOStateSystem
class was eliminated in favor of usingnstates
to distinguish a system with no state space functionality (nstates == None
, used forTransferFunction
andFrequencyResponseData
systems) from a system defined in state space (nstates >= 0
, used forInputOutputSystem
andStateSpace
systems).__repr__
method for NamedIOSystem has been updated to implement the changes in draft PR Change InputOutputSystem repr to show type, name, inputs, and outputs #699 and the__str__
method has been updated for linear I/O system to combine the information for an I/O system and a state space system. In particular, I/O systems are now displayed asSystemClass:sysname:[input_labels]->[output_labels]>
.NamedIOSystem
class (andnamedio.py
) and a common parsing function_process_namedio_keywords()
is used for consistent behavior across system creation functions.drss
,rss
,ss2tf
,tf2ss
,tf2io
, andss2io
functions now all accept system and signal name arguments (via_process_namedio_keywords()
.rss
function can now accept adt
argument and can create either continuous-time or discrete-time random systems. Thedrss
function just callsrss()
withdt=True
.ss
function can now accept function names as arguments, in which case it creates aNonlinearIOSystem
(I'm not sure how useful this is, butss
is a sort of wrapper function that calls the appropriate class constructor, so it was easy enough to implement.)interconnect
function now has awarn_duplicate
flag that can be used to turn on/off warning messages about duplicate objects. The default value isNone
, in which case warnings are suppressed for duplicated systems withgeneric
names (of the formsys[n]
. (The let's you do things likeH = G * G
without getting warning messages for state space systems without specified names.)SystemTrajectory
class for flat systems now has aresponse()
method that generates aTimeDataResponse
object.__array_priority__
class variable to allow the right operand to override the left operand when needed. This mainly affect theFrequencyResponseData
class.The following diagram (from the user documentation) illustrates the relationship between the various classes: