-
Notifications
You must be signed in to change notification settings - Fork 438
fix to insure that when a StateSpace and a LinearIOSystem are combined, the result is a LinearIOSystem #785
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
Conversation
By the way, numeric re-linearization of the system like this is convenient, but probably introduces inaccuracy. Probably the right way to do it in a future PR would be to correctly combine the constituent systems using their A, B, C, and D matrices using the |
I'm not sure this is the best way to fix this issue. If I understand it correctly, it essentially starts putting member functions from the The I need to think a bit more about how else this might be done, perhaps also thinking through the role of the Also, there are a lot of changes that are part of this PR that seem to be related to previous commits. I'm not sure if the changes are based on the main branch or not. |
Seems that a rebase/merge has gone wrong. |
…ed _current_params to iosys class
…e with LinearIO systems
…hat it has dt=None by default, when constructing a LinearIOSystem
588e046
to
98fba6e
Compare
Fixed by force-pushed rebase. @sawyerbfuller you need to reset your local branch before continuing to work on this. |
I agree having duplicate methods doesn't make much sense. To that end, and following the idea that
Might make sense to eventually merge
Fixed, I think. Syncing issues. Thanks @bnavigator |
So I looked through this PR a bit more carefully. It looks to me like there are three different things going on:
I have comments and questions for each, plus an alternative PR #788 that fixes the first two. StateSpace updates I think the issue being addressed here is that if you try to use The proposed fix is to update the I think that a better short term fix is to update the In the long term, we might want to combine Also, as a note, I don't think the included unit tests actually expose the functionality that was broken (they use operator overloading, which works in the current version [I checked]). Adding params to dynamics, output The Note that Also note that in the current implementation, a PR #788 fixes up the parameter processing and adds some unit tests that expose the current bug. Static system determination I can't quite tell what the intention was in changing around some of the code associated with "static" systems, but in looking through the code before and after the change, I think there are some inconsistencies. I think the definition of a "static" system should be that it is a system with no internal state. This is allowed in both the
This is different than the following declaration, which shows up in the proposed unit tests:
Strictly speaking, sys2 is not a static system. It is a 1 state system that is both unobservable and uncontrollable. Confusingly, the existing Also, there is a another problem with the current code, which defines a system to be static if the A and B matrices are zero. That sort of makes sense in continuous time (the state would remain unchanged), but it is not actually correct in discrete time (you would want A to be the identity matrix). And even for a continuous system you could get odd behavior if the C matrix is nonzero and there is a nonzero initial condition (the system is "static", but the input/output response is now affine). I think the proper fix here is to use @sawyerbfuller: Can you provide more info on what the issue was here and your thoughts on how we should define a "static" system? Depending on your response, we can figure out how to fix things. |
Sounds good.
I agree on the idea of merging them.
Yes, I agree that was a bug - by me.
I see, makes sense. What is the difference between
My inclination would be to keep things simple and assume that if somebody wants to update matrix entries, they can do that by creating new A, B, C, D matrices and creating a new
Great : )
Glad this exposed a bug in how a static system is defined. Makes sense to me.
Good catch regarding discrete-time static state-space systems. I agree.
The primary motivation of which I am aware for detecting static systems is to make it convenient to connect them to either discrete-time or continuous-time systems, because they are simply a gain. Currently, any But I imagine it is possible that there are pitfalls to this, and it is not that much to ask that a user always make sure |
For posterity: |
Previously, when a
StateSpace
and aLinearIOSystem
were combined, the result was not aLinearICSystem
becauseStateSpace
systems did not have_rhs
and_out
methods that could be used to re-linearize the system. This has been fixed.