3b74b2337d24c5755a7c556c33784400b354fac1
[scilab.git] / scilab / modules / elementary_functions / help / en_US / signalprocessing / ssrand.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  -->
13 <refentry version="5.0-subset Scilab" xml:id="ssrand" xml:lang="en"
14           xmlns="http://docbook.org/ns/docbook"
15           xmlns:xlink="http://www.w3.org/1999/xlink"
16           xmlns:svg="http://www.w3.org/2000/svg"
17           xmlns:ns5="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML"
19           xmlns:db="http://docbook.org/ns/docbook">
20   <info>
21     <pubdate>$LastChangedDate$</pubdate>
22   </info>
23
24   <refnamediv>
25     <refname>ssrand</refname>
26
27     <refpurpose>random system generator</refpurpose>
28   </refnamediv>
29
30   <refsynopsisdiv>
31     <title>Calling Sequence</title>
32
33     <synopsis>sl=ssrand(nout,nin,nstate)
34 [sl,U]=ssrand(nout,nin,nstate,flag)</synopsis>
35   </refsynopsisdiv>
36
37   <refsection>
38     <title>Arguments</title>
39
40     <variablelist>
41       <varlistentry>
42         <term>nout</term>
43
44         <listitem>
45           <para>integer (number of output)</para>
46         </listitem>
47       </varlistentry>
48
49       <varlistentry>
50         <term>nin</term>
51
52         <listitem>
53           <para>integer (number of input)</para>
54         </listitem>
55       </varlistentry>
56
57       <varlistentry>
58         <term>nstate</term>
59
60         <listitem>
61           <para>integer (dimension of state-space)</para>
62         </listitem>
63       </varlistentry>
64
65       <varlistentry>
66         <term>flag</term>
67
68         <listitem>
69           <para>list made of one character string and one or several
70           integers</para>
71         </listitem>
72       </varlistentry>
73
74       <varlistentry>
75         <term>sl</term>
76
77         <listitem>
78           <para>list (<literal>syslin</literal> list)</para>
79         </listitem>
80       </varlistentry>
81
82       <varlistentry>
83         <term>U</term>
84
85         <listitem>
86           <para>square <literal>(nstate x nstate)</literal> nonsingular
87           matrix</para>
88         </listitem>
89       </varlistentry>
90     </variablelist>
91   </refsection>
92
93   <refsection>
94     <title>Description</title>
95
96     <para><literal>sl=ssrand(nout,nin,nstate)</literal> returns a random
97     strictly proper (<literal>D=0</literal>) state-space system of size
98     <literal>[nout,nint]</literal> represented by a <literal>syslin</literal>
99     list and with <literal>nstate</literal> state variables.</para>
100
101     <para><literal>[sl,U]=ssrand(nout,nin,nstate,flag)</literal> returns a
102     test linear system with given properties specified by
103     <literal>flag</literal>. <literal>flag</literal> can be one of the
104     following:</para>
105
106     <programlisting role = ""><![CDATA[ 
107 flag=list('co',dim_cont_subs)  
108 flag=list('uo',dim_unobs_subs)
109 flag=list('ncno',dim_cno,dim_ncno,dim_co,dim_nco)
110 flag=list('st',dim_cont_subs,dim_stab_subs,dim_stab0)  
111 flag=list('dt',dim_inst_unob,dim_instb0,dim_unobs)
112 flag=list('on',nr,ng,ng0,nv,rk)
113 flag=list('ui',nw,nwu,nwui,nwuis,rk)
114  ]]></programlisting>
115
116     <para>The complete description of the <literal>Sys</literal> is given in
117     the code of the <literal>ssrand</literal> function (in
118     <literal>SCI/modules/cacsd/macros/</literal>). For example with
119     <literal>flag=list('co',dim_cont_subs)</literal> a non-controllable system
120     is return and <literal>dim_cont_subs</literal> is the dimension of the
121     controllable subspace of <literal>Sys</literal>. The character strings
122     <literal>'co','uo','ncno','st','dt','on','ui'</literal> stand for
123     "controllable", "unobservable", "non-controllable-non-observable",
124     "stabilizable","detectable","output-nulling","unknown-input".</para>
125   </refsection>
126
127   <refsection>
128     <title>Examples</title>
129
130     <programlisting role="example"><![CDATA[ 
131 //flag=list('st',dim_cont_subs,dim_stab_subs,dim_stab0)  
132 //dim_cont_subs&lt;=dim_stab_subs&lt;=dim_stab0  
133 //pair (A,B) U-similar to:
134 //    [*,*,*,*;     [*;    
135 //    [0,s,*,*;     [0;
136 //A=  [0,0,i,*;   B=[0;
137 //    [0,0,0,u]     [0]
138 //     
139 // (A11,B1) controllable  s=stable matrix i=neutral matrix u=unstable matrix
140 [Sl,U]=ssrand(2,3,8,list('st',2,5,5));
141 w=ss2ss(Sl,inv(U)); //undo the random change of basis => form as above
142 [n,nc,u,sl]=st_ility(Sl);n,nc
143  ]]></programlisting>
144   </refsection>
145
146   <refsection role="see also">
147 <title>See Also</title>
148
149     <simplelist type="inline">
150       <member><link linkend="syslin">syslin</link></member>
151     </simplelist>
152   </refsection>
153 </refentry>