22
22
* See the file ./license.txt
24
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" version="5.0-subset Scilab" xml:id="scicos_sim">
26
<refname>scicos_sim</refname>
27
<refpurpose>Define a sim structure</refpurpose>
29
<refsection id="Module_scicos_sim">
34
<link linkend="xcos">xcos</link>
39
<refsection id="sim_scicos_sim">
42
Scilab typed list of type scs. It contains
43
static arrays coming from the result of the
44
compilation. That arrays does not evolve
45
during the simulation.
63
<emphasis role="bold">funs</emphasis>
65
<para> A list containing names of the computational functions or scilab functions.</para>
67
Size : number of blocks.
70
Type : list of strings and/or scilab function.
75
<emphasis role="bold">xptr</emphasis>
77
<para> A vector pointer to the continuous time state register x. The continuous-time state of block i is state.x(sim.xptr(i):sim.xptr(i+1)-1).</para>
79
Size : number of blocks + 1.
82
Type : column vector of integers.
87
<emphasis role="bold">zptr</emphasis>
89
<para> A vector pointer to the discrete time state register z. The discrete-time state of block i is state.z(sim.zptr(i):sim.zptr(i+1)-1).</para>
91
Size : number of blocks + 1.
94
Type : column vector of integers.
99
<emphasis role="bold">ozptr</emphasis>
101
<para> A vector pointer to the object discrete state register oz. The object discrete state of block i is state.oz(sim.ozptr(i):sim.ozptr(i+1)-1).</para>
103
Size : number of blocks + 1.
106
Type : column vector of integers.
111
<emphasis role="bold">zcptr</emphasis>
113
<para> A vector pointer to the zero-crossing surfaces.</para>
114
<para> register. That vector gives by block the used number of the zero-crossing.</para>
116
Size : number of blocks + 1.
119
Type : column vector of integers.
124
<emphasis role="bold">inpptr</emphasis>
126
<para> (sim.inpptr(i+1)-sim.inpptr(i)) gives the number of regular input ports of the i block.</para>
127
<para> inpptr(i) points to the beginning of ith block inputs within the indirection table inplnk.</para>
129
Size : number of blocks + 1.
132
Type : column vector of integers.
137
<emphasis role="bold">outptr</emphasis>
139
<para> (sim.outptr(i+1)-sim.outptr(i)) gives the number of regular ouyput ports of the i block.</para>
140
<para> outptr(i) points to the beginning of ith block outputs within the indirection table outlnk.</para>
142
Size : number of blocks + 1.
145
Type : column vector of integers.
150
<emphasis role="bold">inplnk</emphasis>
152
<para> (cpr.sim.inplnk(cpr.sim.inpptr(i)-1+j)) is the index of the link connected to the jth input port of the ith block where j goes from 1 to (cpr.sim.inpptr(i+1)-cpr.sim.inpptr(i)).</para>
154
Size : total number of regular input port.
157
Type : column vector of integers.
162
<emphasis role="bold">outlnk</emphasis>
164
<para> (cpr.sim.outlnk(cpr.sim.outptr(i)-1+j)) is the index of the link connected to the jth output port of the ith block where j goes from 1 to (cpr.sim.outptr(i+1)-cpr.sim.outptr(i)).</para>
166
Size : total number of regular output port.
169
Type : column vector of integers.
174
<emphasis role="bold">rpar</emphasis>
176
<para> Vector of real parameters that is obtained by concatenating the real parameters registers of all the blocks.</para>
178
Size : total number of real parameters.
181
Type : column vector of real numbers.
186
<emphasis role="bold">rpptr</emphasis>
188
<para> A vector pointer to the real parameters register rpar. The real parameters of block i are sim.rpar(sim.rpptr(i):sim.rpptr(i+1)-1).</para>
190
Size : number of blocks + 1.
193
Type : column vector of integer.
198
<emphasis role="bold">ipar</emphasis>
200
<para> Vector of integer parameters that is obtained by concatenating the integer parameters registers of all the blocks.</para>
202
Size : total number of integer parameters.
205
Type : column vector of integer.
210
<emphasis role="bold">ipptr</emphasis>
212
<para> A vector pointer to the integer parameters register ipar. The integer parameters of block i are sim.ipar(sim.ipptr(i):sim.ipptr(i+1)-1).</para>
214
Size : number of blocks + 1.
217
Type : column vector of real numbers.
222
<emphasis role="bold">opar</emphasis>
224
<para> List of object parameters that is obtained by concatenating the list of object parameters of all the blocks.</para>
226
Size : total number of object parameters.
229
Type : list of scilab objects.
234
<emphasis role="bold">opptr</emphasis>
236
<para> A vector pointer to the object parameters list opar. The object parameters of block i are sim.opar(sim.opptr(i):sim.opptr(i+1)-1).</para>
238
Size : number of blocks + 1.
241
Type : column vector of integers.
246
<emphasis role="bold">clkptr</emphasis>
248
<para> A vector pointer to output activation ports.</para>
249
<para> (cpr.sim.clkptr(i):cpr.sim.clkptr(i+1)-1) gives the number of output event ports of the block i.</para>
251
Size : number of blocks + 1.
254
Type : column vector of integers.
259
<emphasis role="bold">ordptr</emphasis>
261
<para> A vector pointer to ordclk designating the part of ordclk corresponding to a given activation.</para>
262
<para> (cpr.sim.ordptr(i):cpr.sim.ordptr(i+1)-1) points to the region within ordclk indicates the number of blocks activated by the output event ports numbered i.</para>
264
Size : number of sources of activation + 1.
267
Type : column vector of integers.
272
<emphasis role="bold">execlk</emphasis>
274
<para> Unused.</para>
277
Type : matrix of real.
282
<emphasis role="bold">ordclk</emphasis>
284
<para> A matrix associated to blocks activated by output activation ports. The first column contains the block number, and the second, the event code by which the block should be called.</para>
286
Size : total number of blocks summed by source of activations.
289
Type : matrix of integers.
294
<emphasis role="bold">cord</emphasis>
296
<para> A matrix associated to always active blocks.</para>
297
<para> The first column contains the block number, and the second, the event code by which the block should be called.</para>
302
Type : matrix of integers.
307
<emphasis role="bold">oord</emphasis>
309
<para> Subset of cord. Blocks of that matrix have outputs which affect computation of continuous state derivatives.</para>
314
Type : matrix of integers.
319
<emphasis role="bold">zord</emphasis>
321
<para> Subset of zord. Blocks of that matrix have outputs which affect computation of zero-crossing surfaces.</para>
326
Type : matrix of integers.
331
<emphasis role="bold">critev</emphasis>
333
<para> A vector of size equal to the number of activations and containing zeros and ones. The value one indicates that the activation is critical in the sense that the continuous-time solver must be cold restarted.</para>
335
Size : number of source of activation.
338
Type : column vector of integers.
343
<emphasis role="bold">nb</emphasis>
345
<para> Number of blocks. Note that the number of blocks may differ from the original number of blocks in the diagram because c_pass2 may duplicate some conditional blocks.</para>
355
<emphasis role="bold">ztyp</emphasis>
357
<para> A vector of size equal to the number of blocks.</para>
358
<para> A 1 entry indicates that the block may have zero-crossings, even if it does not in the context of the diagram. Usually not used by the simulator.</para>
360
Size : number of blocks.
363
Type : column vector of integers.
368
<emphasis role="bold">nblk</emphasis>
370
<para> Not used. Set to nb.</para>
378
<emphasis role="bold">ndcblk</emphasis>
380
<para> Not used.</para>
388
<emphasis role="bold">subscr</emphasis>
390
<para> Not used.</para>
398
<emphasis role="bold">funtyp</emphasis>
400
<para> A vector of size equal to the number of blocks indicating the type of the computational function of the block. Block type can be 0 through 5.</para>
401
<para> Currently only type 4 (C language) and type 5 (Scilab language) computational functions should be used. But older blocks can also be used.</para>
403
Size : number of blocks.
406
Type : column vector of integer.
411
<emphasis role="bold">iord</emphasis>
413
<para> A matrix associated to blocks that must be activated at the start of the simulation. This includes blocks inheriting from constant blocks and always active blocks.</para>
418
Type : matrix of integers.
423
<emphasis role="bold">labels</emphasis>
425
<para> A string vector of size equal to the number of blocks containing block labels.</para>
427
Size : numbers of blocks.
430
Type : column vector of strings.
435
<emphasis role="bold">modptr</emphasis>
437
<para> A vector pointer to the block modes.</para>
439
Size : number of blocks + 1.
442
Type : column vector of integer.
447
<refsection id="Filecontent_scicos_sim">
448
<title>File content</title>
451
<para> SCI/modules/scicos/macros/scicos_scicos/scicos_sim.sci</para>
26
<refname>scicos_sim</refname>
27
<refpurpose>Define a sim structure</refpurpose>
29
<refsection id="Module_scicos_sim">
34
<link linkend="xcos">xcos</link>
39
<refsection id="sim_scicos_sim">
42
Scilab typed list of type scs. It contains
43
static arrays coming from the result of the
44
compilation. That arrays does not evolve
45
during the simulation.
63
<emphasis role="bold">funs</emphasis>
65
<para> A list containing names of the computational functions or scilab functions.</para>
67
Size : number of blocks.
70
Type : list of strings and/or scilab function.
75
<emphasis role="bold">xptr</emphasis>
77
<para> A vector pointer to the continuous time state register x. The continuous-time state of block i is state.x(sim.xptr(i):sim.xptr(i+1)-1).</para>
79
Size : number of blocks + 1.
82
Type : column vector of integers.
87
<emphasis role="bold">zptr</emphasis>
89
<para> A vector pointer to the discrete time state register z. The discrete-time state of block i is state.z(sim.zptr(i):sim.zptr(i+1)-1).</para>
91
Size : number of blocks + 1.
94
Type : column vector of integers.
99
<emphasis role="bold">ozptr</emphasis>
101
<para> A vector pointer to the object discrete state register oz. The object discrete state of block i is state.oz(sim.ozptr(i):sim.ozptr(i+1)-1).</para>
103
Size : number of blocks + 1.
106
Type : column vector of integers.
111
<emphasis role="bold">zcptr</emphasis>
113
<para> A vector pointer to the zero-crossing surfaces.</para>
114
<para> register. That vector gives by block the used number of the zero-crossing.</para>
116
Size : number of blocks + 1.
119
Type : column vector of integers.
124
<emphasis role="bold">inpptr</emphasis>
126
<para> (sim.inpptr(i+1)-sim.inpptr(i)) gives the number of regular input ports of the i block.</para>
127
<para> inpptr(i) points to the beginning of ith block inputs within the indirection table inplnk.</para>
129
Size : number of blocks + 1.
132
Type : column vector of integers.
137
<emphasis role="bold">outptr</emphasis>
139
<para> (sim.outptr(i+1)-sim.outptr(i)) gives the number of regular ouyput ports of the i block.</para>
140
<para> outptr(i) points to the beginning of ith block outputs within the indirection table outlnk.</para>
142
Size : number of blocks + 1.
145
Type : column vector of integers.
150
<emphasis role="bold">inplnk</emphasis>
152
<para> (cpr.sim.inplnk(cpr.sim.inpptr(i)-1+j)) is the index of the link connected to the jth input port of the ith block where j goes from 1 to (cpr.sim.inpptr(i+1)-cpr.sim.inpptr(i)).</para>
154
Size : total number of regular input port.
157
Type : column vector of integers.
162
<emphasis role="bold">outlnk</emphasis>
164
<para> (cpr.sim.outlnk(cpr.sim.outptr(i)-1+j)) is the index of the link connected to the jth output port of the ith block where j goes from 1 to (cpr.sim.outptr(i+1)-cpr.sim.outptr(i)).</para>
166
Size : total number of regular output port.
169
Type : column vector of integers.
174
<emphasis role="bold">rpar</emphasis>
176
<para> Vector of real parameters that is obtained by concatenating the real parameters registers of all the blocks.</para>
178
Size : total number of real parameters.
181
Type : column vector of real numbers.
186
<emphasis role="bold">rpptr</emphasis>
188
<para> A vector pointer to the real parameters register rpar. The real parameters of block i are sim.rpar(sim.rpptr(i):sim.rpptr(i+1)-1).</para>
190
Size : number of blocks + 1.
193
Type : column vector of integer.
198
<emphasis role="bold">ipar</emphasis>
200
<para> Vector of integer parameters that is obtained by concatenating the integer parameters registers of all the blocks.</para>
202
Size : total number of integer parameters.
205
Type : column vector of integer.
210
<emphasis role="bold">ipptr</emphasis>
212
<para> A vector pointer to the integer parameters register ipar. The integer parameters of block i are sim.ipar(sim.ipptr(i):sim.ipptr(i+1)-1).</para>
214
Size : number of blocks + 1.
217
Type : column vector of real numbers.
222
<emphasis role="bold">opar</emphasis>
224
<para> List of object parameters that is obtained by concatenating the list of object parameters of all the blocks.</para>
226
Size : total number of object parameters.
229
Type : list of scilab objects.
234
<emphasis role="bold">opptr</emphasis>
236
<para> A vector pointer to the object parameters list opar. The object parameters of block i are sim.opar(sim.opptr(i):sim.opptr(i+1)-1).</para>
238
Size : number of blocks + 1.
241
Type : column vector of integers.
246
<emphasis role="bold">clkptr</emphasis>
248
<para> A vector pointer to output activation ports.</para>
249
<para> (cpr.sim.clkptr(i):cpr.sim.clkptr(i+1)-1) gives the number of output event ports of the block i.</para>
251
Size : number of blocks + 1.
254
Type : column vector of integers.
259
<emphasis role="bold">ordptr</emphasis>
261
<para> A vector pointer to ordclk designating the part of ordclk corresponding to a given activation.</para>
262
<para> (cpr.sim.ordptr(i):cpr.sim.ordptr(i+1)-1) points to the region within ordclk indicates the number of blocks activated by the output event ports numbered i.</para>
264
Size : number of sources of activation + 1.
267
Type : column vector of integers.
272
<emphasis role="bold">execlk</emphasis>
274
<para> Unused.</para>
277
Type : matrix of real.
282
<emphasis role="bold">ordclk</emphasis>
284
<para> A matrix associated to blocks activated by output activation ports. The first column contains the block number, and the second, the event code by which the block should be called.</para>
286
Size : total number of blocks summed by source of activations.
289
Type : matrix of integers.
294
<emphasis role="bold">cord</emphasis>
296
<para> A matrix associated to always active blocks.</para>
297
<para> The first column contains the block number, and the second, the event code by which the block should be called.</para>
302
Type : matrix of integers.
307
<emphasis role="bold">oord</emphasis>
309
<para> Subset of cord. Blocks of that matrix have outputs which affect computation of continuous state derivatives.</para>
314
Type : matrix of integers.
319
<emphasis role="bold">zord</emphasis>
321
<para> Subset of zord. Blocks of that matrix have outputs which affect computation of zero-crossing surfaces.</para>
326
Type : matrix of integers.
331
<emphasis role="bold">critev</emphasis>
333
<para> A vector of size equal to the number of activations and containing zeros and ones. The value one indicates that the activation is critical in the sense that the continuous-time solver must be cold restarted.</para>
335
Size : number of source of activation.
338
Type : column vector of integers.
343
<emphasis role="bold">nb</emphasis>
345
<para> Number of blocks. Note that the number of blocks may differ from the original number of blocks in the diagram because c_pass2 may duplicate some conditional blocks.</para>
355
<emphasis role="bold">ztyp</emphasis>
357
<para> A vector of size equal to the number of blocks.</para>
358
<para> A 1 entry indicates that the block may have zero-crossings, even if it does not in the context of the diagram. Usually not used by the simulator.</para>
360
Size : number of blocks.
363
Type : column vector of integers.
368
<emphasis role="bold">nblk</emphasis>
370
<para> Not used. Set to nb.</para>
378
<emphasis role="bold">ndcblk</emphasis>
380
<para> Not used.</para>
388
<emphasis role="bold">subscr</emphasis>
390
<para> Not used.</para>
398
<emphasis role="bold">funtyp</emphasis>
400
<para> A vector of size equal to the number of blocks indicating the type of the computational function of the block. Block type can be 0 through 5.</para>
401
<para> Currently only type 4 (C language) and type 5 (Scilab language) computational functions should be used. But older blocks can also be used.</para>
403
Size : number of blocks.
406
Type : column vector of integer.
411
<emphasis role="bold">iord</emphasis>
413
<para> A matrix associated to blocks that must be activated at the start of the simulation. This includes blocks inheriting from constant blocks and always active blocks.</para>
418
Type : matrix of integers.
423
<emphasis role="bold">labels</emphasis>
425
<para> A string vector of size equal to the number of blocks containing block labels.</para>
427
Size : numbers of blocks.
430
Type : column vector of strings.
435
<emphasis role="bold">modptr</emphasis>
437
<para> A vector pointer to the block modes.</para>
439
Size : number of blocks + 1.
442
Type : column vector of integer.
447
<refsection id="Filecontent_scicos_sim">
448
<title>File content</title>
451
<para> SCI/modules/scicos/macros/scicos_scicos/scicos_sim.sci</para>