7017
|
1 ## Copyright (C) 1993, 1994, 1995, 2000, 2002, 2003, 2004, 2005, 2006, |
|
2 ## 2007 Auburn University. All rights reserved. |
3441
|
3 ## |
|
4 ## This file is part of Octave. |
|
5 ## |
|
6 ## Octave is free software; you can redistribute it and/or modify it |
7016
|
7 ## under the terms of the GNU General Public License as published by |
|
8 ## the Free Software Foundation; either version 3 of the License, or (at |
|
9 ## your option) any later version. |
3441
|
10 ## |
7016
|
11 ## Octave is distributed in the hope that it will be useful, but |
|
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 ## General Public License for more details. |
3441
|
15 ## |
|
16 ## You should have received a copy of the GNU General Public License |
7016
|
17 ## along with Octave; see the file COPYING. If not, see |
|
18 ## <http://www.gnu.org/licenses/>. |
3441
|
19 |
|
20 ## -*- texinfo -*- |
4611
|
21 ## @deftypefn {Function File} {@var{retval} =} is_detectable (@var{a}, @var{c}, @var{tol}, @var{dflg}) |
|
22 ## @deftypefnx {Function File} {@var{retval} =} is_detectable (@var{sys}, @var{tol}) |
7007
|
23 ## Test for detectability (observability of unstable modes) of (@var{a}, @var{c}). |
3441
|
24 ## |
4855
|
25 ## Returns 1 if the system @var{a} or the pair (@var{a}, @var{c}) is |
4611
|
26 ## detectable, 0 if not, and -1 if the system has unobservable modes at the |
5016
|
27 ## imaginary axis (unit circle for discrete-time systems). |
3441
|
28 ## |
5016
|
29 ## @strong{See} @command{is_stabilizable} for detailed description of |
3441
|
30 ## arguments and computational method. |
5642
|
31 ## @seealso{is_stabilizable, size, rows, columns, length, ismatrix, |
|
32 ## isscalar, isvector} |
3441
|
33 ## @end deftypefn |
|
34 |
|
35 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> |
|
36 ## Created: August 1993 |
|
37 ## Updated by John Ingram (ingraje@eng.auburn.edu) July 1996. |
|
38 |
4611
|
39 function [retval, U] = is_detectable (a, c, tol, dflg) |
3441
|
40 |
|
41 if( nargin < 1) |
6046
|
42 print_usage (); |
4030
|
43 elseif(isstruct(a)) |
3441
|
44 ## system form |
|
45 if(nargin == 2) |
|
46 tol = c; |
|
47 elseif(nargin > 2) |
6046
|
48 print_usage (); |
3441
|
49 endif |
4611
|
50 dflg = is_digital(a); |
3441
|
51 [a,b,c] = sys2ss(a); |
|
52 else |
4611
|
53 if ((nargin > 4)||(nargin == 1)) |
6046
|
54 print_usage (); |
4611
|
55 endif |
|
56 if (~exist("dflg")) |
|
57 dflg = 0; |
|
58 end |
|
59 end |
3441
|
60 |
4611
|
61 if(~exist("tol")) |
|
62 tol = 200*eps; |
|
63 end |
|
64 retval = is_stabilizable(a',c',tol,dflg); |
3441
|
65 |
|
66 endfunction |
|
67 |