1 <?xml version="1.0" encoding="UTF-8"?>
5 * Copyright (C) INRIA - METALAU Project <scicos@inria.fr> (HTML version)
6 * Copyright (C) DIGITEO - Scilab Consortium (XML Docbook version)
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * See the file ./license.txt
24 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="lincos">
26 <refname>lincos</refname>
27 <refpurpose>Constructs by linearization a linear state-space model from a general dynamical system described by a Xcos diagram</refpurpose>
30 <title>Calling Sequence</title>
31 <synopsis>sys = lincos(scs_m [,x0,u0 [,param] ])</synopsis>
33 <refsection id="Module_lincos">
38 <link linkend="xcos">xcos</link>
43 <refsection id="Description_lincos">
44 <title>Description</title>
46 Construct a linear state-space system by linearizing a model given as a Xcos diagram. The idea is to transform a <link linkend="SUPER_f">sub-diagram</link> to a linear state-space model. The sub-diagram should have <link linkend="IN_f">inputs</link> and <link linkend="OUT_f">outputs</link>.
49 The output is a Scilab data structure of type continuous-time state-space linear system.
53 <title>Examples</title>
54 <programlisting role="example"><![CDATA[
56 exec("SCI/modules/xcos/tests/unit_tests/PENDULUM_ANIM.sci");
57 exec("SCI/modules/xcos/tests/unit_tests/anim_pen.sci");
59 loadXcosLibs(); loadScicos();
60 importXcosDiagram("SCI/modules/xcos/tests/unit_tests/pendulum_anim45.xcos");
62 // specific context data
70 // looking for the Superblock to linearize
71 for i=1:length(scs_m.objs)
72 if typeof(scs_m.objs(i))=="Block" & scs_m.objs(i).gui=="SUPER_f" then
73 scs_m = scs_m.objs(i).model.rpar;
83 <refsection id="Parameters_lincos">
84 <title>Arguments</title>
88 <emphasis role="bold">scs_m :</emphasis> a xcos data structure
93 <emphasis role="bold">x0 :</emphasis> column vector. Continuous state around which linearization to be done (default 0)
98 <emphasis role="bold">u0 :</emphasis> column vector. Input around which linearization to be done (default 0)
103 <emphasis role="bold">param :</emphasis> param: list with two elements (default list(1.d-6,0)) param(1): scalar. Perturbation level for linearization; the following variation is used del([x;u])_i = param(1)+param(1)*1d-4*abs([x;u])_i. param(2): scalar. Time t.
108 <emphasis role="bold">sys :</emphasis> state-space system
113 <refsection id="SeeAlso_lincos">
114 <title>See Also</title>
118 <link linkend="steadycos">steadycos - Finds an equilibrium state of a general dynamical system described by a xcos diagram (Scilab Function)</link>
123 <link linkend="scicos_simulate">scicos_simulate - Function for running xcos simulation in batch mode (Scilab Function)</link>