Ticket #1218: Routing.mo

File Routing.mo, 32.1 KB (added by perob88, 15 years ago)
Line 
1within Modelica.Blocks;
2
3package Routing "Blocks to combine and extract signals"
4 extends Icons.Library;
5
6block ExtractSignal "Extract signals from an input signal vector"
7 extends Modelica.Blocks.Interfaces.MIMO;
8 parameter Integer extract[nout]=1:nout "Extracting vector";
9 annotation (
10 Coordsys(
11 extent=[-100, -100; 100, 100],
12 grid=[1, 1],
13 component=[20, 20]),
14 Window(
15 x=0.28,
16 y=0.29,
17 width=0.57,
18 height=0.61),
19 Icon(
20 Rectangle(extent=[-100, 100; 100, -100]),
21 Rectangle(extent=[-90, 50; -50, -50], style(fillColor=7)),
22 Rectangle(extent=[50, 50; 90, -50], style(fillColor=7)),
23 Polygon(points=[-94.4104, 1.90792; -94.4104, -2.09208; -90.4104, -
24 0.0920762; -94.4104, 1.90792], style(fillColor=73)),
25 Line(points=[-72, 2; -60.1395, 12.907; -49.1395, 12.907]),
26 Line(points=[-73, 4; -59, 40; -49, 40]),
27 Line(points=[-112, 0; -75.0373, -0.0180176]),
28 Ellipse(extent=[-80.0437, 4.59255; -70.0437, -4.90745], style(fillColor=
29 73)),
30 Line(points=[-73, -5; -60, -40; -49, -40]),
31 Line(points=[-72, -2; -60.0698, -12.907; -49.0698, -12.907]),
32 Polygon(points=[-48.8808, -11; -48.8808, -15; -44.8808, -13; -48.8808,
33 -11], style(fillColor=7)),
34 Line(points=[-46, 13; -35, 13; 35, -30; 45, -30]),
35 Line(points=[-45, 40; -35, 40; 35, 0; 44, 0]),
36 Line(points=[-45, -40; -34, -40; 35, 30; 44, 30]),
37 Polygon(points=[-49, 42; -49, 38; -45, 40; -49, 42], style(fillColor=7)),
38 Polygon(points=[-48.8728, -38.0295; -48.8728, -42.0295; -44.8728, -
39 40.0295; -48.8728, -38.0295], style(fillColor=7)),
40 Polygon(points=[-48.9983, 14.8801; -48.9983, 10.8801; -44.9983, 12.8801;
41 -48.9983, 14.8801], style(fillColor=7)),
42 Ellipse(extent=[70.3052, 4.12743; 80.3052, -5.37257], style(fillColor=
43 73)),
44 Line(points=[80, 0; 100, 0]),
45 Polygon(points=[44.1618, 32.3085; 44.1618, 28.3085; 48.1618, 30.3085;
46 44.1618, 32.3085], style(fillColor=73)),
47 Polygon(points=[44.2575, 1.80443; 44.2575, -2.19557; 48.2575, -0.195573;
48 44.2575, 1.80443], style(fillColor=73)),
49 Polygon(points=[44.8805, -28.1745; 44.8805, -32.1745; 48.8805, -30.1745;
50 44.8805, -28.1745], style(fillColor=73)),
51 Line(points=[48, 0; 70, 0]),
52 Line(points=[47, 30; 60, 30; 73, 3]),
53 Line(points=[49, -30; 60, -30; 74, -4]),
54 Text(
55 extent=[-150, -150; 150, -110],
56 string="extract=%extract",
57 style(color=0))),
58 Diagram(
59 Rectangle(extent=[-90, 50; -50, -50], style(color=73, fillColor=7)),
60 Rectangle(extent=[50, 50; 90, -50], style(color=73, fillColor=7)),
61 Polygon(points=[-94.4104, 1.90792; -94.4104, -2.09208; -90.4104, -
62 0.0920762; -94.4104, 1.90792], style(color=73, fillColor=0)),
63 Line(points=[-72, 2; -60.1395, 12.907; -49.1395, 12.907], style(color=
64 73)),
65 Line(points=[-73, 4; -59, 40; -49, 40], style(color=73)),
66 Line(points=[-112, 0; -75.0373, -0.0180176], style(color=73)),
67 Ellipse(extent=[-80.0437, 4.59255; -70.0437, -4.90745], style(color=73,
68 fillColor=73)),
69 Line(points=[-73, -5; -60, -40; -49, -40], style(color=73)),
70 Line(points=[-72, -2; -60.0698, -12.907; -49.0698, -12.907], style(
71 color=73)),
72 Polygon(points=[-48.8808, -11; -48.8808, -15; -44.8808, -13; -48.8808,
73 -11], style(color=73, fillColor=7)),
74 Line(points=[-46, 13; -35, 13; 35, -30; 45, -30], style(color=73)),
75 Line(points=[-45, 40; -35, 40; 35, 0; 44, 0], style(color=73)),
76 Line(points=[-45, -40; -34, -40; 35, 30; 44, 30], style(color=73)),
77 Polygon(points=[-49, 42; -49, 38; -45, 40; -49, 42], style(color=73,
78 fillColor=7)),
79 Polygon(points=[-48.8728, -38.0295; -48.8728, -42.0295; -44.8728, -
80 40.0295; -48.8728, -38.0295], style(color=73, fillColor=7)),
81 Polygon(points=[-48.9983, 14.8801; -48.9983, 10.8801; -44.9983, 12.8801;
82 -48.9983, 14.8801], style(color=73, fillColor=7)),
83 Ellipse(extent=[70.3052, 4.12743; 80.3052, -5.37257], style(color=73,
84 fillColor=73)),
85 Line(points=[80, 0; 105, 0], style(color=73)),
86 Polygon(points=[44.1618, 32.3085; 44.1618, 28.3085; 48.1618, 30.3085;
87 44.1618, 32.3085], style(color=73, fillColor=73)),
88 Polygon(points=[44.2575, 1.80443; 44.2575, -2.19557; 48.2575, -0.195573;
89 44.2575, 1.80443], style(color=73, fillColor=73)),
90 Polygon(points=[44.8805, -28.1745; 44.8805, -32.1745; 48.8805, -30.1745;
91 44.8805, -28.1745], style(color=73, fillColor=73)),
92 Line(points=[48, 0; 70, 0], style(color=73)),
93 Line(points=[47, 30; 60, 30; 73, 3], style(color=73)),
94 Line(points=[49, -30; 60, -30; 74, -4], style(color=73)),
95 Rectangle(extent=[-100, 80; 100, -81])),
96 Documentation(info="<HTML>
97<p>Extract signals from the input connector and transfer them
98to the output connector.</p>
99<p>The extracting scheme is given by the integer vector 'extract'.
100This vector specifies, which input signals are taken and in which
101order they are transfered to the output vector. Note, that the
102dimension of 'extract' has to match the number of outputs.
103Additionally, the dimensions of the input connector signals and
104the output connector signals have to be explicitly defined via the
105parameters 'nin' and 'nout'.</p>
106<p>Example:</p>
107<pre> nin = 7 \"Number of inputs\";
108 nout = 4 \"Number of outputs\";
109 extract[nout] = {6,3,3,2} \"Extracting vector\";
110</pre>
111<p>extracts four output signals (nout=4) from the seven elements of the
112input vector (nin=7):</p>
113<pre> output no. 1 is set equal to input no. 6
114 output no. 2 is set equal to input no. 3
115 output no. 3 is set equal to input no. 3
116 output no. 4 is set equal to input no. 2
117</pre>
118</HTML>
119"));
120equation
121
122 for i in 1:nout loop
123 y[i] = u[extract[i]];
124
125 end for;
126end ExtractSignal;
127
128block Extractor
129 "Extract scalar signal out of signal vector dependent on IntegerRealInput index"
130
131 extends Modelica.Blocks.Interfaces.MISO;
132
133 parameter Boolean allowOutOfRange=false "Index may be out of range";
134 parameter Real outOfRangeValue=1e10 "Output signal if index is out of range";
135
136 annotation (Icon(
137 Rectangle(extent=[-80, 50; -40, -50], style(color=73, fillColor=7)),
138 Polygon(points=[-84.4104, 1.9079; -84.4104, -2.09208; -80.4104, -
139 0.09208; -84.4104, 1.9079], style(color=73, fillColor=0)),
140 Line(points=[-62, 2; -50.1395, 12.907; -39.1395, 12.907], style(color=
141 73)),
142 Line(points=[-63, 4; -49, 40; -39, 40], style(color=73)),
143 Line(points=[-102, 0; -65.0373, -0.01802], style(color=73)),
144 Ellipse(extent=[-70.0437, 4.5925; -60.0437, -4.90745], style(color=73,
145 fillColor=73)),
146 Line(points=[-63, -5; -50, -40; -39, -40], style(color=73)),
147 Line(points=[-62, -2; -50.0698, -12.907; -39.0698, -12.907], style(
148 color=73)),
149 Polygon(points=[-38.8808, -11; -38.8808, -15; -34.8808, -13; -38.8808,
150 -11], style(color=73, fillColor=7)),
151 Polygon(points=[-39, 42; -39, 38; -35, 40; -39, 42], style(color=73,
152 fillColor=7)),
153 Polygon(points=[-38.8728, -38.0295; -38.8728, -42.0295; -34.8728, -
154 40.0295; -38.8728, -38.0295], style(color=73, fillColor=7)),
155 Polygon(points=[-38.9983, 14.8801; -38.9983, 10.8801; -34.9983, 12.8801;
156 -38.9983, 14.8801], style(color=73, fillColor=7)),
157 Rectangle(extent=[-30, 50; 30, -50], style(fillColor=30, fillPattern=1)),
158 Line(points=[100, 0; 0, 0], style(
159 color=77,
160 fillColor=58,
161 fillPattern=1)),
162 Line(points=[0,2; 0,-104], style(
163 color=45,
164 rgbcolor={255,128,0},
165 fillColor=58,
166 rgbfillColor={0,191,0},
167 fillPattern=1)),
168 Line(points=[-35, 40; -20, 40], style(
169 color=77,
170 fillColor=58,
171 fillPattern=1)),
172 Line(points=[-35, 13; -20, 13], style(
173 color=77,
174 fillColor=58,
175 fillPattern=1)),
176 Line(points=[-35, -13; -20, -13], style(
177 color=77,
178 fillColor=58,
179 fillPattern=1)),
180 Line(points=[-35, -40; -20, -40], style(
181 color=77,
182 fillColor=58,
183 fillPattern=1)),
184 Polygon(points=[0, 0; -18, 13; -20, 13; -2, 0; 0, 0], style(color=77,
185 fillPattern=1)),
186 Ellipse(extent=[-6, 6; 6, -6], style(
187 color=45,
188 rgbcolor={255,128,0},
189 fillColor=45,
190 rgbfillColor={255,128,0},
191 fillPattern=1))),
192 Documentation(info="<html>
193<p>This block extracts a scalar output signal out the
194vector of input signals dependent on the Integer
195value of the additional u index:</p>
196<pre> y = u [ index ] ;
197</pre>
198<p>where index is an additional Integer input signal.</p>
199</html>"));
200 Modelica.Blocks.Interfaces.IntegerInput index annotation (
201 extent=[-20, -140; 20, -100], rotation=90);
202 protected
203 Real k[nin];
204equation
205
206 when {initial(),change(index)} then
207
208 for i in 1:nin loop
209 k[i] = if index == i then 1 else 0;
210
211 end for;
212
213 end when;
214
215 y = if not allowOutOfRange or index > 0 and index <= nin then
216 k*u else outOfRangeValue;
217end Extractor;
218
219 block Multiplex2 "Multiplexer block for two input connectors"
220 extends Modelica.Blocks.Interfaces.BlockIcon;
221 parameter Integer n1=1 "dimension of input signal connector 1";
222 parameter Integer n2=1 "dimension of input signal connector 2";
223 Modelica.Blocks.Interfaces.RealInput u1[n1]
224 "Connector of Real input signals 1" annotation (extent=[-140, 40; -100,
225 80]);
226 Modelica.Blocks.Interfaces.RealInput u2[n2]
227 "Connector of Real input signals 2" annotation (extent=[-140, -80; -100,
228 -40]);
229 Modelica.Blocks.Interfaces.RealOutput y[n1 + n2]
230 "Connector of Real output signals" annotation (extent=[100, -10; 120, 10]);
231 annotation (
232 Coordsys(
233 extent=[-100, -100; 100, 100],
234 grid=[2, 2],
235 component=[20, 20]),
236 Window(
237 x=0.2,
238 y=0.34,
239 width=0.56,
240 height=0.6),
241 Documentation(info="<HTML>
242<p>
243The output connector is the <b>concatenation</b> of the two input connectors.
244Note, that the dimensions of the input connector signals have to be
245explicitly defined via parameters n1 and n2.
246</p>
247</HTML>
248"), Icon(
249 Line(points=[8, 0; 102, 0]),
250 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73)),
251 Line(points=[-98, 60; -60, 60; -4, 6]),
252 Line(points=[-98, -60; -60, -60; -4, -4])),
253 Diagram(
254 Line(points=[-98, 60; -60, 60; -4, 6]),
255 Line(points=[-98, -60; -60, -60; -4, -4]),
256 Line(points=[8, 0; 102, 0]),
257 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73))));
258 equation
259 [y] = [u1; u2];
260 end Multiplex2;
261
262 block Multiplex3 "Multiplexer block for three input connectors"
263 extends Modelica.Blocks.Interfaces.BlockIcon;
264 parameter Integer n1=1 "dimension of input signal connector 1";
265 parameter Integer n2=1 "dimension of input signal connector 2";
266 parameter Integer n3=1 "dimension of input signal connector 3";
267 Modelica.Blocks.Interfaces.RealInput u1[n1]
268 "Connector of Real input signals 1" annotation (extent=[-140, 50; -100,
269 90]);
270 Modelica.Blocks.Interfaces.RealInput u2[n2]
271 "Connector of Real input signals 2" annotation (extent=[-140, -20; -100,
272 20]);
273 Modelica.Blocks.Interfaces.RealInput u3[n3]
274 "Connector of Real input signals 3" annotation (extent=[-140, -90; -100,
275 -50]);
276 Modelica.Blocks.Interfaces.RealOutput y[n1 + n2 + n3]
277 "Connector of Real output signals" annotation (extent=[100, -10; 120, 10]);
278 annotation (
279 Coordsys(
280 extent=[-100, -100; 100, 100],
281 grid=[2, 2],
282 component=[20, 20]),
283 Window(
284 x=0.23,
285 y=0.03,
286 width=0.56,
287 height=0.6),
288 Documentation(info="<HTML>
289<p>
290The output connector is the <b>concatenation</b> of the three input connectors.
291Note, that the dimensions of the input connector signals have to be
292explicitly defined via parameters n1, n2 and n3.
293</HTML>
294"), Icon(
295 Line(points=[8, 0; 102, 0]),
296 Line(points=[-100, 70; -60, 70; -4, 6]),
297 Line(points=[-100, 0; -12, 0]),
298 Line(points=[-100, -70; -62, -70; -4, -4]),
299 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73))),
300 Diagram(
301 Line(points=[-100, 70; -60, 70; -4, 6]),
302 Line(points=[-100, -70; -62, -70; -4, -4]),
303 Line(points=[8, 0; 102, 0]),
304 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73)),
305 Line(points=[-100, 0; -12, 0])));
306 equation
307 [y] = [u1; u2; u3];
308 end Multiplex3;
309
310 block Multiplex4 "Multiplexer block for four input connectors"
311 extends Modelica.Blocks.Interfaces.BlockIcon;
312 parameter Integer n1=1 "dimension of input signal connector 1";
313 parameter Integer n2=1 "dimension of input signal connector 2";
314 parameter Integer n3=1 "dimension of input signal connector 3";
315 parameter Integer n4=1 "dimension of input signal connector 4";
316 Modelica.Blocks.Interfaces.RealInput u1[n1]
317 "Connector of Real input signals 1" annotation (extent=[-140, 70; -100,
318 110]);
319 Modelica.Blocks.Interfaces.RealInput u2[n2]
320 "Connector of Real input signals 2" annotation (extent=[-140, 10; -100,
321 50]);
322 Modelica.Blocks.Interfaces.RealInput u3[n3]
323 "Connector of Real input signals 3" annotation (extent=[-140, -50; -100,
324 -10]);
325 Modelica.Blocks.Interfaces.RealInput u4[n4]
326 "Connector of Real input signals 4" annotation (extent=[-140, -110; -100,
327 -70]);
328 Modelica.Blocks.Interfaces.RealOutput y[n1 + n2 + n3 + n4]
329 "Connector of Real output signals" annotation (extent=[100, -10; 120, 10]);
330 annotation (
331 Coordsys(
332 extent=[-100, -100; 100, 100],
333 grid=[1, 1],
334 component=[20, 20]),
335 Window(
336 x=0.33,
337 y=0.1,
338 width=0.59,
339 height=0.67),
340 Documentation(info="<HTML>
341<p>
342The output connector is the <b>concatenation</b> of the four input connectors.
343Note, that the dimensions of the input connector signals have to be
344explicitly defined via parameters n1, n2, n3 and n4.
345</p>
346</HTML>
347"), Icon(
348 Line(points=[8, 0; 102, 0]),
349 Line(points=[-100, 90; -60, 90; -3, 4]),
350 Line(points=[-100, 30; -60, 30; -9, 0]),
351 Line(points=[-99, -30; -59, -30; -10, -5]),
352 Line(points=[-100, -90; -60, -90; -5, -6]),
353 Ellipse(extent=[-15, 15; 15, -15], style(fillColor=73))),
354 Diagram(
355 Line(points=[-100, 90; -60, 90; -3, 4]),
356 Line(points=[-100, -90; -60, -90; -5, -6]),
357 Line(points=[8, 0; 102, 0]),
358 Ellipse(extent=[-15, 15; 15, -15], style(fillColor=73)),
359 Line(points=[-100, 30; -60, 30; -9, 0]),
360 Line(points=[-99, -30; -59, -30; -10, -5])));
361 equation
362 [y] = [u1; u2; u3; u4];
363 end Multiplex4;
364
365 block Multiplex5 "Multiplexer block for five input connectors"
366 extends Modelica.Blocks.Interfaces.BlockIcon;
367 parameter Integer n1=1 "dimension of input signal connector 1";
368 parameter Integer n2=1 "dimension of input signal connector 2";
369 parameter Integer n3=1 "dimension of input signal connector 3";
370 parameter Integer n4=1 "dimension of input signal connector 4";
371 parameter Integer n5=1 "dimension of input signal connector 5";
372 Modelica.Blocks.Interfaces.RealInput u1[n1]
373 "Connector of Real input signals 1" annotation (extent=[-140, 80; -100,
374 120]);
375 Modelica.Blocks.Interfaces.RealInput u2[n2]
376 "Connector of Real input signals 2" annotation (extent=[-140, 30; -100,
377 70]);
378 Modelica.Blocks.Interfaces.RealInput u3[n3]
379 "Connector of Real input signals 3" annotation (extent=[-140, -20; -100,
380 20]);
381 Modelica.Blocks.Interfaces.RealInput u4[n4]
382 "Connector of Real input signals 4" annotation (extent=[-140, -70; -100,
383 -30]);
384 Modelica.Blocks.Interfaces.RealInput u5[n5]
385 "Connector of Real input signals 5" annotation (extent=[-140, -120; -100,
386 -80]);
387 Modelica.Blocks.Interfaces.RealOutput y[n1 + n2 + n3 + n4 + n5]
388 "Connector of Real output signals" annotation (extent=[100, -10; 120, 10]);
389 annotation (
390 Coordsys(
391 extent=[-100, -100; 100, 100],
392 grid=[1, 1],
393 component=[20, 20]),
394 Window(
395 x=0.26,
396 y=0.12,
397 width=0.59,
398 height=0.68),
399 Documentation(info="<HTML>
400<p>
401The output connector is the <b>concatenation</b> of the five input connectors.
402Note, that the dimensions of the input connector signals have to be
403explicitly defined via parameters n1, n2, n3, n4 and n5.
404</p>
405</HTML>
406"), Icon(
407 Line(points=[8, 0; 102, 0]),
408 Line(points=[-100, 100; -60, 100; -4, 6]),
409 Line(points=[-99, 50; -60, 50; -8, 5]),
410 Line(points=[-100, 0; -7, 0]),
411 Line(points=[-99, -50; -60, -50; -9, -6]),
412 Line(points=[-100, -100; -60, -100; -4, -4]),
413 Ellipse(extent=[-15, 15; 15, -15], style(fillColor=73))),
414 Diagram(
415 Line(points=[-100, 100; -60, 100; -4, 6]),
416 Line(points=[-100, -100; -60, -100; -4, -4]),
417 Line(points=[8, 0; 102, 0]),
418 Ellipse(extent=[-15, 15; 15, -15], style(fillColor=73)),
419 Line(points=[-99, 50; -60, 50; -8, 5]),
420 Line(points=[-100, 0; -7, 0]),
421 Line(points=[-99, -50; -60, -50; -9, -6])));
422 equation
423 [y] = [u1; u2; u3; u4; u5];
424 end Multiplex5;
425
426 block Multiplex6 "Multiplexer block for six input connectors"
427 extends Modelica.Blocks.Interfaces.BlockIcon;
428 parameter Integer n1=1 "dimension of input signal connector 1";
429 parameter Integer n2=1 "dimension of input signal connector 2";
430 parameter Integer n3=1 "dimension of input signal connector 3";
431 parameter Integer n4=1 "dimension of input signal connector 4";
432 parameter Integer n5=1 "dimension of input signal connector 5";
433 parameter Integer n6=1 "dimension of input signal connector 6";
434 Modelica.Blocks.Interfaces.RealInput u1[n1]
435 "Connector of Real input signals 1" annotation (extent=[-124, 73; -100,
436 97]);
437 Modelica.Blocks.Interfaces.RealInput u2[n2]
438 "Connector of Real input signals 2" annotation (extent=[-124, 39; -100,
439 63]);
440 Modelica.Blocks.Interfaces.RealInput u3[n3]
441 "Connector of Real input signals 3" annotation (extent=[-124, 5; -100, 29]);
442
443 Modelica.Blocks.Interfaces.RealInput u4[n4]
444 "Connector of Real input signals 4" annotation (extent=[-124, -29; -100,
445 -5]);
446 Modelica.Blocks.Interfaces.RealInput u5[n5]
447 "Connector of Real input signals 5" annotation (extent=[-124, -63; -100,
448 -39]);
449 Modelica.Blocks.Interfaces.RealInput u6[n6]
450 "Connector of Real input signals 6" annotation (extent=[-124, -97; -100,
451 -73]);
452 Modelica.Blocks.Interfaces.RealOutput y[n1 + n2 + n3 + n4 + n5 + n6]
453 "Connector of Real output signals" annotation (extent=[100, -
454 10; 120, 10]);
455 annotation (
456 Coordsys(
457 extent=[-100, -100; 100, 100],
458 grid=[1, 1],
459 component=[20, 20]),
460 Window(
461 x=0.26,
462 y=0.12,
463 width=0.59,
464 height=0.68),
465 Documentation(info="<HTML>
466<p>
467The output connector is the <b>concatenation</b> of the six input connectors.
468Note, that the dimensions of the input connector signals have to be
469explicitly defined via parameters n1, n2, n3, n4, n5 and n6.
470</p>
471</HTML>
472"), Icon(
473 Line(points=[8, 0; 102, 0]),
474 Ellipse(extent=[-15, 15; 15, -15], style(fillColor=73)),
475 Line(points=[-99, 85; -61, 85; -3, 11]),
476 Line(points=[-100, 51; -61, 51; -7, 6]),
477 Line(points=[-101, 17; -60, 17; -9, 2]),
478 Line(points=[-100, -18; -60, -18; -11, -4]),
479 Line(points=[-99, -50; -60, -50; -9, -6]),
480 Line(points=[-100, -85; -60, -85; -3, -10])),
481 Diagram(
482 Line(points=[-99, 85; -61, 85; -3, 11]),
483 Line(points=[-100, -85; -60, -85; -3, -10]),
484 Line(points=[8, 0; 102, 0]),
485 Ellipse(extent=[-15, 15; 15, -15], style(fillColor=73)),
486 Line(points=[-100, 51; -61, 51; -7, 6]),
487 Line(points=[-99, -50; -60, -50; -9, -6]),
488 Line(points=[-101, 17; -60, 17; -9, 2]),
489 Line(points=[-100, -18; -60, -18; -11, -4])));
490 equation
491 [y] = [u1; u2; u3; u4; u5; u6];
492 end Multiplex6;
493
494 block DeMultiplex2 "DeMultiplexer block for two output connectors"
495 extends Modelica.Blocks.Interfaces.BlockIcon;
496 parameter Integer n1=1 "dimension of output signal connector 1";
497 parameter Integer n2=1 "dimension of output signal connector 2";
498 Modelica.Blocks.Interfaces.RealInput u[n1 + n2]
499 "Connector of Real input signals" annotation (extent=[-140, -20; -100, 20]);
500 Modelica.Blocks.Interfaces.RealOutput y1[n1]
501 "Connector of Real output signals 1" annotation (extent=[100, 50; 120, 70]);
502 Modelica.Blocks.Interfaces.RealOutput y2[n2]
503 "Connector of Real output signals 2" annotation (extent=[100, -70; 120, -
504 50]);
505 annotation (
506 Coordsys(
507 extent=[-100, -100; 100, 100],
508 grid=[2, 2],
509 component=[20, 20]),
510 Window(
511 x=0.35,
512 y=0.14,
513 width=0.63,
514 height=0.59),
515 Documentation(info="<HTML>
516<p>
517The input connector is <b>splitted</b> up into two output connectors.
518Note, that the dimensions of the output connector signals have to be
519explicitly defined via parameters n1 and n2.
520</p>
521</HTML>
522"), Icon(
523 Line(points=[100, 60; 60, 60; 10, 8]),
524 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73)),
525 Line(points=[100, -60; 60, -60; 8, -8]),
526 Line(points=[-100, 0; -6, 0])),
527 Diagram(
528 Line(points=[100, 60; 60, 60; 10, 8]),
529 Line(points=[100, -60; 60, -60; 8, -8]),
530 Line(points=[-100, 0; -6, 0]),
531 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73))));
532 equation
533 [u] = [y1; y2];
534 end DeMultiplex2;
535
536 block DeMultiplex3 "DeMultiplexer block for three output connectors"
537 extends Modelica.Blocks.Interfaces.BlockIcon;
538 parameter Integer n1=1 "dimension of output signal connector 1";
539 parameter Integer n2=1 "dimension of output signal connector 2";
540 parameter Integer n3=1 "dimension of output signal connector 3";
541 Modelica.Blocks.Interfaces.RealInput u[n1 + n2 + n3]
542 "Connector of Real input signals" annotation (extent=[-140, -20; -100, 20]);
543 Modelica.Blocks.Interfaces.RealOutput y1[n1]
544 "Connector of Real output signals 1" annotation (extent=[100, 60; 120, 80]);
545 Modelica.Blocks.Interfaces.RealOutput y2[n2]
546 "Connector of Real output signals 2" annotation (extent=[100, -10; 120,
547 10]);
548 Modelica.Blocks.Interfaces.RealOutput y3[n3]
549 "Connector of Real output signals 3" annotation (extent=[100, -80; 120, -
550 60]);
551 annotation (
552 Coordsys(
553 extent=[-100, -100; 100, 100],
554 grid=[1, 1],
555 component=[20, 20]),
556 Window(
557 x=0.19,
558 y=0.08,
559 width=0.65,
560 height=0.68),
561 Documentation(info="<HTML>
562<p>
563The input connector is <b>splitted</b> up into three output connectors.
564Note, that the dimensions of the output connector signals have to be
565explicitly defined via parameters n1, n2 and n3.
566</p>
567</HTML>
568"), Icon(
569 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73)),
570 Line(points=[-100, 0; -6, 0]),
571 Line(points=[100, 70; 60, 70; 4, 5]),
572 Line(points=[0, 0; 101, 0]),
573 Line(points=[100, -70; 61, -70; 5, -5])),
574 Diagram(
575 Line(points=[100, 70; 60, 70; 4, 5]),
576 Line(points=[100, -70; 61, -70; 5, -5]),
577 Line(points=[-100, 0; -6, 0]),
578 Ellipse(extent=[-16, 15; 14, -15], style(fillColor=73)),
579 Line(points=[0, 0; 101, 0])));
580 equation
581 [u] = [y1; y2; y3];
582 end DeMultiplex3;
583
584 block DeMultiplex4 "DeMultiplexer block for four output connectors"
585
586 extends Modelica.Blocks.Interfaces.BlockIcon;
587 parameter Integer n1=1 "dimension of output signal connector 1";
588 parameter Integer n2=1 "dimension of output signal connector 2";
589 parameter Integer n3=1 "dimension of output signal connector 3";
590 parameter Integer n4=1 "dimension of output signal connector 4";
591 Modelica.Blocks.Interfaces.RealInput u[n1 + n2 + n3 + n4]
592 "Connector of Real input signals" annotation (extent=[-140, -20; -100, 20]);
593 Modelica.Blocks.Interfaces.RealOutput y1[n1]
594 "Connector of Real output signals 1" annotation (extent=[100, 80; 120,
595 100]);
596 Modelica.Blocks.Interfaces.RealOutput y2[n2]
597 "Connector of Real output signals 2" annotation (extent=[100, 20; 120, 40]);
598 Modelica.Blocks.Interfaces.RealOutput y3[n3]
599 "Connector of Real output signals 3" annotation (extent=[100, -40; 120, -
600 20]);
601 Modelica.Blocks.Interfaces.RealOutput y4[n4]
602 "Connector of Real output signals 4" annotation (extent=[100, -100; 120,
603 -80]);
604 annotation (
605 Coordsys(
606 extent=[-100, -100; 100, 100],
607 grid=[1, 1],
608 component=[20, 20]),
609 Window(
610 x=0.29,
611 y=0.12,
612 width=0.63,
613 height=0.59),
614 Documentation(info="<HTML>
615<p>
616The input connector is <b>splitted</b> up into four output connectors.
617Note, that the dimensions of the output connector signals have to be
618explicitly defined via parameters n1, n2, n3 and n4.
619</HTML>
620"), Icon(
621 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73)),
622 Line(points=[-100, 0; -6, 0]),
623 Line(points=[100, 90; 60, 90; 6, 5]),
624 Line(points=[100, 30; 60, 30; 9, 2]),
625 Line(points=[100, -30; 60, -30; 8, -4]),
626 Line(points=[99, -90; 60, -90; 6, -6])),
627 Diagram(
628 Line(points=[100, 90; 60, 90; 6, 5]),
629 Line(points=[99, -90; 60, -90; 6, -6]),
630 Line(points=[-100, 0; -6, 0]),
631 Line(points=[100, 30; 60, 30; 9, 2]),
632 Line(points=[100, -30; 60, -30; 8, -4]),
633 Ellipse(extent=[-16, 15; 14, -15], style(fillColor=73))));
634 equation
635 [u] = [y1; y2; y3; y4];
636 end DeMultiplex4;
637
638 block DeMultiplex5 "DeMultiplexer block for five output connectors"
639
640 extends Modelica.Blocks.Interfaces.BlockIcon;
641 parameter Integer n1=1 "dimension of output signal connector 1";
642 parameter Integer n2=1 "dimension of output signal connector 2";
643 parameter Integer n3=1 "dimension of output signal connector 3";
644 parameter Integer n4=1 "dimension of output signal connector 4";
645 parameter Integer n5=1 "dimension of output signal connector 5";
646 Modelica.Blocks.Interfaces.RealInput u[n1 + n2 + n3 + n4 + n5]
647 "Connector of Real input signals" annotation (extent=[-140, -20; -100, 20]);
648 Modelica.Blocks.Interfaces.RealOutput y1[n1]
649 "Connector of Real output signals 1" annotation (extent=[100, 70; 120, 90]);
650 Modelica.Blocks.Interfaces.RealOutput y2[n2]
651 "Connector of Real output signals 2" annotation (extent=[100, 30; 120, 50]);
652 Modelica.Blocks.Interfaces.RealOutput y3[n3]
653 "Connector of Real output signals 3" annotation (extent=[100, -10; 120,
654 10]);
655 Modelica.Blocks.Interfaces.RealOutput y4[n4]
656 "Connector of Real output signals 4" annotation (extent=[100, -50; 120, -
657 30]);
658 Modelica.Blocks.Interfaces.RealOutput y5[n5]
659 "Connector of Real output signals 5" annotation (extent=[100, -90; 120, -
660 70]);
661 annotation (
662 Coordsys(
663 extent=[-100, -100; 100, 100],
664 grid=[1, 1],
665 component=[20, 20]),
666 Window(
667 x=0.15,
668 y=0.16,
669 width=0.63,
670 height=0.59),
671 Documentation(info="<HTML>
672<p>
673The input connector is <b>splitted</b> up into five output connectors.
674Note, that the dimensions of the output connector signals have to be
675explicitly defined via parameters n1, n2, n3, n4 and n5.
676</HTML>
677"), Icon(
678 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73)),
679 Line(points=[-100, 0; -6, 0]),
680 Line(points=[99, 80; 60, 80; 6, 5]),
681 Line(points=[100, 40; 60, 40; 10, 3]),
682 Line(points=[100, 0; 10, 0]),
683 Line(points=[100, -40; 61, -40; 11, -7]),
684 Line(points=[100, -80; 60, -80; 7, -5])),
685 Diagram(
686 Line(points=[99, 80; 60, 80; 6, 5]),
687 Line(points=[100, -80; 60, -80; 7, -5]),
688 Line(points=[-100, 0; -6, 0]),
689 Ellipse(extent=[-14, 15; 16, -15], style(fillColor=73)),
690 Line(points=[100, 40; 60, 40; 10, 3]),
691 Line(points=[100, 0; 10, 0]),
692 Line(points=[100, -40; 61, -40; 11, -7])));
693 equation
694 [u] = [y1; y2; y3; y4; y5];
695 end DeMultiplex5;
696
697 block DeMultiplex6 "DeMultiplexer block for six output connectors"
698 extends Modelica.Blocks.Interfaces.BlockIcon;
699 parameter Integer n1=1 "dimension of output signal connector 1";
700 parameter Integer n2=1 "dimension of output signal connector 2";
701 parameter Integer n3=1 "dimension of output signal connector 3";
702 parameter Integer n4=1 "dimension of output signal connector 4";
703 parameter Integer n5=1 "dimension of output signal connector 5";
704 parameter Integer n6=1 "dimension of output signal connector 6";
705 Modelica.Blocks.Interfaces.RealInput u[n1 + n2 + n3 + n4 + n5 + n6]
706 "Connector of Real input signals" annotation (extent=[-140, -20;
707 -100, 20]);
708 Modelica.Blocks.Interfaces.RealOutput y1[n1]
709 "Connector of Real output signals 1" annotation (extent=[100, 80; 120,
710 100]);
711 Modelica.Blocks.Interfaces.RealOutput y2[n2]
712 "Connector of Real output signals 2" annotation (extent=[100, 44; 120, 64]);
713 Modelica.Blocks.Interfaces.RealOutput y3[n3]
714 "Connector of Real output signals 3" annotation (extent=[100, 8; 120, 28]);
715 Modelica.Blocks.Interfaces.RealOutput y4[n4]
716 "Connector of Real output signals 4" annotation (extent=[100, -28; 120, -
717 8]);
718 Modelica.Blocks.Interfaces.RealOutput y5[n5]
719 "Connector of Real output signals 5" annotation (extent=[100, -64; 120, -
720 44]);
721 Modelica.Blocks.Interfaces.RealOutput y6[n6]
722 "Connector of Real output signals 6" annotation (extent=[100, -100; 120,
723 -80]);
724 annotation (
725 Coordsys(
726 extent=[-100, -100; 100, 100],
727 grid=[1, 1],
728 component=[20, 20]),
729 Window(
730 x=0.15,
731 y=0.16,
732 width=0.63,
733 height=0.59),
734 Documentation(info="<HTML>
735<p>
736The input connector is <b>splitted</b> up into six output connectors.
737Note, that the dimensions of the output connector signals have to be
738explicitly defined via parameters n1, n2, n3, n4, n5 and n6.
739</HTML>
740"), Icon(
741 Ellipse(extent=[-14, 16; 16, -14], style(fillColor=73)),
742 Line(points=[-100, 0; -6, 0]),
743 Line(points=[99, 90; 60, 90; 5, 10]),
744 Line(points=[100, 53; 60, 53; 8, 6]),
745 Line(points=[100, 18; 59, 18; 7, 2]),
746 Line(points=[100, -19; 60, -19; 13, -2]),
747 Line(points=[99, -54; 60, -54; 9, -1]),
748 Line(points=[100, -91; 60, -91; 3, -7])),
749 Diagram(
750 Line(points=[99, 90; 60, 90; 5, 10]),
751 Line(points=[100, -91; 60, -91; 3, -7]),
752 Line(points=[-100, 0; -6, 0]),
753 Ellipse(extent=[-14, 15; 16, -15], style(fillColor=73)),
754 Line(points=[100, 53; 60, 53; 8, 6]),
755 Line(points=[99, -54; 60, -54; 9, -1]),
756 Line(points=[100, 18; 59, 18; 7, 2]),
757 Line(points=[100, -19; 60, -19; 13, -2])));
758 equation
759 [u] = [y1; y2; y3; y4; y5; y6];
760 end DeMultiplex6;
761
762 annotation (Documentation(info="<html>
763<p>
764This package contains blocks to combine and extract signals.
765</p>
766</html>"));
767end Routing;