The example system has been taken from [1, Example 2]. The eigenvalue placement with minimum Frobenium norm is discussed in [2, Example 2]. The poles should be placed at -3, -3, -4, i.e., we want to have a double eigenvalue.
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,[[0, 1, 0],[19.62, 0, -8.86],[0, 0, -100]])
B = matrix(R,[[0, -1],[0, 1],[1, 0]])
C = matrix(R,[[1, 0, 2],[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+3)
q2,r2 = q1.quo_rem(s+3)
q3,r3 = q2.quo_rem(s+4)
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 - 461/10*k22*l1 - 301/10*l1 - 12*l2 + 2*l3 1 : k12 : 2*k12*l0 + 461/10*k21*l1 + 443/25*l1 - 443/50*l2 2 : k21 : 461/10*k12*l1 + 2*k21*l0 + 388*l1 - 93*l2 - l3 3 : k22 : -461/10*k11*l1 + 2*k22*l0 - 90307/50*l1 - 931/50*l2 4 : l0 : k11^2 + k12^2 + k21^2 + k22^2 - q 5 : l1 : -461/10*k11*k22 - 301/10*k11 + 461/10*k12*k21 + 443/25*k12 + 388*k21 - 90307/50*k22 - 51507/50 6 : l2 : -12*k11 - 443/50*k12 - 93*k21 - 931/50*k22 - 29631/50 7 : l3 : 2*k11 - k21 + 90 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[1]
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)
v = A0.eigenvalues()
v
Verification of the closed-loop eigenvalues: Real parts of numerically computed eigenvlues
vector([x.real() for x in v])