The example system has been taken from [1, Example 4.2]. The eigenvalue placement with minimum Frobenium norm is discussed in [2, Example 4]. The open-loop system has eigenvlaues at ±1, ±2. We want to place two eigenvalues at -3 and -4, i.e., we carry out a partial eigenvalue assignment.
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,q> = PolynomialRing(QQ, order='lex')
R
State space system
A = matrix(R,[[-1,0,0,0],
[0,-2,0,0],
[0,0,1,0],
[0,0,0,2]])
B = matrix(R,[[1,0],[1,0],[1,1],[1,0]])
C = matrix(R,[[1,1,1,1],[0,0,0,1]])
(A,B,C)
Symbolic feedback matrix
K = matrix(R,[[k11,k12],[k21,k22]])
K
Closed-loop characteristic polynomial
CP = det(s*matrix.identity(4)-(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+3)
q2,r2 = CP.quo_rem(s+4)
[r1,r2]
Lagrangian function
L = q + l0*(k11^2+k12^2+k21^2+k22^2-q) + l1*r1 + l2*r2
L
Neccessary optimility condition and associated polynomial ideal
vars = [k11,k12,k21,k22,l0,l1,l2,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 - 2*k22*l1 - 6*k22*l2 - 78*l1 - 216*l2 1 : k12 : 2*k12*l0 + 2*k21*l1 + 6*k21*l2 - 8*l1 - 30*l2 2 : k21 : 2*k12*l1 + 6*k12*l2 + 2*k21*l0 - 10*l1 - 36*l2 3 : k22 : -2*k11*l1 - 6*k11*l2 + 2*k22*l0 4 : l0 : k11^2 + k12^2 + k21^2 + k22^2 - q 5 : l1 : -2*k11*k22 - 78*k11 + 2*k12*k21 - 8*k12 - 10*k21 + 40 6 : l2 : -6*k11*k22 - 216*k11 + 6*k12*k21 - 30*k12 - 36*k21 + 180 7 : 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,l0,l1,l2,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']))
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()