1 ## Copyright (C) 2010 Benjamin Fernandez
2 ## Copyright (C) 2011 Lukas F. Reichlin
4 ## This file is part of LTI Syncope.
6 ## LTI Syncope is free software: you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation, either version 3 of the License, or
9 ## (at your option) any later version.
11 ## LTI Syncope is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ## GNU General Public License for more details.
16 ## You should have received a copy of the GNU General Public License
17 ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>.
20 ## @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys})
21 ## @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}, @var{tol})
22 ## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C})
23 ## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}, @var{TOL})
24 ## If Ob=obsv(A,C) has rank r <= n = SIZE(A,1), then there is a
25 ## similarity transformation Tc such that To = [t1;t2] where t1 is c
26 ## and t2 is orthogonal to t1
30 ## Abar = To \ A * To , Bbar = To \ B , Cbar = C * To
34 ## and the transformed system has the form
39 ## Abar = |----------|, Bbar = | --- |, Cbar = [Co | 0 ].
44 ## where (Ao,Bo) is observable, and Co(sI-Ao)^(-1)Bo = C(sI-A)^(-1)B. And
45 ## system is detectable if Ano has no eigenvalues in the right
46 ## half plane. The last output K is a vector of length n containing the
47 ## number of observable states.
50 ## Author: Benjamin Fernandez <benjas@benjas-laptop>
51 ## Created: 2010-05-02
54 function [ac, bc, cc, z, ncont] = obsvf (a, b = [], c, tol = [])
56 if (nargin < 1 || nargin > 4)
64 [ac, bc, cc] = ctrbf (a.', b); # [sysbar, z, ncont] = ctrbf (sys.', tol);
71 [ac, tmp, cc, z, ncont] = ctrbf (a.', c.', b.', tol);