-
Notifications
You must be signed in to change notification settings - Fork 89
use timeevol types to dispatch matrix equations #629
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
|
Something failed when generating plots. See the log at https://github.com/JuliaControl/ControlExamplePlots.jl/actions/runs/1773457593?check_suite_focus=true for more details. |
Codecov Report
@@ Coverage Diff @@
## master #629 +/- ##
==========================================
+ Coverage 86.66% 86.73% +0.06%
==========================================
Files 31 31
Lines 3233 3248 +15
==========================================
+ Hits 2802 2817 +15
Misses 431 431
Continue to review full report at Codecov.
|
e04d2f9 to
b792828
Compare
| Q = I | ||
| R = I | ||
| L = dlqr(A,B,Q,R) # lqr(sys,Q,R) can also be used | ||
| L = lqr(Discrete,A,B,Q,R) # lqr(sys,Q,R) can also be used |
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.
I haven't really followed the discussion about these changes, but to me it feels slightly strange with Discrete as first argument. But I guess you always have to supply an argument, we don't want to make one default?
The other one where you send in a system looks nice, so maybe it makes sense that the system information comes in with the leftmost argument in some type of consistency with that.
Nothing I have strong feelings about, just reacted to it and unsure if there are good alternatives (I don't have any that I think are really better)
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.
Having one as default is part of what we're trying to get away from, since lqr(sys) and lqr(A, B) then not mean the same if the system is discrete. The idea here was to use the name lqr rather than lqr/lqrd and at the same time allow for dispatch on sys.timeevol rather than having manual if isdiscrete(sys) everywhere.
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.
Yeah, makes sense.
| This function exists for legacy reasons, users are encouraged to use the interface `are(Continuous, A, B, Q, R)` instead. | ||
| """ | ||
| function care(A, B, Q, R) | ||
| function are(::ContinuousType, A::AbstractMatrix, B, Q, R) |
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.
Why type on A but not the others?
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.
I assume there is a reason since I see it is done on a few more spots, just curios and want to understand :)
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.
If I do not type the A, there is a method ambiguity when A isa Number between this method and the method that takes are(t::TimeEvolType, A::Number, ...), since TimeEvolType is less strict than ContinuousType.
albheim
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.
LGTM
This PR "soft deprecates" the matrix-equation solver interfaces that distinguish between continuous/discrete time by means of a prefix
c/din favor of function that dispatch on theTimeEvoltype.and so on. This avoids the previously common
Instead, we may now use
where
teis thesys.timeevolfield (type or instance, both work).I say "soft deprecate" since the old methods are still there, their use is just discouraged in the docstring.
Supersedes #563