function conditionNumbers extends Modelica.Icons.Function; import Complex; import Modelica_LinearSystems2.ComplexMathAdds; import Modelica.ComplexMath; import Modelica_LinearSystems2.Math.Matrices; import Modelica.Utilities.Streams.print; input Real K[:, :] "state feedback matrix"; input Complex X[:, :] "right eigenvectors of the closed loop system"; input Complex assignedPoles[size(X, 1)] = fill(Complex(0), size(X, 1)); input Complex calcPoles[size(X, 1)] = fill(Complex(0), size(X, 1)); output Real kappa2X "condition number kappa_2(X) = ||X||_2 * ||inv(X)||_2"; output Real kappaFroX "condition number kappa_F(X) = ||X||_F * ||inv(X)||_F"; output Real kappaFroYT "condition number kappa_F(YT) = ||YT||_F * ||inv(YT)||_F"; output Real cInf "condition number vu1=||c||_inf = max(c_j)"; output Real norm2K "Euclidean norm of the feedback matrix"; output Real normFroK "Frobenius norm of the feedback matrix"; output Real kappa2X_B "condition number by Byers, kappa_2XB(X) = (||X||_F)^2 + (||inv(X)||_F)^2"; output Real JXK[11] "condition number by Varga, JKX=alpha*(kappa2X_B)/2 + (1-alpha)*normFroK^/22"; output Real dl "gap between the assigned and the calculated poles dl=norm(ap-cp)/max(1,norm(ap))"; end conditionNumbers;