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 |
5307
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301 USA. |
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}) |
4855
|
23 ## Test for detactability (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) |
4611
|
42 usage("retval = is_detectable(a , {c , tol, dlfg})"); |
4030
|
43 elseif(isstruct(a)) |
3441
|
44 ## system form |
|
45 if(nargin == 2) |
|
46 tol = c; |
|
47 elseif(nargin > 2) |
4611
|
48 usage("retval = is_detectable(sys {, tol})"); |
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)) |
|
54 usage("retval = is_detectable(a , {c , tol, dflg})"); |
|
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 |