JuliaControl / ControlSystems.jl

A Control Systems Toolbox for Julia
https://juliacontrol.github.io/ControlSystems.jl/stable/
Other
510 stars 85 forks source link

handle proper quotient of proper statespace systems #906

Closed baggepinnen closed 10 months ago

baggepinnen commented 10 months ago

The PR adds a method of / between two statespace systems $$G_2 G_1^{-1}$$ that handles situations in which $G_1^{-1}$ s non-proper and naive inversion fails, but the quotient $G_2 G_1^{-1}$ is proper and can be represented as a statespace system.

The intermediate result is a descriptor system with non-identity and singular mass matrix Ei which is immediately simplified using MatrixPencils.lsminreal into a descriptor system with invertible mass matrix (if possible). This system is in turn simplified to have unit mass matrix. If the quotient isn't proper, at least one of the steps above will fail and throw an error The system sys2 is not invertible.

The call to lsminreal will generally lead to a smaller realization compared to what was returned before. This is the reason the test

C_221/C_222_d == SS([-5 -3 -1 0; 2 -9 -0 -2; 0 0 -6 -3;
        0 0 2 -11],[1 0; 0 2; 1 0; 0 2],[1 0 0 0],[0 0])

was changed to compare the H-infnorm, we now return a second-order system instead of 4:th order.

codecov[bot] commented 10 months ago

Codecov Report

Attention: 33 lines in your changes are missing coverage. Please review.

Comparison is base (27c1b00) 4.02% compared to head (2b41c29) 33.52%.

:exclamation: Current head 2b41c29 differs from pull request most recent head 313d2b4. Consider uploading reports for the commit 313d2b4 to get more accurate results

Files Patch % Lines
lib/ControlSystemsBase/src/types/StateSpace.jl 0.00% 33 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #906 +/- ## =========================================== + Coverage 4.02% 33.52% +29.50% =========================================== Files 41 42 +1 Lines 4623 4698 +75 =========================================== + Hits 186 1575 +1389 + Misses 4437 3123 -1314 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.