annotate scripts/control/system/is_detectable.m @ 5965:290420f503b2

[project @ 2006-08-24 19:01:16 by jwe]
author jwe
date Thu, 24 Aug 2006 19:01:17 +0000
parents 2618a0750ae6
children 34f96dd5441b
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
5307
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5053
diff changeset
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5053
diff changeset
18 ## 02110-1301 USA.
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
19
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
20 ## -*- texinfo -*-
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
21 ## @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
22 ## @deftypefnx {Function File} {@var{retval} =} is_detectable (@var{sys}, @var{tol})
4855
d62c421f448b [project @ 2004-04-07 02:41:22 by jwe]
jwe
parents: 4611
diff changeset
23 ## 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
24 ##
4855
d62c421f448b [project @ 2004-04-07 02:41:22 by jwe]
jwe
parents: 4611
diff changeset
25 ## 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
26 ## detectable, 0 if not, and -1 if the system has unobservable modes at the
5016
bdbee5282954 [project @ 2004-09-22 02:50:35 by jwe]
jwe
parents: 4855
diff changeset
27 ## imaginary axis (unit circle for discrete-time systems).
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
28 ##
5016
bdbee5282954 [project @ 2004-09-22 02:50:35 by jwe]
jwe
parents: 4855
diff changeset
29 ## @strong{See} @command{is_stabilizable} for detailed description of
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
30 ## arguments and computational method.
5642
2618a0750ae6 [project @ 2006-03-06 21:26:48 by jwe]
jwe
parents: 5307
diff changeset
31 ## @seealso{is_stabilizable, size, rows, columns, length, ismatrix,
2618a0750ae6 [project @ 2006-03-06 21:26:48 by jwe]
jwe
parents: 5307
diff changeset
32 ## isscalar, isvector}
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
33 ## @end deftypefn
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
34
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
35 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu>
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
36 ## Created: August 1993
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
37 ## Updated by John Ingram (ingraje@eng.auburn.edu) July 1996.
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
38
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
39 function [retval, U] = is_detectable (a, c, tol, dflg)
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
40
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
41 if( nargin < 1)
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
42 usage("retval = is_detectable(a , {c , tol, dlfg})");
4030
22bd65326ec1 [project @ 2002-08-09 18:58:13 by jwe]
jwe
parents: 3502
diff changeset
43 elseif(isstruct(a))
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
44 ## system form
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
45 if(nargin == 2)
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
46 tol = c;
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
47 elseif(nargin > 2)
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
48 usage("retval = is_detectable(sys {, tol})");
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
49 endif
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
50 dflg = is_digital(a);
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
51 [a,b,c] = sys2ss(a);
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
52 else
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
53 if ((nargin > 4)||(nargin == 1))
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
54 usage("retval = is_detectable(a , {c , tol, dflg})");
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
55 endif
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
56 if (~exist("dflg"))
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
57 dflg = 0;
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
58 end
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
59 end
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
60
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
61 if(~exist("tol"))
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
62 tol = 200*eps;
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
63 end
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
64 retval = is_stabilizable(a',c',tol,dflg);
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
65
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
66 endfunction
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
67