Computes the gain vector k for the state space system
ss = StateSpace(A=[-1,1;0,-2],B=[0, 1],C=[1,0; 0, 1],D=[0; 0])such that for the state feedback
u = -k*y = -k*xthe closed-loop poles are placed at
p = {-3,-4}.
function testPoleAssignment3 extends Modelica.Icons.Function; import Complex; import Modelica_LinearSystems2.ComplexMathAdds; import Re = Modelica.ComplexMath.real; import Im = Modelica.ComplexMath.imag; import Modelica_LinearSystems2.Math.Matrices; import Modelica_LinearSystems2.WorkInProgress.Tests.Design; import Modelica.Utilities.Streams.print; import Modelica_LinearSystems2.WorkInProgress.Tests.Internal.DesignData; import Modelica_LinearSystems2.StateSpace; input DesignData data = Design.DesignData_Chow_Kokotovic(); input Types.AssignPolesMethod method = Tests.Types.AssignPolesMethod.KNV "method for pole assignment"; input Boolean isSI = true; output Real K[size(data.B, 2), size(data.A, 1)] "Feedback gain matrix"; output Complex calcPoles[size(data.A, 1)]; output Real kappa2 "condition number kappa_2(X) = ||X||_2 * ||inv(X)||_2"; output Real kappaF "condition number kappa_F(X) = ||X||_F * ||inv(X)||_F"; output Real zeta "condition number by Byers, zeta(X) = (||X||_F)^2 + (||inv(X)||_F)^2"; output Real cInf "condition number vu1=||c||_inf = max(c_j)"; output Real nu2 "Euclidean norm of the feedback matrix"; output Real nuF "Frobenius norm of the feedback matrix"; output Real dlambda "Distance between the assigned and the calculated poles"; output Real gap = 0.0; output Real Jalpha[11] "Combined condition number, JKX=alpha/2*(kappa2X_B) + (1-alpha)/2*normFroK^2"; output Complex X[:, :] "right eigenvectors of the closed loop system"; end testPoleAssignment3;