This function checks whether a MIMO state space system is detectable or not.
A system is detectable for the continuous-time case if all of the unobservable eigenvalues have negative real part or for the discrete-time case if all of the unobservable eigenvalues are in the complex unit circle respectively. Hence, a observable system is always detectable of course.
To check detectability, staircase algorithm is used to separate the observable subspace from the unobservable subspace. The unobservable poles are checked to be stable.
encapsulated function isDetectableMIMO import Modelica; import Modelica.ComplexMath.j; import Complex; import Modelica_LinearSystems2; import Modelica_LinearSystems2.StateSpace; input StateSpace ss "State space system"; output Boolean detectable; end isDetectableMIMO;