The example system has been taken from [1, Example 3]. The eigenvalue placement with minimum Frobenium norm is discussed in [2, 3]. The poles should be placed at −3,−4,−5,−2±2j, i.e., we want to have a conjugate complex pair.
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,k31,k32,s,l0,l1,l2,l3,l4,l5,q> = PolynomialRing(QQ, order='lex')
R
State space system
A = matrix(R,[[0,1,0,0,0],
[0,0,1,0,0],
[0,0,0,1,0],
[0,0,0,0,1],
[0,0,0,0,0]])
B = matrix(R,[[1,0,0],[1,0,0],[0,1,0],[0,1,0],[0,0,1]])
C = matrix(R,[[1,0,0,0,0],[0,1,0,0,0]])
(A,B,C)
Symbolic feedback matrix
K = matrix(R,[[k11,k12],[k21,k22],[k31,k32]])
K
Closed-loop characteristic polynomial
CP = det(s*matrix.identity(5)-(A-B*K*C))
CP
Remainders of polynomial division for an eigenvalue placement at −3,−4,−5,−2±2j
q1,r1 = CP.quo_rem(s+5)
q2,r2 = q1.quo_rem(s+4)
q3,r3 = q2.quo_rem(s+3)
q4,r4 = q3.quo_rem(s^2 + 4*s + 8)
r4a = r4.coefficient({s:0})
r4b = r4.coefficient({s:1})
Lagrangian function
L = q + l0*(k11^2+k12^2+k21^2+k22^2+k31^2+k32^2-q) + l1*r1 + l2*r2 + l3*r3 + l4*r4a + l5*r4b
L
Neccessary optimility condition and associated polynomial ideal
vars = [k11,k12,k21,k22,k31,k32,l0,l1,l2,l3,l4,l5,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 + 20*k22*l1 - 8*k22*l2 + k22*l3 + k32*l1 + 500*l1 - 308*l2 + 85*l3 - 11*l4 + l5 1 : k12 : 2*k12*l0 - 20*k21*l1 + 8*k21*l2 - k21*l3 - k31*l1 + 625*l1 - 369*l2 + 97*l3 - 12*l4 + l5 2 : k21 : -20*k12*l1 + 8*k12*l2 - k12*l3 + 2*k21*l0 + 20*l1 - 8*l2 + l3 3 : k22 : 20*k11*l1 - 8*k11*l2 + k11*l3 + 2*k22*l0 - 100*l1 + 52*l2 - 11*l3 + l4 4 : k31 : -k12*l1 + 2*k31*l0 + l1 5 : k32 : k11*l1 + 2*k32*l0 - 5*l1 + l2 6 : l0 : k11^2 + k12^2 + k21^2 + k22^2 + k31^2 + k32^2 - q 7 : l1 : 20*k11*k22 + k11*k32 + 500*k11 - 20*k12*k21 - k12*k31 + 625*k12 + 20*k21 - 100*k22 + k31 - 5*k32 - 3125 8 : l2 : -8*k11*k22 - 308*k11 + 8*k12*k21 - 369*k12 - 8*k21 + 52*k22 + k32 + 2101 9 : l3 : k11*k22 + 85*k11 - k12*k21 + 97*k12 + k21 - 11*k22 - 660 10 : l4 : -11*k11 - 12*k12 + k22 + 89 11 : l5 : k11 + k12 - 16 12 : q : -l0 + 1
Dimension of the ideal
I.dimension()
Change of the ring (without the variable s), dimension of the new ideal over the new ring
J = I.change_ring(PolynomialRing(QQ, 'k11,k12,k21,k22,k31,k32,l0,l1,l2,l3,l4,l5,q'))
J.dimension()
Algebraic variety, computation of possible solutions w.r.t. q
lsg = J.variety(QQbar)
lsg
Selection of the minimum solution q
lx = lsg[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']),
k31=RR(lx['k31']),k32=RR(lx['k32']))
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()