I'm trying to find the eigenvalues of a matrix H manually, where H represents some system dynamics.
(The system is defined by H, so eigs are solutions to det(H-lamba*I) = 0)
Once i find those eigs, i input them to acker() for pole placement to find gains.
(1) Why am i getting an error when inputting what i think are a set of normal numbers to acker()? See code below.
Note: I compare this to the normal eig(H) results to see if it's working, so i can see the normal method works with acker().
(2) Why is vpa() needed, ie why is solve() returning functions of z? I thought solve() would return numbers, since it's just trying to find solutions to det(H-lamba*I) = 0), which evaluates to:
lam^6 - 15999360000*lam^4 + 16000160000000000*lam^2 - 160000000000000000000000 == 0
and that seems like returned solutions should be just normal complex numbers.
Aaug = [A, zeros(2,1); -C, 0];
H = 1.0e+12 * [0 0.000000000001000 0 0 0 0;
-0.000000400000000 -0.000000000400000 0 0 -0.160000000000000 0;
-0.000000000001000 0 0 0 0 0;
-0.000000100000000 0 0 0 0.000000400000000 0.000000000001000;
0 -0.000000000000100 0 -0.000000000001000 0.000000000400000 0;
0 0 -1.000000000000000 0 0 0];
eigs1 = eig(H)
eigs1 =
1.0e+05 *
-1.2648 + 0.0000i
1.2648 + 0.0000i
-0.0135 + 0.0115i
-0.0135 - 0.0115i
0.0135 + 0.0115i
0.0135 - 0.0115i
whichNegEig = find(real(eigs1)<0);
K = acker(Aaug, Baug, eigs1(whichNegEig))
K =
1.0e+06 *
0.0009 0.0000 -1.0000
sysDet = det(H - lam*eye(size(H)));
polySys = solve(sysDet == 0, lam)
polySys =
eigs2= vpa(polySys)
eigs2 =
whichNegEig2 = find(real(eigs2)<0);
eigs2(whichNegEig2)
ans =
K2 = acker(Aaug, Baug, eigs2(whichNegEig2))
Error using sym/poly
SYM/POLY has been removed. Use CHARPOLY instead.
Error in acker (line 41)
k = ctrb(a,b)\polyvalm(real(poly(p)),a);