- Notifications
You must be signed in to change notification settings - Fork446
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
coveralls commentedFeb 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
sawyerbfuller left a comment
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?
Uh oh!
There was an error while loading.Please reload this page.
murrayrm commentedFeb 3, 2025
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 |
murrayrm commentedFeb 3, 2025
Also, I've looked into where this concept is used. There are a couple of instances:
|
d99ac61 toce77e6bComparesawyerbfuller commentedFeb 4, 2025
Looks good, with just a couple of clarifying questions. |
sawyerbfuller commentedFeb 4, 2025
Nice. and pretty good answer. It looks like Matlab has an isstatic function, perhaps a future PR could turn |
murrayrm commentedFeb 5, 2025
I thought about making |
cf77f99 intopython-control:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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 ininitand using it later ifsys._isstatic()is called. I also found a spot innlsyswhere 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 fromInputOutputSystemtoNonlinearIOSystemandTransferFunction. 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 systemsysis static ifsys.nstatesis zero, so this is what_isstatic()checks.TransferFunction, a systemsysis 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.