-
Notifications
You must be signed in to change notification settings - Fork 441
update use/computation of sys._isstatic() #1117
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
update use/computation of sys._isstatic() #1117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. But a question that comes to mind is should tf’s new _isstatic method get put in iosys.py instead (and the explanatory comment moved to its init)? If so, I think NonlinearIOSystem should also get a _static field. Statesp.py also suffers from multiple implementations of isstatic (the first when the dt field is processed in process_io_keywords) but this may just be unavoidable complexity.
One thing to consider is terminology : is a time-varying stateless system considered to be static?
I asked ChatGPT how we should think about "static". I thought the answer was pretty good:
Based on that, I think we should adopt the following definition: A static I/O system model is a model in which the output |
Also, I've looked into where this concept is used. There are a couple of instances:
|
d99ac61
to
ce77e6b
Compare
Looks good, with just a couple of clarifying questions. |
Nice. and pretty good answer. It looks like Matlab has an isstatic function, perhaps a future PR could turn |
I thought about making |
This small PR addresses #1090, where there was a redundant calculation for whether a transfer function is static (constant) or not.
This fixes that by saving the computation done ininit
and using it later ifsys._isstatic()
is called. I also found a spot innlsys
where there was a (simple) redundant computation, so converted that to a call tosys._isstatic()
.Following the discussion below, the current PR does the following:
_isstatic()
method fromInputOutputSystem
toNonlinearIOSystem
andTransferFunction
. This is because the way in which the checks are done is different for systems with a state versus transfer functions.NonlinearIOSystem
(includingStateSpace
, which is a subclass), a systemsys
is static ifsys.nstates
is zero, so this is what_isstatic()
checks.TransferFunction
, a systemsys
is static if the numerator and denominator polynomials are all zero order. This is computed when the system is constructed and store in the private instance variable_static
.FrequencyResponseData
, the_isstatic()
method is not defined (mainly because it isn't used anywhere).The main uses of the static property for a system are described in more detail in the comments below.