annotate scripts/control/system/is_detectable.m @ 4611:c76a32c6f90c

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