forked from modelica/ModelicaStandardLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.mo
8798 lines (7838 loc) · 410 KB
/
package.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
within ;
package Modelica "Modelica Standard Library - Version 4.0.0"
extends Modelica.Icons.Package;
package UsersGuide "User's Guide"
extends Modelica.Icons.Information;
class Overview "Overview of Modelica Library"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<p>
The Modelica Standard Library consists of the following
main sub-libraries:
</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<tr><th>Library Components</th> <th>Description</th></tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Electrical.png\">
</td>
<td>
<a href=\"modelica://Modelica.Electrical.Analog\">Analog</a><br>
Analog electric and electronic components, such as
resistor, capacitor, transformers, diodes, transistors,
transmission lines, switches, sources, sensors.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Digital.png\">
</td>
<td>
<a href=\"modelica://Modelica.Electrical.Digital\">Digital</a><br>
Digital electrical components based on the VHDL standard,
like basic logic blocks with 9-value logic, delays, gates,
sources, converters between 2-, 3-, 4-, and 9-valued logic.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Machines.png\">
</td>
<td>
<a href=\"modelica://Modelica.Electrical.Machines\">Machines</a><br>
Electrical asynchronous-, synchronous-, and DC-machines
(motors and generators) as well as three-phase transformers.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-FluxTubes.png\">
</td>
<td>
<a href=\"modelica://Modelica.Magnetic.FluxTubes\">FluxTubes</a><br>
Based on magnetic flux tubes concepts. Especially to model electromagnetic actuators. Nonlinear shape, force, leakage, and material models. Material data for steel, electric sheet, pure iron, Cobalt iron, Nickel iron, NdFeB, Sm2Co17, and more.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Translational.png\">
</td>
<td>
<a href=\"modelica://Modelica.Mechanics.Translational\">Translational</a><br>
1-dim. mechanical, translational systems, e.g.,
sliding mass, mass with stops, spring, damper.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Rotational.png\">
</td>
<td>
<a href=\"modelica://Modelica.Mechanics.Rotational\">Rotational</a><br>
1-dim. mechanical, rotational systems, e.g., inertias, gears,
planetary gears, convenient definition of speed/torque dependent friction
(clutches, brakes, bearings, ..)
</td>
</tr>
<tr><td width=\"100\">
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-MultiBody1.png\"><br>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-MultiBody2.png\">
</td>
<td>
<a href=\"modelica://Modelica.Mechanics.MultiBody\">MultiBody</a>
3-dim. mechanical systems consisting of joints, bodies, force and
sensor elements. Joints can be driven by drive trains defined by
1-dim. mechanical system library (Rotational).
Every component has a default animation.
Components can be arbitrarily connected together.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Fluid.png\">
</td>
<td>
<a href=\"modelica://Modelica.Fluid\">Fluid</a><br>
1-dim. thermo-fluid flow in networks of vessels, pipes,
fluid machines, valves and fittings. All media from the
Modelica.Media library can be used (so incompressible or compressible,
single or multiple substance, one or two phase medium).
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Media.png\">
</td>
<td>
<a href=\"modelica://Modelica.Media\">Media</a><br>
Large media library providing models and functions
to compute media properties, such as h = h(p,T), d = d(p,T),
for the following media:
<ul>
<li> 1240 gases and mixtures between these gases.</li>
<li> incompressible, table based liquids (h = h(T), etc.).</li>
<li> compressible liquids</li>
<li> dry and moist air</li>
<li> high precision model for water (IF97).</li>
</ul>
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Thermal.png\">
</td>
<td>
<a href=\"modelica://Modelica.Thermal.FluidHeatFlow\">FluidHeatFlow</a>,
<a href=\"modelica://Modelica.Thermal.HeatTransfer\">HeatTransfer</a>
Simple thermo-fluid pipe flow, especially to model cooling of machines
with air or water (pipes, pumps, valves, ambient, sensors, sources) and
lumped heat transfer with heat capacitors, thermal conductors, convection,
body radiation, sources and sensors.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Blocks1.png\"><br>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Blocks2.png\">
</td>
<td>
<a href=\"modelica://Modelica.Blocks\">Blocks</a><br>
Input/output blocks to model block diagrams and logical networks, e.g.,
integrator, PI, PID, transfer function, linear state space system,
sampler, unit delay, discrete transfer function, and/or blocks,
timer, hysteresis, nonlinear and routing blocks, sources, tables.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-Clocked.png\">
</td>
<td>
<a href=\"modelica://Modelica.Clocked\">Clocked</a><br>
Blocks to precisely define and synchronize sampled data systems with different
sampling rates. Continuous-time equations can be automatically discretized and
utilized in a sampled data system. The library is based on the clocked
synchronous language elements introduced in Modelica 3.3.
</td>
</tr>
<tr><td>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Lib-StateGraph.png\">
</td>
<td>
<a href=\"modelica://Modelica.StateGraph\">StateGraph</a><br>
Hierarchical state machines with a similar modeling power as Statecharts.
Modelica is used as synchronous action language, i.e., deterministic
behavior is guaranteed
</td>
</tr>
<tr><td>
<blockquote><pre>
A = [1,2,3;
3,4,5;
2,1,4];
b = {10,22,12};
x = Matrices.solve(A,b);
Matrices.eigenValues(A);
</pre></blockquote>
</td>
<td>
<a href=\"modelica://Modelica.Math\">Math</a>,
<a href=\"modelica://Modelica.Utilities\">Utilities</a><br>
Functions operating on vectors and matrices, such as for solving
linear systems, eigen and singular values etc., and
functions operating on strings, streams, files, e.g.,
to copy and remove a file or sort a vector of strings.
</td>
</tr>
</table>
</html>"));
end Overview;
class Connectors "Connectors"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<p>
The Modelica standard library defines the most important
<strong>elementary connectors</strong> in various domains. If any possible,
a user should utilize these connectors in order that components
from the Modelica Standard Library and from other libraries
can be combined without problems.
The following elementary connectors are defined
(the meaning of potential, flow, and stream
variables is explained in section \"Connector Equations\" below):
</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"1\">
<tr><td><strong>domain</strong></td>
<td><strong>potential<br>variables</strong></td>
<td><strong>flow<br>variables</strong></td>
<td><strong>stream<br>variables</strong></td>
<td><strong>connector definition</strong></td>
<td><strong>icons</strong></td></tr>
<tr><td><strong>electrical<br>analog</strong></td>
<td>electrical potential</td>
<td>electrical current</td>
<td></td>
<td><a href=\"modelica://Modelica.Electrical.Analog.Interfaces\">Modelica.Electrical.Analog.Interfaces</a>
<br>Pin, PositivePin, NegativePin</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/ElectricalPins.png\"></td></tr>
<tr><td><strong>electrical<br>polyphase</strong></td>
<td colspan=\"3\">vector of electrical pins</td>
<td><a href=\"modelica://Modelica.Electrical.Polyphase.Interfaces\">Modelica.Electrical.Polyphase.Interfaces</a>
<br>Plug, PositivePlug, NegativePlug</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/ElectricalPlugs.png\"></td></tr>
<tr><td><strong>electrical<br>space phasor</strong></td>
<td>2 electrical potentials</td>
<td>2 electrical currents</td>
<td></td>
<td><a href=\"modelica://Modelica.Electrical.Machines.Interfaces\">Modelica.Electrical.Machines.Interfaces</a>
<br>SpacePhasor</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/SpacePhasor.png\"></td></tr>
<tr><td><strong>quasi-static<br>single-phase</strong></td>
<td>complex electrical potential</td>
<td>complex electrical current</td>
<td></td>
<td><a href=\"modelica://Modelica.Electrical.QuasiStatic.SinglePhase.Interfaces\">
Modelica.Electrical.QuasiStatic.SinglePhase.Interfaces</a>
<br>Pin, PositivePin, NegativePin</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/QuasiStaticSinglePhasePins.png\"></td></tr>
<tr><td><strong>quasi-static<br>polyphase</strong></td>
<td colspan=\"3\">vector of quasi-static single-phase pins</td>
<td><a href=\"modelica://Modelica.Electrical.QuasiStatic.Polyphase.Interfaces\">Modelica.Electrical.QuasiStatic.Polyphase.Interfaces</a>
<br>Plug, PositivePlug, NegativePlug</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/QuasiStaticPolyphasePlugs.png\"></td></tr>
<tr><td><strong>electrical<br>digital</strong></td>
<td>Integer (1..9)</td>
<td></td>
<td></td>
<td><a href=\"modelica://Modelica.Electrical.Digital.Interfaces\">Modelica.Electrical.Digital.Interfaces</a>
<br>DigitalSignal, DigitalInput, DigitalOutput</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/Digital.png\"></td></tr>
<tr><td><strong>magnetic<br>flux tubes</strong></td>
<td>magnetic potential</td>
<td>magnetic flux</td>
<td></td>
<td>
<a href=\"modelica://Modelica.Magnetic.FluxTubes.Interfaces\">Modelica.Magnetic.FluxTubes.Interfaces</a>
<br>MagneticPort, PositiveMagneticPort,<br>NegativeMagneticPort</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/MagneticPorts.png\"></td></tr>
<tr><td><strong>magnetic<br>fundamental<br>wave</strong></td>
<td>complex magnetic potential</td>
<td>complex magnetic flux</td>
<td></td>
<td>
<a href=\"modelica://Modelica.Magnetic.FundamentalWave.Interfaces\">Modelica.Magnetic.FundamentalWave.Interfaces</a>
<br>MagneticPort, PositiveMagneticPort,<br>NegativeMagneticPort</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/FundamentalWavePorts.png\"></td></tr>
<tr><td><strong>translational</strong></td>
<td>distance</td>
<td>cut-force</td>
<td></td>
<td><a href=\"modelica://Modelica.Mechanics.Translational.Interfaces\">Modelica.Mechanics.Translational.Interfaces</a>
<br>Flange_a, Flange_b</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/TranslationalFlanges.png\"></td></tr>
<tr><td><strong>rotational</strong></td>
<td>angle</td>
<td>cut-torque</td>
<td></td>
<td><a href=\"modelica://Modelica.Mechanics.Rotational.Interfaces\">Modelica.Mechanics.Rotational.Interfaces</a>
<br>Flange_a, Flange_b</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/RotationalFlanges.png\"></td></tr>
<tr><td><strong>3-dim.<br>mechanics</strong></td>
<td>position vector<br>
orientation object</td>
<td>cut-force vector<br>
cut-torque vector</td>
<td></td>
<td><a href=\"modelica://Modelica.Mechanics.MultiBody.Interfaces\">Modelica.Mechanics.MultiBody.Interfaces</a>
<br>Frame, Frame_a, Frame_b, Frame_resolve</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/MultiBodyFrames.png\"></td></tr>
<tr><td><strong>simple<br>fluid flow</strong></td>
<td>pressure<br>
specific enthalpy</td>
<td>mass flow rate<br>
enthalpy flow rate</td>
<td></td>
<td><a href=\"modelica://Modelica.Thermal.FluidHeatFlow.Interfaces\">Modelica.Thermal.FluidHeatFlow.Interfaces</a>
<br>FlowPort, FlowPort_a, FlowPort_b</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/FluidHeatFlowPorts.png\"></td></tr>
<tr><td><strong>thermo<br>fluid flow</strong></td>
<td>pressure</td>
<td>mass flow rate</td>
<td>specific enthalpy<br>mass fractions</td>
<td>
<a href=\"modelica://Modelica.Fluid.Interfaces\">Modelica.Fluid.Interfaces</a>
<br>FluidPort, FluidPort_a, FluidPort_b</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/FluidPorts.png\"></td></tr>
<tr><td><strong>heat<br>transfer</strong></td>
<td>temperature</td>
<td>heat flow rate</td>
<td></td>
<td><a href=\"modelica://Modelica.Thermal.HeatTransfer.Interfaces\">Modelica.Thermal.HeatTransfer.Interfaces</a>
<br>HeatPort, HeatPort_a, HeatPort_b</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/ThermalHeatPorts.png\"></td></tr>
<tr><td><strong>blocks</strong></td>
<td>
Real variable<br>
Integer variable<br>
Boolean variable</td>
<td></td>
<td></td>
<td><a href=\"modelica://Modelica.Blocks.Interfaces\">Modelica.Blocks.Interfaces</a>
<br>
RealSignal, RealInput, RealOutput<br>
IntegerSignal, IntegerInput, IntegerOutput<br>
BooleanSignal, BooleanInput, BooleanOutput</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/Signals.png\"></td></tr>
<tr><td><strong>complex<br>blocks</strong></td>
<td>
Complex variable</td>
<td></td>
<td></td>
<td><a href=\"modelica://Modelica.ComplexBlocks.Interfaces\">Modelica.ComplexBlocks.Interfaces</a>
<br>ComplexSignal, ComplexInput, ComplexOutput</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/ComplexSignals.png\"></td></tr>
<tr><td><strong>state<br>machine</strong></td>
<td>Boolean variables<br>
(occupied, set,<br>
available, reset)</td>
<td></td>
<td></td>
<td><a href=\"modelica://Modelica.StateGraph.Interfaces\">Modelica.StateGraph.Interfaces</a>
<br>Step_in, Step_out, Transition_in, Transition_out</td>
<td><img src=\"modelica://Modelica/Resources/Images/UsersGuide/StateGraphPorts.png\"></td></tr>
</table>
<p>
In all domains, usually 2 connectors are defined. The variable declarations
are <strong>identical</strong>, only the icons are different in order that it is easy
to distinguish connectors of the same domain that are attached at the same
component.
</p>
<h4>Hierarchical Connectors </h4>
<p>
Modelica supports also hierarchical connectors, in a similar way as hierarchical models.
As a result, it is, e.g., possible, to collect elementary connectors together.
For example, an electrical plug consisting of two electrical pins can be defined as:
</p>
<blockquote><pre>
<strong>connector</strong> Plug
<strong>import</strong> Modelica.Electrical.Analog.Interfaces;
Interfaces.PositivePin phase;
Interfaces.NegativePin ground;
<strong>end</strong> Plug;
</pre></blockquote>
<p>
With one connect(..) equation, either two plugs can be connected
(and therefore implicitly also the phase and ground pins) or a
Pin connector can be directly connected to the phase or ground of
a Plug connector, such as \"connect(resistor.p, plug.phase)\".
</p>
<h4 id=\"ConnectorEquations\">Connector Equations</h4>
<p>
The connector variables listed above have been basically determined
with the following strategy:
</p>
<ol>
<li> State the relevant balance equations and boundary
conditions of a volume for the particular physical domain.</li>
<li> Simplify the balance equations and boundary conditions
of (1) by taking the
limit of an infinitesimal small volume
(e.g., thermal domain:
temperatures are identical and heat flow rates
sum up to zero).
</li>
<li> Use the variables needed for the balance equations
and boundary conditions of (2)
in the connector and select appropriate Modelica
<strong>prefixes</strong>, so that these equations
are generated by the Modelica connection semantics.
</li>
</ol>
<p>
The Modelica connection semantics is sketched at hand
of an example: Three connectors c1, c2, c3 with the definition
</p>
<blockquote><pre>
<strong>connector</strong> Demo
Real p; // potential variable
<strong>flow</strong> Real f; // flow variable
<strong>stream</strong> Real s; // stream variable
<strong>end</strong> Demo;
</pre></blockquote>
<p>
are connected together with
</p>
<blockquote><pre>
<strong>connect</strong>(c1,c2);
<strong>connect</strong>(c1,c3);
</pre></blockquote>
<p>
then this leads to the following equations:
</p>
<blockquote><pre>
// Potential variables are identical
c1.p = c2.p;
c1.p = c3.p;
// The sum of the flow variables is zero
0 = c1.f + c2.f + c3.f;
/* The sum of the product of flow variables and upstream stream variables is zero
(this implicit set of equations is explicitly solved when generating code;
the \"<undefined>\" parts are defined in such a way that
inStream(..) is continuous).
*/
0 = c1.f*(<strong>if</strong> c1.f > 0 <strong>then</strong> s_mix <strong>else</strong> c1.s) +
c2.f*(<strong>if</strong> c2.f > 0 <strong>then</strong> s_mix <strong>else</strong> c2.s) +
c3.f*(<strong>if</strong> c3.f > 0 <strong>then</strong> s_mix <strong>else</strong> c3.s);
<strong>inStream</strong>(c1.s) = <strong>if</strong> c1.f > 0 <strong>then</strong> s_mix <strong>else</strong> <undefined>;
<strong>inStream</strong>(c2.s) = <strong>if</strong> c2.f > 0 <strong>then</strong> s_mix <strong>else</strong> <undefined>;
<strong>inStream</strong>(c3.s) = <strong>if</strong> c3.f > 0 <strong>then</strong> s_mix <strong>else</strong> <undefined>;
</pre></blockquote>
</html>"));
end Connectors;
package Conventions "Conventions"
extends Modelica.Icons.Information;
package Documentation "HTML documentation"
extends Modelica.Icons.Information;
package Format "Format"
extends Modelica.Icons.Information;
class Cases "Cases"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<p>In the Modelica documentation sometimes different cases have to be distinguished. If the case distinction refers to Modelica parameters or variables (Boolean expressions) the comparisons should be written in the style of Modelica code within <code><code></code> and <code></code></code>
</p>
<h4>Examples</h4>
<h5>Example 1</h5>
<p>
<code><p>If <code>useCage == true</code>, a damper cage is considered in the model...</p></code>
</p>
<p>appears as</p>
<p>If <code>useCage == true</code>, a damper cage is considered in the model...</p>
<p>
For more complex case scenarios, an unordered list should be used. In this case only Modelica specific code segments and Boolean expressions.
</p>
<h5>Example 2</h5>
<blockquote><pre>
<ul>
<li> If <code>useCage == true</code>, a damper cage is considered in the model.
Cage parameters must be specified in this case.</li>
<li> If <code>useCage == false</code>, the damper cage is omitted.</li>
</ul>
</pre></blockquote>
<p>appears as</p>
<ul>
<li> If <code>useCage == true</code>, a damper cage is considered in the model.
Cage parameters must be specified in this case.</li>
<li> If <code>useCage == false</code>, the damper cage is omitted.</li>
</ul>
<p>
In a more equation oriented case, additional equations or code segments can be added.
</p>
<h5>Example 3</h5>
<blockquote><pre>
<ul>
<li>if <code>usePolar == true</code>, assign magnitude and angle to output <br>
<!-- insert graphical representation of equations -->
y[i,1] = sqrt( a[i]^2 + b[i]^2 ) <br>
y[i,2] = atan2( b[i], a[i] )
</li>
<li>if <code>usePolar == false</code>, assign cosine and sine to output <br>
<!-- insert graphical representation of equations -->
y[i,1] = a[i] <br>
y[i,2] = b[i]
</li>
</ul>
</pre></blockquote>
<p>appears as</p>
<ul>
<li>if <code>usePolar == true</code>, assign magnitude and angle to output<br>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Cases/y_i1_polar.png\"
alt=\"y[i,1] = sqrt( a[i]^2 + b[i]^2 )\"><br>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Cases/y_i2_polar.png\"
alt=\"y[i,2] = atan2( b[i], a[i] )\">
</li>
<li>if <code>usePolar == false</code>, assign cosine and sine to output<br>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Cases/y_i1_rect.png\"
alt=\"y[i,1] = a[i]\"><br>
<img src=\"modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Cases/y_i2_rect.png\"
alt=\" y[i,2] = b[i]\">
</li>
</ul>
</html>"));
end Cases;
class Code "Code"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<p>
<a href=\"modelica://Modelica.UsersGuide.Conventions.ModelicaCode\">Modelica code</a> conventions of class and instance names,
parameters and variables are specified separately. In this section it is summarized how to refer to
Modelica code in the HTML documentation.
</p>
<ol>
<li> For constants, parameters and variables in code segments <code><code></code>
and <code></code></code> should to be used, e.g.,<br>
<code><strong>parameter</strong> Modelica.Units.SI.Time tStart "Start time"</code></li>
<li> Write multi or single line code segments as quoted preformatted text, i.e., embedded within
<code><blockquote><pre></code> and <code></pre></blockquote></code> tags.</li>
<li> Multi line or single line code shall not be additionally indented.</li>
<li> Inline code segments may be typeset with <code><code></code> and <code></code></code>.</li>
<li> In code segments use bold to emphasize Modelica keywords.</li>
</ol>
<h4>Examples</h4>
<h5>Example 1</h5>
<blockquote><pre>
<blockquote><pre>
<strong>connector</strong> Frame
...
<strong>flow</strong> SI.Force f[3] <strong>annotation</strong>(unassignedMessage="...");
<strong>end</strong> Frame;
</pre></blockquote>
</pre></blockquote>
<p>appears as</p>
<blockquote><pre>
<strong>connector</strong> Frame
...
<strong>flow</strong> SI.Force f[3] <strong>annotation</strong>(unassignedMessage="...");
<strong>end</strong> Frame;
</pre></blockquote>
<h5>Example 2</h5>
<blockquote><pre>
<blockquote><pre>
<strong>parameter</strong> Modelica.Units.SI.Conductance G=1 "Conductance";
</pre></blockquote>
</pre></blockquote>
<p>appears as</p>
<blockquote><pre>
<strong>parameter</strong> Modelica.Units.SI.Conductance G=1 "Conductance";
</pre></blockquote>
</html>"));
end Code;
class Equations "Equations"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<p>
In the context of <a href=\"http://www.w3c.org/\">HTML</a> documentation
equations should have a graphical representation in PNG format. For that purpose tool
specific math typing capabilities can be used. Alternatively the LaTeX to HTML translator
<a href=\"http://www.latex2html.org\">LaTeX2HTML</a>, or the
<a href=\"http://www.homeschoolmath.net/worksheets/equation_editor.php\">Online Equation Editor</a>
or <a href=\"http://www.codecogs.com/latex/eqneditor.php\">codecogs</a> can be used.
</p>
<p>
A typical equation, e.g., of a Fourier synthesis, could look like<br>
<img
src=\"modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Equations/fourier.png\"><br>
or<br>
<img
src=\"modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Equations/sample.png\"
alt=\"y=a_1+a_2\"><br>
In an <code>alt</code> tag the original equation should be stored, e.g.,</p>
<blockquote><pre>
<img
src="modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Equations/sample.png"
alt="y=a_1+a_2">
</pre></blockquote>
<p>
If one wants to refer to particular variables and parameters in the documentation text, either a
graphical representation (PNG file) or italic fonts for regular physical symbols and lower case
<a href=\"http://www.w3.org/TR/html4/sgml/entities.html\">Greek letters</a>
should be used. Full word variables and full word indices should be spelled within
<code><code></code> and <code></code></code>.
Vector and array indices should be typeset as subscripts using the
<code><sub></code> and <code></sub></code> tags.
</p>
<p> Examples for such variables and parameters are:
<em>φ</em>, <em>φ</em><sub>ref</sub>, <em>v<sub>2</sub></em>, <code>useDamperCage</code>.
</p>
<h4>Numbered equations</h4>
<p>For numbering equations a one row table with two columns should be used. The equation number should be placed in the right column:</p>
<blockquote><pre>
<table border="0" cellspacing="10" cellpadding="2">
<tr>
<td><img
src="modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Equations/sample.png"
alt="y=a_1+a_2"> </td>
<td>(1)</td>
</tr>
</table>
</pre></blockquote>
<p>appears as:</p>
<table border=\"0\" cellspacing=\"10\" cellpadding=\"2\">
<tr>
<td><img
src=\"modelica://Modelica/Resources/Images/UsersGuide/Conventions/Documentation/Format/Equations/sample.png\"
alt=\"y=a_1+a_2\"></td>
<td>(1)</td>
</tr>
</table>
</html>"));
end Equations;
class Figures "Figures"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<p>
Figures should in particular be included to examples to discuss the problems and results of the respective model. The library developers are yet encouraged to add figures to the documentation of other components to support the understanding of the users of the library.
</p>
<ol>
<li> Figures have to be placed <strong>outside</strong> of paragraphs to be HTML compliant.</li>
<li> Figures need to have <strong>at least</strong> a <code>src</code> and an <code>alt</code> attribute defined to be HTML compliant.</li>
<li> Technical figures should be placed within a table environment. Each technical figure should then also have a caption. The figure caption starts with a capital letter.</li>
<li> Illustration can be embedded without table environment.</li>
</ol>
<h4>Location of files</h4>
<p>
The <code>PNG</code> files should be placed in a folder which exactly represents the package structure.
</p>
<h4>Examples</h4>
<h5>Example 1</h5>
<p>This example shows how an illustration should be embedded in the Example
<a href=\"modelica://Modelica.Blocks.Examples.PID_Controller\">PID_Controller</a> of the
<a href=\"modelica://Modelica.Blocks\">Blocks</a> package.
</p>
<blockquote><pre>
<img src="modelica://Modelica/Resources/Images/Blocks/PID_controller.png"
alt="PID_controller.png">
</pre></blockquote>
<h5>Example 2</h5>
<p>This is a simple example of a technical figure with caption.</p>
<blockquote><pre>
<table border="0" cellspacing="0" cellpadding="2">
<caption align="bottom">Caption starts with a capital letter</caption>
<tr>
<td>
<img src="modelica://Modelica/Resources/Images/Blocks/PID_controller.png"
alt="PID_controller.png">
</td>
</tr>
</table>
</pre></blockquote>
<h5>Example 3</h5>
<p>To refer to a certain figure, a figure number may be added. In such case the figure name (Fig.) including the figure enumeration (1,2,...) have to be displayed bold using <code><strong></code> and <code></strong></code>.</p>
<p>The figure name and enumeration should look like this: <strong>Fig. 1:</strong></p>
<p>Figures have to be enumerated manually.</p>
<blockquote><pre>
<table border="0" cellspacing="0" cellpadding="2">
<caption align="bottom"><strong>Fig. 2:</strong> Caption starts with a capital letter</caption>
<tr>
<td>
<img src="modelica://Modelica/Resources/Images/Blocks/PID_controller.png"
alt="PID_controller.png">
</td>
</tr>
</table>
</pre></blockquote>
</html>"));
end Figures;
class Hyperlinks "Hyperlinks"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<ol>
<li> Hyperlinks should always be made when referring to a component or package.</li>
<li> The hyperlink text in between <code><a href="..."></code> and <code></a></code> should include the full main package name.</li>
<li> A link to an external component should include the full name of the package that it is referred to.</li>
<li> Modelica hyperlinks have to use the scheme <code>"modelica://..."</code></li>
<li> For hyperlinks referring to a Modelica component, see Example 1 and 2.</li>
<li> No links to commercial web sites are allowed.</li>
</ol>
<h4>Examples</h4>
<h5>Example 1</h5>
<blockquote><pre>
<a href="modelica://Modelica.Mechanics.MultiBody.UsersGuide.Tutorial.LoopStructures.PlanarLoops">
Modelica.Mechanics.MultiBody.UsersGuide.Tutorial.LoopStructures.PlanarLoops</a>
</pre></blockquote>
<p>appears as</p>
<a href=\"modelica://Modelica.Mechanics.MultiBody.UsersGuide.Tutorial.LoopStructures.PlanarLoops\">
Modelica.Mechanics.MultiBody.UsersGuide.Tutorial.LoopStructures.PlanarLoops</a>
<h5>Example 2</h5>
<blockquote><pre>
<p>
The feeder cables are connected to an
<a href="modelica://Modelica.Electrical.Machines.BasicMachines.InductionMachines.IM_SquirrelCage">
induction machine</a>.
</p>
</pre></blockquote>
<p>appears as</p>
<p>
The feeder cables are connected to an
<a href=\"modelica://Modelica.Electrical.Machines.BasicMachines.InductionMachines.IM_SquirrelCage\">
induction machine</a>.
</p>
</html>"));
end Hyperlinks;
class Lists "Lists"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<ol>
<li> Lists have to be placed <strong>outside</strong> of paragraphs to be HTML compliant.</li>
<li> Items of a list shall start with
<ol>
<li> a capital letter if each item is a full sentence</li>
<li> a small letter, if only text fragments are used or the list is fragment of a sentence</li>
</ol></li>
</ol>
<h4>Examples</h4>
<h5>Example 1</h5>
<p>This is a simple example of an enumerated (ordered) list</p>
<blockquote><pre>
<ol>
<li>item 1</li>
<li>item 2</li>
</ol>
</pre></blockquote>
<p>appears as</p>
<ol>
<li>item 1</li>
<li>item 2</li>
</ol>
<h5>Example 2</h5>
<p>This is a simple example of an unnumbered list.</p>
<blockquote><pre>
<ul>
<li>item 1</li>
<li>item 2</li>
</ul>
</pre></blockquote>
<p>appears as</p>
<ul>
<li>item 1</li>
<li>item 2</li>
</ul>
</html>"));
end Lists;
class References "References"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<ol>
<li> Refer to references by [1], [Andronov1973], etc. by hyperlink and summarize literature in the references subsection of
<a href=\"modelica://Modelica.UsersGuide.Conventions.UsersGuide.References\">Conventions.UsersGuide.References</a>.</li>
<li> There has to be made at least one citation to each reference.</li>
</ol>
<h4>Examples</h4>
<h5>Example 1</h5>
<blockquote><pre>
<p>
More details about electric machine modeling
can be found in [<a href="modelica://Modelica.UsersGuide.Conventions.UsersGuide.References">Gao2008</a>]
and
[<a href="modelica://Modelica.UsersGuide.Conventions.UsersGuide.References">Kral2018</a>, p. 149].
</p>
</pre></blockquote>
<p>appears as</p>
<p>
More details about electric machine modeling
can be found in [<a href=\"modelica://Modelica.UsersGuide.Conventions.UsersGuide.References\">Gao2008</a>]
and
[<a href=\"modelica://Modelica.UsersGuide.Conventions.UsersGuide.References\">Kral2018</a>, p. 149].
</p>
</html>"));
end References;
class Tables "Tables"
extends Modelica.Icons.Information;
annotation (Documentation(info="<html>
<ol>
<li> Tables should always be typeset with <code><table></code> and <code></table></code>,
not with <code><pre></code> and <code></pre></code>.</li>
<li> Tables have to be placed <strong>outside</strong> of paragraphs to be HTML compliant.</li>
<li> Each table must have a table caption.</li>
<li> Table headers and entries start with capital letters.</li>
</ol>
<h4>Examples</h4>
<h5>Example 1</h5>
<p>This is a simple example of a table.</p>
<blockquote><pre>
<table border="1" cellspacing="0" cellpadding="2">
<caption align="bottom">Caption starts with a capital letter</caption>
<tr>
<th>Head 1</th>
<th>Head 2</th>
</tr>
<tr>
<td>Entry 1</td>
<td>Entry 2</td>
</tr>
<tr>
<td>Entry 3</td>
<td>Entry 4</td>
</tr>
</table>
</pre></blockquote>
<p>appears as</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<caption align=\"bottom\">Caption starts with a capital letter</caption>
<tr>
<th><strong>Head 1</strong></th>
<th><strong>Head 2</strong></th>
</tr>
<tr>
<td>Entry 1</td>
<td>Entry 2</td>
</tr>
<tr>
<td>Entry 3</td>
<td>Entry 4</td>
</tr>
</table>
<h5>Example 2</h5>
<p>In this case of table captions, the table name (Tab.) including the table enumeration (1,2,...)
has to be displayed bold using <code><strong></code> and <code></strong></code>. The table name
and enumeration should look like this: <strong>Tab. 1:</strong> Tables have to be enumerated manually.</p>
<blockquote><pre>
<table border="1" cellspacing="0" cellpadding="2">
<caption align="bottom"><strong>Tab 2:</strong> Caption starts with a capital letter</caption>
<tr>
<th>Head 1</th>
<th>Head 2</th>
</tr>
<tr>
<td>Entry 1</td>
<td>Entry 2</td>
</tr>
<tr>
<td>Entry 3</td>
<td>Entry 4</td>
</tr>
</table>
</pre></blockquote>
<p>appears as</p>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
<caption align=\"bottom\"><strong>Tab. 2:</strong> Caption starts with a capital letter</caption>
<tr>
<th>Head 1</th>
<th>Head 2</th>
</tr>
<tr>
<td>Entry 1</td>
<td>Entry 2</td>
</tr>
<tr>
<td>Entry 3</td>
<td>Entry 4</td>
</tr>
</table>
</html>"));
end Tables;
annotation (Documentation(info="<html>
<p>
In this section the format UsersGuide of the HTML documentation are specified.
The <a href=\"modelica://Modelica.UsersGuide.Conventions.Documentation.Structure\">structure</a> of the documentation is specified separately.
</p>
<h4>Paragraphs</h4>
<ol>
<li> In each section the paragraphs should start with <code><p></code>
and terminate with <code></p></code>.</li>
<li> Do not write plain text without putting it in a paragraph.</li>