-
Notifications
You must be signed in to change notification settings - Fork 438
lti.evalfr and sys._evalfr have different behavior #434
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
We definitely need to remove the inconsistency, but I would encourage us to think more broadly and use a more Pythonic approach:
It would be great to get thoughts from others. |
a Presumably a change moving |
Should there be or equivalent ‘call’ for the frequency response of nonlinear iosystems? My first thought is probably not. That ‘call’ should be reserved for the special case (lti systems) where it is useful. |
Not clear what a So I agree with @sawyerbfuller that Any thoughts from others? |
I also agree with all of your considerations. My first thought went into the direction, why use IMHO both should work |
What Richard suggests would be useful for numerical simulation of systems
(eg #83). Maybe it could be accommodated by something like sys.update(x, u)
or sys.xdot(x,u) (not as suitable for discrete time systems), and
sys.output(x, u) methods.
|
A further thought: do you think it would be confusing if
If you wanted to do the same for a state-space system you would just have to turn it into an iosys system. |
I think it would be confusing. Also, it is possible for a system to be both and I/O system and an LTI system (there are capabilities in I/O systems, like naming of signals, that you might want to use even if everything it was LTI). So then it would definitely be confusing. Instead, we might create methods for I/O systems to return the derivative and output (like |
re methods useful for simulating systems: Sounds reasonable. Before I work on a PR to fix
|
See issue #22 for some discussion on this (including many of the things we are discussing above -:). |
OK that makes sense. After thinking it over for awhile, I really like the idea of having a pythonic
Remarks:
|
👍
'now' being 0.9: 👍
👍
👍
If it affects just the use of one function, which can be replaced by another function call, I don't think a legacy setting is necessary. Downstream code has to be changed anyway. Instead of introducing the setting to legacy defaults, they can just replace the
It is new functionality. Document it properly and it should be fine. I would rather have FRD objects behave in the same way as TF and SS objects in that regard other than creating a special case.
👍 |
Following @bnavigator's thoughts, I think it makes sense to add Any other thoughts on simply removing |
The
evalfr
function in thelti
module expects a complex number and evaluates the system at that complex frequency. The methodsys._evalfr
, on the other hand, where sys is a transfer function or state space system, expects a real argument and multiplies it by j before evaluating the frequency response.Is this dichotomy intentional?
evalfr
function expects a complex number, which seems like a more general-purpose solution.sys.freqresp
expects real-valued omega arguments, making it perhaps a better interface for userssys._evalfr
correctly performs the z-plane transformation for discrete-time systems.The text was updated successfully, but these errors were encountered: