Thu 25 Mar 2010 05:06:12 PM UTC, original submission:
The function is_stabilizable accepts a tolerance
retval = is_stabilizable (A, B, tol, dflg)
but this tolerance is not used when determining if the eigenvalues of A are stable.
Here is an example:
A = -sqrt(eps)/2;
B = 0;
tol = sqrt(eps);
octave:1> retval = is_stabilizable(A,B,tol)
retval = 1
In this case, tol > eig(A) > 0, and therefore (A,B) should be considered not stabilizable.
Below is a patch
##Computing the eigenvalue of A
L = eig (a);
retval = 1;
specflag = 0;
for i = 1:n
if (disc == 0)
## Continuous time case
rL = real (L(i));
if (rL >= -tol)
H = [eye(n)*L(i)-a, b];
f = (rank (H, tol) == n);
if (f == 0)
retval = 0;
if (abs(rL) <= tol)
specflag = 1;
endif
endif
endif
else
## Discrete time case
rL = abs (L(i));
if (rL >= 1-tol)
H = [eye(n)*L(i)-a, b];
f = (rank (H, tol) == n);
if (f == 0)
retval = 0;
if (abs(rL-1) <= tol)
specflag = 1;
endif
endif
endif
endif
endfor
I haven't looked at is_detectable, but I assume this function will need to be similarly changed too.
Thanks,
Brett
|