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