* Bug #12213 fixed - lincos help page example produced undefined variable
[scilab.git] / scilab / modules / xcos / help / en_US / batch_functions / lincos.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scicos
4  * 
5  * Copyright (C) INRIA - METALAU Project <scicos@inria.fr> (HTML version)
6  * Copyright (C) DIGITEO - Scilab Consortium (XML Docbook version)
7  * 
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.
12  * 
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.
17  * 
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.
21  * 
22  * See the file ./license.txt
23  -->
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">
25     <refnamediv>
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>
28     </refnamediv>
29     <refsynopsisdiv>
30         <title>Calling Sequence</title>
31         <synopsis>sys = lincos(scs_m [,x0,u0 [,param] ])</synopsis>
32     </refsynopsisdiv>
33     <refsection id="Module_lincos">
34         <title>Module</title>
35         <itemizedlist>
36             <listitem>
37                 <para>
38                     <link linkend="xcos">xcos</link>
39                 </para>
40             </listitem>
41         </itemizedlist>
42     </refsection>
43     <refsection id="Description_lincos">
44         <title>Description</title>
45         <para>
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>.
47         </para>
48         <para>
49             The output is a Scilab data structure of type continuous-time state-space linear system.
50         </para>
51     </refsection>
52     <refsection>
53         <title>Examples</title>
54         <programlisting role="example"><![CDATA[
55 // loading data
56 exec("SCI/modules/xcos/tests/unit_tests/PENDULUM_ANIM.sci");
57 exec("SCI/modules/xcos/tests/unit_tests/anim_pen.sci");
58
59 loadXcosLibs(); loadScicos();
60 importXcosDiagram("SCI/modules/xcos/tests/unit_tests/pendulum_anim45.xcos");
61
62 // specific context data
63 M  = 10;
64 m  = 3;
65 l  = 3;
66 ph = 0.1;
67 z0=-4;
68 th0=.02;
69
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;
74         break;
75     end
76 end
77
78 sys = lincos(scs_m);
79
80 bode(sys);
81  ]]></programlisting>
82     </refsection>
83     <refsection id="Parameters_lincos">
84         <title>Arguments</title>
85         <itemizedlist>
86             <listitem>
87                 <para>
88                     <emphasis role="bold">scs_m :</emphasis> a xcos data structure
89                 </para>
90             </listitem>
91             <listitem>
92                 <para>
93                     <emphasis role="bold">x0 :</emphasis> column vector. Continuous state around which linearization to be done (default 0)
94                 </para>
95             </listitem>
96             <listitem>
97                 <para>
98                     <emphasis role="bold">u0 :</emphasis> column vector. Input around which linearization to be done (default 0)
99                 </para>
100             </listitem>
101             <listitem>
102                 <para>
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.
104                 </para>
105             </listitem>
106             <listitem>
107                 <para>
108                     <emphasis role="bold">sys :</emphasis> state-space system
109                 </para>
110             </listitem>
111         </itemizedlist>
112     </refsection>
113     <refsection id="SeeAlso_lincos">
114         <title>See Also</title>
115         <itemizedlist>
116             <listitem>
117                 <para>
118                     <link linkend="steadycos">steadycos - Finds an equilibrium state of a general dynamical system described by a xcos diagram (Scilab Function)</link>
119                 </para>
120             </listitem>
121             <listitem>
122                 <para>
123                     <link linkend="scicos_simulate">scicos_simulate - Function for running xcos simulation in batch mode (Scilab Function)</link>
124                 </para>
125             </listitem>
126         </itemizedlist>
127     </refsection>
128 </refentry>