-
Notifications
You must be signed in to change notification settings - Fork 89
WIP: Robust toolbox dev #192
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
This branch is now up to date with local changes, and now includes a robust bilinear transformation for discrete time synthesis as well as tests for some of the code.
…detailing the intended structure of the tests and all of the points which are to be tested.
…ma, required to check the stabilizability conditions for applying the dual ARE-method
…bility and detectability checks
…ge in the assumptions check of necessary in the dual Riccati approach
…erses are done correctly, a necessary compnent for checking the assumptions which have to be satisfied before proceeding with the H-infinity synthesis
…in the psudoinverse compuatation method
…throws a method error when using non-matrix types as arguments
…nverse exists when the matrix M is rank deficient
…ts that establish the spectral radius condition to be handled correctly
…n-feasible when violating the positive definiteness check
…from continuous to discrete- and back to continuous-time works, as well as discrete- to continuous- to discrete-time. Works simply means that the frequency response matches across a set of 1001 discrete points in the frequency domain.Test that the SS-type data is discretized correctly, and that moving from continuous to discrete- and back to continuous-time works, as well as discrete- to continuous- to discrete-time. Works simply means that the frequency response matches across a set of 1001 discrete points in the frequency domain.
… resulting controller
…he resulting controller in the MIT open courseware example
…that the code runs
… in the quadtank example
…pose matrices with size zero
…nst the resulting closed loop transfer functions
…nction to visualize the synthesized controllers
example/hinf_example_MIMO.jl
Outdated
WSe = tf([0.1,1],[1000,1]) | ||
#WS = [WSe 0 0 ; 0 WSe 0 ; 0 0 WSe] | ||
WS = [WSe 0 0 0 ; 0 WSe 0 0 ; 0 0 WSe 0 ; 0 0 0 WSe] | ||
WS = [WS 0*WS; WS*0 WS] |
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.
Perhaps best to try to avoid redefining local variables.
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.
Thanks, the general MIMO example should be removed, as it is currently dysfunctional - I have yet to add a loop shift in the controller synthesis - I'll remove this script in its entirety for now.
below, and is best read alongside the complementary report in [2] | ||
(mgreiff2019report). For the LMI-experiments see the third bibentry [3]. | ||
|
||
@article{glover1988state, |
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.
How should we reference papers @mfalt , @baggepinnen ? Is this reasonable, or perhaps something a bit more concise?
src/hinfinity_design.jl
Outdated
A, B1, B2, C1, C2, D11, D12, D21, D22 = ssdata(P) | ||
|
||
# Check assumption A1 | ||
if !_is_stabilizable(A, B2) |
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.
Should we consider making is_stabilizable
a publicly available?
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.
Quite possibly, and I think that the bilinear discretization could be useful outside of the hinf_design module too, and should probably be implemented in the c2d() function. Similarly, we also have its inverse in bilineard2c(), which could be implemented in some function d2c().
I can start to migrate the functions to discrete.jl and matrix_comp.jl if you like.
src/hinfinity_design.jl
Outdated
min(size(M))==rank(M). Used for checking assumptions A5 and A6 in [1], see the | ||
section on the generalized | ||
""" | ||
function _compute_pseudoinverse(M::AbstractMatrix) |
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.
Does pinv
work here?
Is this function (or enclosing function) somewhat performance critical? If so, there are some issues like type stability and inv
insead of /
that we should consider.
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.
Thanks, pinv works and has now been implemented instead of the _compute_pseudoinverse() function!
Some random comments
|
src/hinfinity_design.jl
Outdated
future revisions, we could suggest possible changes to P should the system not | ||
be feasible for synthesis. However, this has not been too successful so far..! | ||
""" | ||
function hInf_assumptions(P::ExtendedStateSpace; verbose=true) |
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.
Preferable with consistent function naming https://docs.julialang.org/en/v1/manual/style-guide/index.html
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.
Thanks for linking the style guide. All function names have been changed, and hopefully, they are now compliant with the style guide.
src/hinfinity_design.jl
Outdated
end | ||
return false | ||
end | ||
if !_is_detectable(A, C2) |
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.
We have
is_detectable(A, C) = is_stabilizable(A', C')
Good to avoid redundant code. Should there be a function is_detectable
defined according to this, or should we just use is_stabilizable(A', C')
here?
HX = [A zeros(size(A)); -C1'*C1 -A'] - ([B; -C1'*D1dot]/R)*[D1dot'*C1 B']; | ||
HY = [A' zeros(size(A)); -B1*B1' -A] - ([C';-B1*Ddot1']/Rbar)*[Ddot1*B1' C]; | ||
|
||
# Solve matrix equations |
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.
Perhaps try to avoid redundant code by using the existing care
method.
src/hinfinity_design.jl
Outdated
min(size(M))==rank(M). Used for checking assumptions A5 and A6 in [1], see the | ||
section on the generalized | ||
""" | ||
function _compute_pseudoinverse(M::AbstractMatrix) |
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 the existing pinv
in Julia is not acceptable it would be a great with a comment why this is the case.
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.
Very good point - it is definitely acceptable, and I have now removed the compute_pseudoinverse function.
Is MIMO still broken? |
Let's discuss the changes here.