Skip to content
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

WIP: Robust toolbox dev #192

Closed
wants to merge 66 commits into from
Closed

Conversation

mfalt
Copy link
Member

@mfalt mfalt commented Mar 4, 2019

Let's discuss the changes here.

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
…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
…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.
…he resulting controller in the MIT open courseware example
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]
Copy link
Contributor

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.

Copy link

@mgreiff mgreiff Mar 4, 2019

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,
Copy link
Contributor

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?

A, B1, B2, C1, C2, D11, D12, D21, D22 = ssdata(P)

# Check assumption A1
if !_is_stabilizable(A, B2)
Copy link
Member Author

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?

Copy link

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.

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)
Copy link
Member Author

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.

Copy link

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!

@mfalt
Copy link
Member Author

mfalt commented Mar 4, 2019

Some random comments

  • All the examples (pdfs) should probably be put in https://github.com/JuliaControl/ControlExamples.jl
  • Some sort of rebase? would probably be smart to keep the binaries out of the git history?, and to avoid conflics with changes that have been made since you created your branch. (For example in make.jl, makeplots.jl, plotting.jl)
  • Should make indentation consistent (for example in @recipe function specificationplot)
  • We should discuss if we should merge/separate ExtendedStateSpace and PartionedStateSpace (from delayed_lti branch)

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)
Copy link
Contributor

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

Copy link

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.

end
return false
end
if !_is_detectable(A, C2)
Copy link
Contributor

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
Copy link
Contributor

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.

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)
Copy link
Contributor

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.

Copy link

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.

@freemin7
Copy link
Contributor

Is MIMO still broken?
How stale is the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants