1 ## Copyright (C) 2009, 2010 Lukas F. Reichlin
3 ## This file is part of LTI Syncope.
5 ## LTI Syncope is free software: you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation, either version 3 of the License, or
8 ## (at your option) any later version.
10 ## LTI Syncope is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>.
19 ## @deftypefn {Function File} {@var{bool} =} isdetectable (@var{sys})
20 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{sys}, @var{tol})
21 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c})
22 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{e})
23 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{[]}, @var{tol})
24 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{e}, @var{tol})
25 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{[]}, @var{[]}, @var{dflg})
26 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{e}, @var{[]}, @var{dflg})
27 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{[]}, @var{tol}, @var{dflg})
28 ## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{e}, @var{tol}, @var{dflg})
29 ## Logical test for system detectability.
30 ## All unstable modes must be observable or all unobservable states must be stable.
37 ## State transition matrix.
39 ## Measurement matrix.
42 ## If @var{e} is empty @code{[]} or not specified, an identity matrix is assumed.
44 ## Optional tolerance for stability. Default value is 0.
46 ## Matrices (@var{a}, @var{c}) are part of a continuous-time system. Default Value.
48 ## Matrices (@var{a}, @var{c}) are part of a discrete-time system.
54 ## System is not detectable.
56 ## System is detectable.
60 ## @strong{Algorithm}@*
61 ## Uses SLICOT AB01OD and TG01HD by courtesy of
62 ## @uref{http://www.slicot.org, NICONET e.V.}
63 ## See @command{isstabilizable} for description of computational method.
64 ## @seealso{isstabilizable, isstable, isctrb, isobsv}
67 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
68 ## Created: October 2009
71 function bool = isdetectable (a, c = [], e = [], tol = [], dflg = 0)
75 elseif (isa (a, "lti")) # isdetectable (sys), isdetectable (sys, tol)
79 bool = isstabilizable (a.', c); # transpose is overloaded
80 elseif (nargin < 2 || nargin > 5)
82 else # isdetectable (a, c, ...)
83 bool = isstabilizable (a.', c.', e.', tol, dflg); # arguments checked inside