1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) INRIA -
4 // Copyright (C) 2012 - 2016 - Scilab Enterprises
6 // This file is hereby licensed under the terms of the GNU GPL v2.0,
7 // pursuant to article 5.3.4 of the CeCILL v.2.1.
8 // This file was originally licensed under the terms of the CeCILL v2.1,
9 // and continues to be available under such terms.
10 // For more information, see the COPYING file which you should have received
11 // along with this program.
13 function [go]=obs_gram(a,c,domaine)
18 if rhs<2 then error(39); end;
19 if rhs==2 then domaine="c"; end;
20 if and(domaine<>["d","c"]) then
21 error(msprintf(gettext("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"), "obs_gram",3,"''d'', ''c''"));
24 if m<>n then error(20,1),end
25 [mb,nb]=size(c);if nb<>n then error(60),end
26 case "state-space" then
28 error(msprintf(gettext("%s: Wrong number of input arguments: %d expected"),"obs_gram",1)),
30 [a,c,domaine]=a([2,4,7])
32 warning(msprintf(gettext("%s: Input argument #%d is assumed continuous time.\n"),"obs_gram",1));
34 elseif type(domaine)==1 then
40 error(msprintf(gettext("%s: Wrong number of input arguments: %d expected"),"obs_gram",1)),
43 [a,c,domaine]=a([2,4,7])
45 warning(msprintf(gettext("%s: Input argument #%d is assumed continuous time.\n"),"obs_gram",1));
47 elseif type(domaine)==1 then
53 error(msprintf(gettext("%s: Wrong type for input argument #%d: Linear dynamical system expected.\n"),"obs_gram",1))
55 error(msprintf(gettext("%s: Wrong type of input argument #%d: Array of floating point numbers expected.\n"),"obs_gram",1))
60 if (domaine=="c"&max(real(s))>=0)|(domaine=="d"&max(abs(s))>=1) then
61 error(msprintf(gettext("%s: Wrong value for input argument #%d: Stable system expected.\n"),"obs_gram",1));
63 go=lyap(a,-c'*c,domaine)