annotate scripts/control/system/is_detectable.m @ 7136:59dcf01bb3e3

[project @ 2007-11-08 20:18:25 by jwe]
author jwe
date Thu, 08 Nov 2007 20:18:26 +0000
parents a1dbe9d80eee
children aeeb646f6538
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
1 ## Copyright (C) 1993, 1994, 1995, 2000, 2002, 2003, 2004, 2005, 2006,
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
2 ## 2007 Auburn University. All rights reserved.
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
3 ##
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
4 ## This file is part of Octave.
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
5 ##
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
6 ## Octave is free software; you can redistribute it and/or modify it
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
7 ## under the terms of the GNU General Public License as published by
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
8 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
9 ## your option) any later version.
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
10 ##
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
11 ## Octave is distributed in the hope that it will be useful, but
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
14 ## General Public License for more details.
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
15 ##
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
16 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
17 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7007
diff changeset
18 ## <http://www.gnu.org/licenses/>.
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})
7007
6304d9ea0a30 [project @ 2007-10-11 16:26:36 by jwe]
jwe
parents: 6046
diff changeset
23 ## Test for detectability (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
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
41 if (nargin < 1)
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5642
diff changeset
42 print_usage ();
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
43 elseif (isstruct (a))
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
44 ## system form
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
45 if (nargin == 2)
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
46 tol = c;
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
47 elseif (nargin > 2)
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5642
diff changeset
48 print_usage ();
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
49 endif
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
50 dflg = is_digital (a);
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
51 [a,b,c] = sys2ss (a);
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
52 else
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
53 if (nargin > 4 || nargin == 1)
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5642
diff changeset
54 print_usage ();
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
55 endif
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
56 if (! exist ("dflg"))
4611
c76a32c6f90c [project @ 2003-11-14 17:48:46 by jwe]
jwe
parents: 4030
diff changeset
57 dflg = 0;
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
58 endif
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
59 endif
3441
36ae9880c594 [project @ 2000-01-14 22:03:32 by jwe]
jwe
parents:
diff changeset
60
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
61 if (! exist ("tol"))
4611
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
7136
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
diff changeset
64
59dcf01bb3e3 [project @ 2007-11-08 20:18:25 by jwe]
jwe
parents: 7017
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