-
Notifications
You must be signed in to change notification settings - Fork 438
use dt=0 instead of dt=None (unspecified timebase) as default option for lti systems? #422
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
Comments
It's a relic from Matlab with some very old historic reasons but survived under backwards-compatibility flow. Then apparently adopted also here. Internally matlab secretly inserts some default value (that I forgot) whenever dt is needed anyways. My take on this is that user should insert some random value if they don't care because they don't care or defaulys should map to dt=0.01 to be slightly realistic. |
I think I was the person who used dt=None. The motivation was a bit different: if someone didn't specify whether the system was continuous or discrete, we wanted to allow as much flexibility as possible. So, for example, if you combine a system without a timebase (dt=None) with one that has a time base (dt=0, dt=True, dt=0.1, etc) then the first system will assume the time base of the other. This probably doesn't matter that much, though it is handy for systems that are constants (no states). The current approach is documented here. I would like to see a bit more discussion of this before we make a change, since it may break people's code. |
Hi Richard, makes sense that dt=None that could be very useful for systems that are a static gain. Could dt=None be a special case that is used by default when constructing such systems? Looks like in matlab that the default is dt=0 (continuous time). with an option to set it to -1 to be unspecified if desired: https://www.mathworks.com/help/control/ref/tf.html#f4-209775_sep_mw_ec86807c-5450-4be4-ae9a-e85042c27676 I couldn’t find any examples of systems using an unspecified time base online after a quick search. |
Does anybody here have code that would break if dt=0 were the default instead of dt=None? |
One other possibility is to set up a package wide configuration variable that sets the default system type. I've been thinking that as we make various changes to defaults and other parameters, we might create a function |
I was wondering if somebody could tell me the motivation behind the current convention for default initialization of LTI systems to have dt=None? Using dt=None means an unspecified time base, allowing the system to be interpreted either as cont or discrete time. (I couldn't find any discussion of this but please let me know if I missed it).
A system with an unspecified dt seems to be an unusual object:
Have you thought about using a default of dt=0 (continuous time), and leave the dt=None case be a special case, to be instantiated only when needed? (Issue #419 made me think of this and is related)
The text was updated successfully, but these errors were encountered: