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}, @var{nobs}] =} isobsv (@var{sys})
20 ## @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{sys}, @var{tol})
21 ## @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{a}, @var{c})
22 ## @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{a}, @var{c}, @var{e})
23 ## @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{a}, @var{c}, @var{[]}, @var{tol})
24 ## @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{a}, @var{c}, @var{e}, @var{tol})
25 ## Logical check for system observability.
26 ## For numerical reasons, @code{isobsv (sys)}
27 ## should be used instead of @code{rank (obsv (sys))}.
32 ## LTI model. Descriptor state-space models are possible.
34 ## State transition matrix.
36 ## Measurement matrix.
39 ## If @var{e} is empty @code{[]} or not specified, an identity matrix is assumed.
41 ## Optional roundoff parameter. Default value is 0.
47 ## System is not observable.
49 ## System is observable.
51 ## Number of observable states.
54 ## @strong{Algorithm}@*
55 ## Uses SLICOT AB01OD and TG01HD by courtesy of
56 ## @uref{http://www.slicot.org, NICONET e.V.}
61 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
62 ## Created: October 2009
65 function [bool, nobs] = isobsv (a, c = [], e = [], tol = [])
69 elseif (isa (a, "lti")) # isobsv (sys), isobsv (sys, tol)
73 [bool, nobs] = isctrb (a.', c); # transpose is overloaded
74 elseif (nargin < 2 || nargin > 4)
76 else # isobsv (a, c), isobsv (a, c, e), ...
77 [bool, nobs] = isctrb (a.', c.', e.', tol);