2 %HUP(C) tests if the polynomial C is a Hurwitz-Polynomial.
3 % It tests if all roots lie in the left half of the complex
5 % B=hup(C) is the same as
6 % B=all(real(roots(c))<0) but much faster.
7 % The Algorithm is based on the Routh-Scheme.
8 % C are the elements of the Polynomial
9 % C(1)*X^N + ... + C(N)*X + C(N+1).
11 % HUP2 works also for multiple polynomials,
12 % each row a poly - Yet not tested
15 % F. Gausch "Systemtechnik", Textbook, University of Technology Graz, 1993.
16 % Ch. Langraf and G. Schneider "Elemente der Regeltechnik", Springer Verlag, 1970.
18 % $Id: hup.m 5090 2008-06-05 08:12:04Z schloegl $
19 % Copyright (c) 1995-1998,2008 by Alois Schloegl <a.schloegl@ieee.org>
21 % This program is free software: you can redistribute it and/or modify
22 % it under the terms of the GNU General Public License as published by
23 % the Free Software Foundation, either version 3 of the License, or
24 % (at your option) any later version.
26 % This program is distributed in the hope that it will be useful,
27 % but WITHOUT ANY WARRANTY; without even the implied warranty of
28 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 % GNU General Public License for more details.
31 % You should have received a copy of the GNU General Public License
32 % along with this program. If not, see <http://www.gnu.org/licenses/>.
36 % Strip leading zeros and throw away.
40 % Trailing zeros mean there are roots at zero
49 lambda(b)=c(b,1)./c(b,2);
50 b = b & (lambda>=0) & (lambda<Inf);
51 c=c(:,2:lc)-lambda(:,ones(1,lc-1)).*(c*n(1:lc,1:lc-1));