The example system has been taken from [1, Example 1]. The eigenvalue placement with minimum Frobenium norm is discussed in [2, Example 1]. The poles should be placed at -1, -2, -3, i.e., we want to have distinct real eigenvalues.
In UKACC Control Conference, URL: https://www.researchgate.net/publication/267424630_An_Approach_to_Pole_Placement_Method_with_Output_Feedback
2. Röbenack, K.; Gerbet, D.: Minimum Norm Partial Eigenvalue Placement for Static Output Feedback Control.
International Conference on System Theory, Control and Computing (ICSTCC),
October 20-23, 2021, Iași, Romania
Polynomial ring
%display latex
R.<k11,k12,k21,k22,s,l0,l1,l2,l3,q> = PolynomialRing(QQ, order='lex')
R
State space system
A = matrix(R,[[-11.4, -3.5, 0],[4, 0, 0],[0, 1, 0]])
B = matrix(R,[[2,1],[0,-1],[0,0]])
C = matrix(R,[[1,0,1.425],[1,-1,0]])
(A,B,C)
Symbolic feedback matrix
K = matrix(R,[[k11,k12],[k21,k22]])
K
Closed-loop characteristic polynomial
CP = det(s*matrix.identity(3)-(A-B*K*C))
CP
Remainders of polynomial division for an eigenvalue placement at -1, -2, -3
q1,r1 = CP.quo_rem(s+1)
q2,r2 = q1.quo_rem(s+2)
q3,r3 = q2.quo_rem(s+3)
r1,r2,r3
Lagrangian function
L = q + l0*(k11^2+k12^2+k21^2+k22^2-q) + l1*r1 + l2*r2 + l3*r3
L
Neccessary optimility condition and associated polynomial ideal
vars = [k11,k12,k21,k22,l0,l1,l2,l3,q]
PLIST = []
for ii in range(len(vars)):
print(ii," : ",vars[ii]," : ",diff(L,vars[ii]))
PLIST.append(diff(L,vars[ii]))
I = Ideal(PLIST)
I
0 : k11 : 2*k11*l0 + 17/20*k22*l1 + 2*k22*l2 + 67/5*l1 - 6*l2 + 2*l3 1 : k12 : 2*k12*l0 - 17/20*k21*l1 - 2*k21*l2 + 10*l1 - 14*l2 + 2*l3 2 : k21 : -17/20*k12*l1 - 2*k12*l2 + 2*k21*l0 - 581/50*l1 - 37/40*l2 + l3 3 : k22 : 17/20*k11*l1 + 2*k11*l2 + 2*k22*l0 - 89/10*l1 + 49/10*l2 + 2*l3 4 : l0 : k11^2 + k12^2 + k21^2 + k22^2 - q 5 : l1 : 17/20*k11*k22 + 67/5*k11 - 17/20*k12*k21 + 10*k12 - 581/50*k21 - 89/10*k22 - 18/5 6 : l2 : 2*k11*k22 - 6*k11 - 2*k12*k21 - 14*k12 - 37/40*k21 + 49/10*k22 - 66/5 7 : l3 : 2*k11 + 2*k12 + k21 + 2*k22 + 27/5 8 : q : -l0 + 1
Elimination ideal
J0 = I.elimination_ideal([k11,k12,k21,k22,l0,l1,l2,l3])
J0
Computation of possible solutions w.r.t. q
J0.change_ring(PolynomialRing(RR, 'q')).gens()[0].roots()
Selection of the minimum solution q
qmin = J0.change_ring(PolynomialRing(RR, 'q')).gens()[0].roots()[0][0]
qmin
Dimension of the polynomial ideal
I.dimension()
For the direct computation of the algebraic variety, we need a 0-dimensional ideal. To achieve this, we omit the variable s
I0 = I.change_ring(PolynomialRing(QQ,'k11,k12,k21,k22,l0,l1,l2,l3,q'))
sol = I0.variety(QQbar)
sol
Selection of the solution to be used
lx = sol[0]
lx
Numerical feedback gain matrix
K0 = K.subs(k11=RR(lx['k11']),k12=RR(lx['k12']),
k21=RR(lx['k21']),k22=RR(lx['k22']))
K0
Frobenius norm of the computed feedback matrix
K0.norm('frob')
Verification of the closed-loop eigenvalues (over the rational field)
A0 = matrix(QQ,A-B*K0*C)
A0.eigenvalues()
Verification of the closed-loop eigenvalues (as floating point numbers)
A0 = matrix(RDF,A-B*K0*C)
A0.eigenvalues()