* Bug #12774 fixed - Fix various typos.
[scilab.git] / scilab / modules / xcos / help / en_US / palettes / Continuous_pal / CLSS.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:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="CLSS">
25     <refnamediv>
26         <refname>CLSS</refname>
27         <refpurpose>Continuous state-space system</refpurpose>
28     </refnamediv>
29     <refsection>
30         <title>Block Screenshot</title>
31         <para>
32             <inlinemediaobject>
33                 <imageobject>
34                     <imagedata align="center" fileref="../../../../images/palettes/CLSS.png" valign="middle"/>
35                 </imageobject>
36             </inlinemediaobject>
37         </para>
38     </refsection>
39     <refsection id="Contents_CLSS">
40         <title>Contents</title>
41         <itemizedlist>
42             <listitem>
43                 <para>
44                     <link linkend="CLSS">Continuous state-space system</link>
45                 </para>
46             </listitem>
47             <listitem>
48                 <itemizedlist>
49                     <listitem>
50                         <para>
51                             <xref linkend="Palette_CLSS">Palette</xref>
52                         </para>
53                     </listitem>
54                     <listitem>
55                         <para>
56                             <xref linkend="Description_CLSS">Description</xref>
57                         </para>
58                     </listitem>
59                     <listitem>
60                         <para>
61                             <xref linkend="Dialogbox_CLSS">Dialog box</xref>
62                         </para>
63                     </listitem>
64                     <listitem>
65                         <para>
66                             <xref linkend="Defaultproperties_CLSS">Default
67                                 properties
68                             </xref>
69                         </para>
70                     </listitem>
71                     <listitem>
72                         <para>
73                             <xref linkend="Interfacingfunction_CLSS">Interfacing
74                                 function
75                             </xref>
76                         </para>
77                     </listitem>
78                     <listitem>
79                         <para>
80                             <xref linkend="Computationalfunction_CLSS">Computational
81                                 function
82                             </xref>
83                         </para>
84                     </listitem>
85                     <listitem>
86                         <para>
87                             <xref linkend="Example_CLSS">Example</xref>
88                         </para>
89                     </listitem>
90                 </itemizedlist>
91             </listitem>
92         </itemizedlist>
93     </refsection>
94     <refsection id="Palette_CLSS">
95         <title>Palette</title>
96         <itemizedlist>
97             <listitem>
98                 <para>
99                     <link linkend="Continuous_pal">Continuous time systems
100                         palette
101                     </link>
102                 </para>
103             </listitem>
104         </itemizedlist>
105     </refsection>
106     <refsection id="Description_CLSS">
107         <title>Description</title>
108         <para>This block realizes a continuous-time linear state-space
109             system.
110         </para>
111         <para>
112             <latex>
113                 \begin{matrix}
114                 \dot{x} = A \cdot x + B \cdot u \\ 
115                 y = C \cdot x + D \cdot u
116                 \end{matrix}
117             </latex>
118         </para>
119         <para>
120             where <emphasis role="bold">x</emphasis> is the vector of state
121             variables, <emphasis role="bold">u</emphasis> is the vector of input
122             functions and <emphasis role="bold">y</emphasis> is the vector of output
123             variables.
124         </para>
125         <para>
126             The system is defined by the <emphasis role="bold">(A, B, C, D)</emphasis> matrices and the initial state <emphasis role="bold">X0</emphasis>.
127             The dimensions must be compatible.
128         </para>
129     </refsection>
130     <refsection id="Dialogbox_CLSS">
131         <title>Dialog box</title>
132         <para>
133             <inlinemediaobject>
134                 <imageobject>
135                     <imagedata align="center" fileref="../../../../images/gui/CLSS_gui.gif" valign="middle"/>
136                 </imageobject>
137             </inlinemediaobject>
138         </para>
139         <itemizedlist>
140             <listitem>
141                 <para>
142                     <emphasis role="bold">A matrix</emphasis>
143                 </para>
144                 <para>A square matrix.</para>
145                 <para>Properties : Type 'mat' of size [-1,-1].</para>
146             </listitem>
147             <listitem>
148                 <para>
149                     <emphasis role="bold">B matrix</emphasis>
150                 </para>
151                 <para>
152                     The <emphasis role="bold">B</emphasis> matrix, [] if system has no input.
153                 </para>
154                 <para>Properties : Type 'mat' of size ["size(%1,2)","-1"].</para>
155             </listitem>
156             <listitem>
157                 <para>
158                     <emphasis role="bold">C matrix</emphasis>
159                 </para>
160                 <para>
161                     The <emphasis role="bold">C</emphasis> matrix , [] if system has no output.
162                 </para>
163                 <para>Properties : Type 'mat' of size ["-1","size(%1,2)"].</para>
164             </listitem>
165             <listitem>
166                 <para>
167                     <emphasis role="bold">D matrix</emphasis>
168                 </para>
169                 <para>
170                     The <emphasis role="bold">D</emphasis> matrix, [] if system has no D term.
171                 </para>
172                 <para>Properties : Type 'mat' of size [-1,-1].</para>
173             </listitem>
174             <listitem>
175                 <para>
176                     <emphasis role="bold">Initial state</emphasis>
177                 </para>
178                 <para>A vector/scalar initial state of the system.</para>
179                 <para>Properties : Type 'vec' of size "size(%1,2)".</para>
180             </listitem>
181         </itemizedlist>
182     </refsection>
183     <refsection id="Defaultproperties_CLSS">
184         <title>Default properties</title>
185         <itemizedlist>
186             <listitem>
187                 <para>
188                     <emphasis role="bold">always active:</emphasis> yes
189                 </para>
190             </listitem>
191             <listitem>
192                 <para>
193                     <emphasis role="bold">direct-feedthrough:</emphasis> no
194                 </para>
195             </listitem>
196             <listitem>
197                 <para>
198                     <emphasis role="bold">zero-crossing:</emphasis> no
199                 </para>
200             </listitem>
201             <listitem>
202                 <para>
203                     <emphasis role="bold">mode:</emphasis> no
204                 </para>
205             </listitem>
206             <listitem>
207                 <para>
208                     <emphasis role="bold">regular inputs:</emphasis>
209                 </para>
210                 <para>
211                     <emphasis role="bold">- port 1 : size [1,1] / type
212                         1
213                     </emphasis>
214                 </para>
215             </listitem>
216             <listitem>
217                 <para>
218                     <emphasis role="bold">regular outputs:</emphasis>
219                 </para>
220                 <para>
221                     <emphasis role="bold">- port 1 : size [1,1] / type
222                         1
223                     </emphasis>
224                 </para>
225             </listitem>
226             <listitem>
227                 <para>
228                     <emphasis role="bold">number/sizes of activation
229                         inputs:
230                     </emphasis>
231                     0
232                 </para>
233             </listitem>
234             <listitem>
235                 <para>
236                     <emphasis role="bold">number/sizes of activation
237                         outputs:
238                     </emphasis>
239                     0
240                 </para>
241             </listitem>
242             <listitem>
243                 <para>
244                     <emphasis role="bold">continuous-time state:</emphasis>
245                     yes
246                 </para>
247             </listitem>
248             <listitem>
249                 <para>
250                     <emphasis role="bold">discrete-time state:</emphasis> no
251                 </para>
252             </listitem>
253             <listitem>
254                 <para>
255                     <emphasis role="bold">object discrete-time state:</emphasis>
256                     no
257                 </para>
258             </listitem>
259             <listitem>
260                 <para>
261                     <emphasis role="bold">name of computational function:</emphasis>
262                     <emphasis role="italic">csslti4</emphasis>
263                 </para>
264             </listitem>
265         </itemizedlist>
266     </refsection>
267     <refsection id="Example_CLSS">
268         <title>Example</title>
269         <para>This sample example illustrates how to use CLSS block to simulate
270             and display the output waveform <emphasis role="bold">y(t)=Vc(t)</emphasis> of the RLC circuit shown below.
271         </para>
272         <para>
273             <inlinemediaobject>
274                 <imageobject>
275                     <imagedata align="center" fileref="../../../examples/clss_d1.png" valign="middle"/>
276                 </imageobject>
277             </inlinemediaobject>
278         </para>
279         <para>The equations for an RLC circuit are the following. They result from
280             Kirchhoff's voltage law and Newton's law.
281         </para>
282         <para>
283             <latex><![CDATA[
284 \begin{matrix}
285 i = i_L = i_C = C \frac{\mathrm{d} v_C }{\mathrm{d} t} \\ 
286 Ri_L + L \frac{\mathrm{d} i_L }{\mathrm{d} t} + v_C = u_0(t)
287 \end{matrix}
288       ]]></latex>
289         </para>
290         <para>The R, L and C are the system's resistance, inductance and
291             capacitor.
292         </para>
293         <para>
294             We define the capacitor voltage <literal>Vc</literal> and the
295             inductance current <literal>iL</literal> as the state variables
296             <literal>X1</literal> and <literal>X2.</literal>
297         </para>
298         <para>
299             <latex><![CDATA[
300 \begin{array}{c}
301 \mbox{$x_1 = i_L$}\\
302 \mbox{$x_2 = v_C$}\\
303 \end{array}
304
305 then
306
307 \begin{array}{c}
308 \mbox{$\dot{x_1} = \frac{\mathrm{d} i_L }{\mathrm{d} t}$}\\
309 \mbox{$\dot{x_2} = \frac{\mathrm{d} v_C }{\mathrm{d} t}$}
310 \end{array}
311       ]]></latex>
312         </para>
313         <para>thus</para>
314         <para>
315             <latex>x_1 = i_L = C\frac{\mathrm{d} v_C }{\mathrm{d} t} = C\dot{x_2}</latex>
316         </para>
317         <para>Rearranging these equations we get:</para>
318         <para>
319             <latex><![CDATA[
320 \begin{array}{c}
321 \dot{x_1} = -\frac{R}{L} x_1 - \frac{1}{L} x_2 + \frac{1}{L} u_0(t) \\
322 \dot{x_2} = \frac{1}{C} x_2
323 \end{array}
324       ]]></latex>
325         </para>
326         <para>These equations can be put into matrix form as follows,</para>
327         <para>
328             <latex><![CDATA[
329 \begin{bmatrix}\dot{x_1}\\\dot{x_2}\end{bmatrix}
330 =
331 \begin{bmatrix}
332 -\frac{R}{L} & -\frac{1}{L}\\ 
333 -\frac{1}{C} & 0
334 \end{bmatrix}
335 \begin{bmatrix}x_1\\x_2\end{bmatrix}
336 +
337 \begin{bmatrix}\frac{1}{L}\\0\end{bmatrix}
338 u_0(t)
339       ]]></latex>
340         </para>
341         <para>The required output equation is</para>
342         <para>
343             <latex><![CDATA[
344         y(t) = \begin{bmatrix} 1 & 0 \end{bmatrix} \cdot \begin{bmatrix} x_{1} \\ x_{2} \end{bmatrix} + \begin{bmatrix} 0 \end{bmatrix} \cdot u
345       ]]></latex>
346         </para>
347         <para>The following diagram shows these equations modeled in Xcos where
348             R=10Ω, L=5 mΗ and C=0.1µF; the initial states are x1=0 and x2=0.5.
349         </para>
350         <para>To obtain the output Vc(t) we use CLSS block from Continuous time
351             systems Palette.
352         </para>
353         <para>
354             <link type="scilab" linkend="scilab.zcos/xcos/examples/continuous_pal/CLSS_Example.zcos">
355                 <inlinemediaobject>
356                     <imageobject>
357                         <imagedata align="center" fileref="../../../../examples/continuous_pal/CLSS_Example.zcos" valign="middle"/>
358                     </imageobject>
359                 </inlinemediaobject>
360             </link>
361             <scilab:image><![CDATA[
362 importXcosDiagram(SCI + "/modules/xcos/examples/continuous_pal/CLSS_Example.zcos");
363 xcos_simulate(scs_m, 4);
364 ]]></scilab:image>
365         </para>
366     </refsection>
367     <refsection id="Interfacingfunction_CLSS">
368         <title>Interfacing function</title>
369         <itemizedlist>
370             <listitem>
371                 <para>SCI/modules/scicos_blocks/macros/Linear/CLSS.sci</para>
372             </listitem>
373         </itemizedlist>
374     </refsection>
375     <refsection id="Computationalfunction_CLSS">
376         <title>Computational function</title>
377         <itemizedlist>
378             <listitem>
379                 <para>SCI/modules/scicos_blocks/src/c/csslti4.c (Type 4)</para>
380             </listitem>
381         </itemizedlist>
382     </refsection>
383 </refentry>