-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ch4.html
3433 lines (3396 loc) · 470 KB
/
Ch4.html
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
<!DOCTYPE html><html>
<head>
<title>4 Classes, Predefined Types, and Declarations‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4</title>
<!--Generated on Tue Oct 10 11:49:58 2017 by LaTeXML (version 0.8.2) http://dlmf.nist.gov/LaTeXML/.-->
<!--Document created on October 10, 2017.-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="LaTeXML.css" type="text/css">
<link rel="stylesheet" href="ltx-report.css" type="text/css">
<link rel="stylesheet" href="ltx-listings.css" type="text/css">
<link rel="stylesheet" href="LaTeXML-navbar-left.css" type="text/css">
<script src="LatexML-maybeMathJax.js" type="text/javascript"></script>
<link rel="up" href="MSL.html" title="Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4">
<link rel="start" href="MSL.html" title="Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4">
<link rel="prev" href="Ch3.html" title="Chapter 3 Operators and Expressions ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4">
<link rel="chapter" href="Chx1.html" title="Preface ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4">
<link rel="chapter" href="Ch1.html" title="Chapter 1 Introduction ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4">
<link rel="chapter" href="Ch2.html" title="Chapter 2 Lexical Structure ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4">
<link rel="chapter" href="Ch3.html" title="Chapter 3 Operators and Expressions ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4">
</head>
<body>
<nav class="ltx_page_navbar"><a href="MSL.html" title="Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref" rel="start"><span class="ltx_text ltx_ref_title">Modelica® - A Unified Object-Oriented Language for Systems Modeling<span class="ltx_text"> </span>Language Specification<span class="ltx_text"> </span>Version 3.4</span></a>
<div class="ltx_TOC">
<ul class="ltx_toclist">
<li class="ltx_tocentry ltx_tocentry_document">
<a href="MSL.html" title="Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Modelica® - A Unified Object-Oriented Language for Systems Modeling<span class="ltx_text"> </span>Language Specification<span class="ltx_text"> </span>Version 3.4</span></a>
<ul class="ltx_toclist ltx_toclist_document">
<li class="ltx_tocentry ltx_tocentry_chapter"><a href="Chx1.html" title="Preface ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Preface</span></a></li>
<li class="ltx_tocentry ltx_tocentry_chapter"><a href="Ch1.html" title="Chapter 1 Introduction ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">1 </span>Introduction</span></a></li>
<li class="ltx_tocentry ltx_tocentry_chapter"><a href="Ch2.html" title="Chapter 2 Lexical Structure ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">2 </span>Lexical Structure</span></a></li>
<li class="ltx_tocentry ltx_tocentry_chapter"><a href="Ch3.html" title="Chapter 3 Operators and Expressions ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">3 </span>Operators and Expressions</span></a></li>
<li class="ltx_tocentry ltx_tocentry_chapter ltx_ref_self">
<span class="ltx_ref ltx_ref_self"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4 </span>Classes, Predefined Types, and Declarations</span></span>
<ul class="ltx_toclist ltx_toclist_chapter">
<li class="ltx_tocentry ltx_tocentry_section"><a href="#S1" title="4.1 Access Control – Public and Protected Elements ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.1 </span>Access Control – Public and Protected Elements</span></a></li>
<li class="ltx_tocentry ltx_tocentry_section"><a href="#S2" title="4.2 Double Declaration not Allowed ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.2 </span>Double Declaration not Allowed</span></a></li>
<li class="ltx_tocentry ltx_tocentry_section"><a href="#S3" title="4.3 Declaration Order and Usage before Declaration ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.3 </span>Declaration Order and Usage before Declaration</span></a></li>
<li class="ltx_tocentry ltx_tocentry_section">
<a href="#S4" title="4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.4 </span>Component Declarations</span></a>
<ul class="ltx_toclist ltx_toclist_section">
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S4.SS1" title="4.4.1 Syntax and Examples of Component Declarations ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.4.1 </span>Syntax and Examples of Component Declarations</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection">
<a href="#S4.SS2" title="4.4.2 Component Declaration Static Semantics ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.4.2 </span>Component Declaration Static Semantics</span></a>
<ul class="ltx_toclist ltx_toclist_subsection">
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S4.SS2.SSS1" title="Declaration Equations ‣ 4.4.2 Component Declaration Static Semantics ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Declaration Equations</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S4.SS2.SSS2" title="Prefix Rules ‣ 4.4.2 Component Declaration Static Semantics ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Prefix Rules</span></a></li>
</ul>
</li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S4.SS3" title="4.4.3 Acyclic Bindings of Constants and Parameters ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.4.3 </span>Acyclic Bindings of Constants and Parameters</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection">
<a href="#S4.SS4" title="4.4.4 Component Variability Prefixes discrete, parameter, constant ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.4.4 </span>Component Variability Prefixes discrete, parameter, constant</span></a>
<ul class="ltx_toclist ltx_toclist_subsection">
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S4.SS4.SSS1" title="Variability of Structured Entities ‣ 4.4.4 Component Variability Prefixes discrete, parameter, constant ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Variability of Structured Entities</span></a></li>
</ul>
</li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S4.SS5" title="4.4.5 Conditional Component Declaration ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.4.5 </span>Conditional Component Declaration</span></a></li>
</ul>
</li>
<li class="ltx_tocentry ltx_tocentry_section">
<a href="#S5" title="4.5 Class Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.5 </span>Class Declarations</span></a>
<ul class="ltx_toclist ltx_toclist_section">
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S5.SS1" title="4.5.1 Short Class Definitions ‣ 4.5 Class Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.5.1 </span>Short Class Definitions</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S5.SS2" title="4.5.2 Restriction on combining base-classes and other elements ‣ 4.5 Class Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.5.2 </span>Restriction on combining base-classes and other elements</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S5.SS3" title="4.5.3 Local Class Definitions – Nested Classes ‣ 4.5 Class Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.5.3 </span>Local Class Definitions – Nested Classes</span></a></li>
</ul>
</li>
<li class="ltx_tocentry ltx_tocentry_section"><a href="#S6" title="4.6 Specialized Classes ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.6 </span>Specialized Classes</span></a></li>
<li class="ltx_tocentry ltx_tocentry_section"><a href="#S7" title="4.7 Balanced Models ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.7 </span>Balanced Models</span></a></li>
<li class="ltx_tocentry ltx_tocentry_section">
<a href="#S8" title="4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8 </span>Predefined Types</span></a>
<ul class="ltx_toclist ltx_toclist_section">
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S8.SS1" title="4.8.1 Real Type ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8.1 </span>Real Type</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S8.SS2" title="4.8.2 Integer Type ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8.2 </span>Integer Type</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S8.SS3" title="4.8.3 Boolean Type ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8.3 </span>Boolean Type</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S8.SS4" title="4.8.4 String Type ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8.4 </span>String Type</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection">
<a href="#S8.SS5" title="4.8.5 Enumeration Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8.5 </span>Enumeration Types</span></a>
<ul class="ltx_toclist ltx_toclist_subsection">
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S8.SS5.SSS1" title="Attributes of Enumeration Types ‣ 4.8.5 Enumeration Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Attributes of Enumeration Types</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S8.SS5.SSS2" title="Type Conversion of Enumeration Values to String or Integer ‣ 4.8.5 Enumeration Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Type Conversion of Enumeration Values to String or Integer</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S8.SS5.SSS3" title="Unspecified enumeration ‣ 4.8.5 Enumeration Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Unspecified enumeration</span></a></li>
</ul>
</li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S8.SS6" title="4.8.6 Clock Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8.6 </span>Clock Types</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection"><a href="#S8.SS7" title="4.8.7 Attributes start, fixed, nominal, and unbounded ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8.7 </span>Attributes start, fixed, nominal, and unbounded</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsection">
<a href="#S8.SS8" title="4.8.8 Other Predefined Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">4.8.8 </span>Other Predefined Types</span></a>
<ul class="ltx_toclist ltx_toclist_subsection">
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S8.SS8.SSS1" title="StateSelect ‣ 4.8.8 Other Predefined Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">StateSelect</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S8.SS8.SSS2" title="ExternalObject ‣ 4.8.8 Other Predefined Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">ExternalObject</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S8.SS8.SSS3" title="AssertionLevel ‣ 4.8.8 Other Predefined Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">AssertionLevel</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S8.SS8.SSS4" title="Connections ‣ 4.8.8 Other Predefined Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Connections</span></a></li>
<li class="ltx_tocentry ltx_tocentry_subsubsection"><a href="#S8.SS8.SSS5" title="Graphical Annotation Types ‣ 4.8.8 Other Predefined Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_title">Graphical Annotation Types</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</nav>
<div class="ltx_page_main">
<header class="ltx_page_header">
<div>
<a href="MSL.html" title="Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref" rel="up"><span class="ltx_text ltx_ref_title">Modelica® - A Unified Object-Oriented Language for Systems Modeling<span class="ltx_text"> </span>Language Specification<span class="ltx_text"> </span>Version 3.4</span></a><a href="Ch3.html" title="Chapter 3 Operators and Expressions ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref" rel="prev"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">3 </span>Operators and Expressions</span></a>
</div></header>
<div class="ltx_page_content">
<section class="ltx_chapter ltx_authors_1line">
<h1 class="ltx_title ltx_title_chapter">
<span class="ltx_tag ltx_tag_chapter">Chapter 4 </span>Classes, Predefined Types, and Declarations</h1>
<div class="ltx_date ltx_role_creation"></div>
<div id="p1" class="ltx_para">
<p class="ltx_p"><a name="classes-predefined-types-and-declarations" id="classes-predefined-types-and-declarations" class="ltx_anchor"></a></p>
</div>
<div id="p2" class="ltx_para">
<p class="ltx_p">The fundamental structuring unit of modeling in Modelica is the class.
Classes provide the structure for objects, also known as instances.
Classes can contain equations which provide the basis for the executable
code that is used for computation in Modelica. Conventional algorithmic
code can also be part of classes. All data objects in Modelica are
instantiated from classes, including the basic data types—Real,
Integer, String, Boolean—and enumeration types, which are built-in
classes or class schemata.</p>
</div>
<div id="p3" class="ltx_para">
<p class="ltx_p">Declarations are the syntactic constructs needed to introduce classes
and objects (i.e., components).</p>
</div>
<section id="S1" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">4.1 </span>Access Control – Public and Protected Elements</h2>
<div id="S1.p1" class="ltx_para">
<p class="ltx_p"><a name="access-control" id="access-control" class="ltx_anchor"></a></p>
</div>
<div id="S1.p2" class="ltx_para">
<p class="ltx_p">Members of a Modelica class can have two levels of visibility: public or
protected. The default is public if nothing else is specified</p>
</div>
<div id="S1.p3" class="ltx_para">
<p class="ltx_p">A protected element, P, in classes and components may not be accessed
via dot notation (e.g., A.P, a.P, a[1].P, a.b.P, .A.P; but there is
no restriction on using P or P.x for a protected element P). They may
not be modified or redeclared except for modifiers applied to protected
elements in a base-class modification (not inside any component or
class) and the modifier on the declaration of the protected element.</p>
</div>
<div id="S1.p4" class="ltx_para">
<p class="ltx_p">[<em class="ltx_emph">Example</em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,cGFja2FnZSBBCiBtb2RlbCBCCiBwcm90ZWN0ZWQKIHBhcmFtZXRlciBSZWFsIHg7CiBlbmQgQjsK%0AcHJvdGVjdGVkCm1vZGVsIEMgZW5kIEM7CnB1YmxpYwptb2RlbCBECiBDIGM7IC8vIExlZ2FsIHVz%0AZSBvZiBwcm90ZWN0ZWQgY2xhc3MgQyBmcm9tIGVuY2xvc2luZyBzY29wZQogZXh0ZW5kcyBBLkIo%0AeD0yKTsgLy8gTGVnYWwgbW9kaWZpZXIgZm9yIHggaW4gZGVyaXZlZCBjbGFzcwogLy8gYWxzbyB4%0ALnN0YXJ0PTIgYW5kIHgoc3RhcnQ9MikgYXJlIGxlZ2FsLgogUmVhbCB5PXg7IC8vIExlZ2FsIHVz%0AZSBvZiB4IGluIGRlcml2ZWQgY2xhc3MKZW5kIEQ7Cm1vZGVsIEUKIEEuQiBhKHg9Mik7IC8vIEls%0AbGVnYWwgbW9kaWZpZXIsIGFsc28geC5zdGFydD0yIGFuZCB4KHN0YXJ0PTIpIGFyZSBpbGxlZ2Fs%0ACiBBLkMgYzsgLy8gSWxsZWdhbCB1c2Ugb2YgcHJvdGVjdGVkIGNsYXNzIEMKIG1vZGVsIEY9QS5D%0AOyAvLyBJbGxlZ2FsIHVzZSBvZiBwcm90ZWN0ZWQgY2xhc3MgQwplbmQgRTsKZW5kIEE7%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">package</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">B</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">protected</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">x</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">B</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">protected</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">C</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">C</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">public</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">D</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">C</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">c</span><span class="ltx_text" style="font-size:80%;">;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Legal<span class="ltx_text ltx_lst_space"> </span>use<span class="ltx_text ltx_lst_space"> </span>of<span class="ltx_text ltx_lst_space"> </span>protected<span class="ltx_text ltx_lst_space"> </span>class<span class="ltx_text ltx_lst_space"> </span>C<span class="ltx_text ltx_lst_space"> </span>from<span class="ltx_text ltx_lst_space"> </span>enclosing<span class="ltx_text ltx_lst_space"> </span>scope</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">extends</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A.B</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">x</span><span class="ltx_text" style="font-size:80%;">=2);</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Legal<span class="ltx_text ltx_lst_space"> </span>modifier<span class="ltx_text ltx_lst_space"> </span>for<span class="ltx_text ltx_lst_space"> </span>x<span class="ltx_text ltx_lst_space"> </span>in<span class="ltx_text ltx_lst_space"> </span>derived<span class="ltx_text ltx_lst_space"> </span>class</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>also<span class="ltx_text ltx_lst_space"> </span>x.start=2<span class="ltx_text ltx_lst_space"> </span>and<span class="ltx_text ltx_lst_space"> </span>x(start=2)<span class="ltx_text ltx_lst_space"> </span>are<span class="ltx_text ltx_lst_space"> </span>legal.</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">y</span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">x</span><span class="ltx_text" style="font-size:80%;">;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Legal<span class="ltx_text ltx_lst_space"> </span>use<span class="ltx_text ltx_lst_space"> </span>of<span class="ltx_text ltx_lst_space"> </span>x<span class="ltx_text ltx_lst_space"> </span>in<span class="ltx_text ltx_lst_space"> </span>derived<span class="ltx_text ltx_lst_space"> </span>class</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">D</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">E</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A.B</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">a</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">x</span><span class="ltx_text" style="font-size:80%;">=2);</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Illegal<span class="ltx_text ltx_lst_space"> </span>modifier,<span class="ltx_text ltx_lst_space"> </span>also<span class="ltx_text ltx_lst_space"> </span>x.start=2<span class="ltx_text ltx_lst_space"> </span>and<span class="ltx_text ltx_lst_space"> </span>x(start=2)<span class="ltx_text ltx_lst_space"> </span>are<span class="ltx_text ltx_lst_space"> </span>illegal</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A.C</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">c</span><span class="ltx_text" style="font-size:80%;">;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Illegal<span class="ltx_text ltx_lst_space"> </span>use<span class="ltx_text ltx_lst_space"> </span>of<span class="ltx_text ltx_lst_space"> </span>protected<span class="ltx_text ltx_lst_space"> </span>class<span class="ltx_text ltx_lst_space"> </span>C</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">F</span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A.C</span><span class="ltx_text" style="font-size:80%;">;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Illegal<span class="ltx_text ltx_lst_space"> </span>use<span class="ltx_text ltx_lst_space"> </span>of<span class="ltx_text ltx_lst_space"> </span>protected<span class="ltx_text ltx_lst_space"> </span>class<span class="ltx_text ltx_lst_space"> </span>C</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">E</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
</div>
<p class="ltx_p"><em class="ltx_emph"></em>]</p>
</div>
<div id="S1.p5" class="ltx_para">
<p class="ltx_p">All elements defined under the heading protected are regarded as
protected. All other elements [<em class="ltx_emph">i.e., defined under the heading <em class="ltx_emph">public</em>
public, without headings or in a separate file</em>] are public
[<em class="ltx_emph">i.e. not protected</em>]. Regarding inheritance of protected and
public elements, see Section 7.1.2.</p>
</div>
</section>
<section id="S2" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">4.2 </span>Double Declaration not Allowed</h2>
<div id="S2.p1" class="ltx_para">
<p class="ltx_p"><a name="double-declaration-not-allowed" id="double-declaration-not-allowed" class="ltx_anchor"></a></p>
</div>
<div id="S2.p2" class="ltx_para">
<p class="ltx_p">The name of a declared element shall not have the same name as any other
element in its partially flattened enclosing class. A component shall
not have the same name as its type specifier. However, the internal
flattening of a class can in some cases be interpreted as having two
elements with the same name; these cases are described in Section 5.5,
and Section 7.3.</p>
</div>
<div id="S2.p3" class="ltx_para">
<p class="ltx_p">[<em class="ltx_emph">Example</em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,cmVjb3JkIFIKIFJlYWwgeDsKZW5kIFI7Cm1vZGVsIE0gLy8gd3JvbmcgTW9kZWxpY2EgbW9kZWwK%0AIFIgUjsgLy8gbm90IGNvcnJlY3QsIHNpbmNlIGNvbXBvbmVudCBuYW1lIGFuZCB0eXBlIHNwZWNp%0AZmllciBhcmUgaWRlbnRpY2FsCmVxdWF0aW9uCiBSLnggPSAwOwplbmQgTTs=%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">record</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">R</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">x</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">R</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">M</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>wrong<span class="ltx_text ltx_lst_space"> </span>Modelica<span class="ltx_text ltx_lst_space"> </span>model</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">R</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">R</span><span class="ltx_text" style="font-size:80%;">;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>not<span class="ltx_text ltx_lst_space"> </span>correct,<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>component<span class="ltx_text ltx_lst_space"> </span>name<span class="ltx_text ltx_lst_space"> </span>and<span class="ltx_text ltx_lst_space"> </span>type<span class="ltx_text ltx_lst_space"> </span>specifier<span class="ltx_text ltx_lst_space"> </span>are<span class="ltx_text ltx_lst_space"> </span>identical</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">equation</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">R.x</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">0;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">M</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
</div>
<p class="ltx_p"><em class="ltx_emph"></em>]</p>
</div>
</section>
<section id="S3" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">4.3 </span>Declaration Order and Usage before Declaration</h2>
<div id="S3.p1" class="ltx_para">
<p class="ltx_p"><a name="declaration-order-and-usage-before-declaration" id="declaration-order-and-usage-before-declaration" class="ltx_anchor"></a>
</p>
</div>
<div id="S3.p2" class="ltx_para">
<p class="ltx_p">Variables and classes can be used before they are declared.</p>
</div>
<div id="S3.p3" class="ltx_para">
<p class="ltx_p">[<em class="ltx_emph">In fact, declaration order is only significant for:</em></p>
</div>
<div id="S3.p4" class="ltx_para">
<ul id="I1" class="ltx_itemize">
<li id="I1.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I1.i1.p1" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">Functions with more than one input variable called with
positional arguments, Section 12.4.1.</em></p>
</div>
</li>
<li id="I1.i2" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I1.i2.p1" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">Functions with more than one output variable, Section 12.4.3.</em></p>
</div>
</li>
<li id="I1.i3" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I1.i3.p1" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">Records that are used as arguments to external functions,
Section 12.9.1.3</em></p>
</div>
</li>
<li id="I1.i4" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I1.i4.p1" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">Enumeration literal order within enumeration types, Section <a href="#S8.SS5" title="4.8.5 Enumeration Types ‣ 4.8 Predefined Types ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.8.5</span></a>.</em></p>
</div>
</li>
</ul>
</div>
<div id="S3.p5" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph"></em>]</p>
</div>
</section>
<section id="S4" class="ltx_section">
<h2 class="ltx_title ltx_title_section">
<span class="ltx_tag ltx_tag_section">4.4 </span>Component Declarations</h2>
<div id="S4.p1" class="ltx_para">
<p class="ltx_p"><a name="component-declarations" id="component-declarations" class="ltx_anchor"></a></p>
</div>
<div id="S4.p2" class="ltx_para">
<p class="ltx_p">Component declarations are described in this section.</p>
</div>
<section id="S4.SS1" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">4.4.1 </span>Syntax and Examples of Component Declarations</h3>
<div id="S4.SS1.p1" class="ltx_para">
<p class="ltx_p"><a name="syntax-and-examples-of-component-declarations" id="syntax-and-examples-of-component-declarations" class="ltx_anchor"></a>
</p>
</div>
<div id="S4.SS1.p2" class="ltx_para">
<p class="ltx_p">The formal syntax of a component declaration clause is given by the
following syntactic rules:</p>
<div class="ltx_listing ltx_lst_language_grammar ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,Y29tcG9uZW50LWNsYXVzZToKICB0eXBlLXByZWZpeCB0eXBlLXNwZWNpZmllciBbIGFycmF5LXN1%0AYnNjcmlwdHMgXSBjb21wb25lbnQtbGlzdAoKdHlwZS1wcmVmaXggOgogWyBmbG93IHwgc3RyZWFt%0AIF0KIFsgZGlzY3JldGUgfCBwYXJhbWV0ZXIgfCBjb25zdGFudCBdCiBbIGlucHV0IHwgb3V0cHV0%0AIF0KCnR5cGUtc3BlY2lmaWVyIDoKICBuYW1lCgpjb21wb25lbnQtbGlzdCA6CiAgY29tcG9uZW50%0ALWRlY2xhcmF0aW9uIHsgIiwiIGNvbXBvbmVudC1kZWNsYXJhdGlvbiB9Cgpjb21wb25lbnQtZGVj%0AbGFyYXRpb24gOgogIGRlY2xhcmF0aW9uIFsgY29uZGl0aW9uLWF0dHJpYnV0ZSBdIGNvbW1lbnQK%0ACmNvbmRpdGlvbi1hdHRyaWJ1dGU6CiAgaWYgZXhwcmVzc2lvbgoKZGVjbGFyYXRpb24gOgogIElE%0ARU5UIFsgYXJyYXktc3Vic2NyaXB0cyBdIFsgbW9kaWZpY2F0aW9uIF0=%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_identifier" style="font-size:80%;">component</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">clause</span><span class="ltx_text" style="font-size:80%;">:</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">type</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">prefix</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">type</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">specifier</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">array</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">subscripts</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">]</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">component</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">list</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">type</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">prefix</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">:</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">flow</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">|</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">stream</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">]</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">discrete</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">|</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">|</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">constant</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">]</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">input</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">|</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">output</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">]</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">type</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">specifier</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">:</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">name</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_identifier" style="font-size:80%;">component</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">list</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">:</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">component</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">declaration</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">{</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_string" style="font-size:80%;color:#000000;">","</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">component</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">declaration</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">}</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_identifier" style="font-size:80%;">component</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">declaration</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">:</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">declaration</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">condition</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">attribute</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">]</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">comment</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_identifier" style="font-size:80%;">condition</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">attribute</span><span class="ltx_text" style="font-size:80%;">:</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">if</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">expression</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_identifier" style="font-size:80%;">declaration</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">:</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">IDENT</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">array</span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">subscripts</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">]</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">modification</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">]</span>
</div>
</div>
</div>
<div id="S4.SS1.p3" class="ltx_para">
<p class="ltx_p">[<em class="ltx_emph">The declaration of a component states the type, access,
variability, data flow, and other properties of the component. A
<em class="ltx_emph">component_clause</em> i.e., the whole declaration, contains
type prefixes followed by a <em class="ltx_emph">type_specifier</em> with optional
<em class="ltx_emph">array_subscripts</em> followed by a <em class="ltx_emph">component_list.</em></em></p>
</div>
<div id="S4.SS1.p4" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">There is no semantic difference between variables declared in a
single declaration or in multiple declarations. For example, regard the
following single declaration (<em class="ltx_emph">component_clause</em>) of two matrix
variables:</em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,UmVhbFsyLDJdIEEsIEI7%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text" style="font-size:80%;">[2,2]</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">B</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
</div>
</div>
<div id="S4.SS1.p5" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">That declaration has the same meaning as the following two
declarations together:</em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,UmVhbFsyLDJdIEE7ClJlYWxbMiwyXSBCOw==%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text" style="font-size:80%;">[2,2]</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text" style="font-size:80%;">[2,2]</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">B</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
</div>
</div>
<div id="S4.SS1.p6" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">The array dimension descriptors may instead be placed after the
variable name, giving the two declarations below, with the same meaning
as in the previous example:</em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,UmVhbCBBWzIsMl07ClJlYWwgQlsyLDJdOw==%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">[2,2];</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">B</span><span class="ltx_text" style="font-size:80%;">[2,2];</span>
</div>
</div>
<p class="ltx_p"><em class="ltx_emph">The following declaration is different, meaning that the variable
a is a scalar but B is a matrix as above:</em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,UmVhbCBhLCBCWzIsMl07%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">a</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">B</span><span class="ltx_text" style="font-size:80%;">[2,2];</span>
</div>
</div>
<p class="ltx_p"><em class="ltx_emph"></em>]</p>
</div>
</section>
<section id="S4.SS2" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">4.4.2 </span>Component Declaration Static Semantics</h3>
<div id="S4.SS2.p1" class="ltx_para">
<p class="ltx_p">If the type_specifier of the component declaration denotes a built-in
type (RealType, IntegerType, etc.), the flattened or instantiated
component has the same type.</p>
</div>
<div id="S4.SS2.p2" class="ltx_para">
<p class="ltx_p">If the type_specifier of the component does not denote a built-in type,
the name of the type is looked up (Section 5.3). The found type is
flattened with a new environment and the partially flattened enclosing
class of the component. It is an error if the type is partial in a
simulation model, or if a simulation model itself is partial. The new
environment is the result of merging
</p>
</div>
<div id="S4.SS2.p3" class="ltx_para">
<ul id="I2" class="ltx_itemize">
<li id="I2.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I2.i1.p1" class="ltx_para">
<p class="ltx_p">the modification of enclosing class element-modification with the same
name as the component</p>
</div>
</li>
</ul>
</div>
<div id="S4.SS2.p4" class="ltx_para">
<ul id="I3" class="ltx_itemize">
<li id="I3.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I3.i1.p1" class="ltx_para">
<p class="ltx_p">the modification of the component declaration</p>
</div>
</li>
</ul>
</div>
<div id="S4.SS2.p5" class="ltx_para">
<p class="ltx_p">in that order.</p>
</div>
<div id="S4.SS2.p6" class="ltx_para">
<p class="ltx_p">Array dimensions shall be non-negative parameter expressions, or the
colon operator denoting that the array dimension is left unspecified.</p>
</div>
<div id="S4.SS2.p7" class="ltx_para">
<p class="ltx_p">The rules for components in functions are described in Section 12.2.</p>
</div>
<div id="S4.SS2.p8" class="ltx_para">
<p class="ltx_p">Conditional declarations of components are described in Section <a href="#S4.SS5" title="4.4.5 Conditional Component Declaration ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.4.5</span></a>.</p>
</div>
<section id="S4.SS2.SSS1" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">Declaration Equations</h4>
<div id="S4.SS2.SSS1.p1" class="ltx_para">
<p class="ltx_p"><a name="declaration-equations" id="declaration-equations" class="ltx_anchor"></a></p>
</div>
<div id="S4.SS2.SSS1.p2" class="ltx_para">
<p class="ltx_p">An environment that defines the value of a component of built-in type is
said to define a declaration equation associated with the declared
component. For declarations of vectors and matrices, declaration
equations are associated with each element.</p>
</div>
</section>
<section id="S4.SS2.SSS2" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">Prefix Rules</h4>
<div id="S4.SS2.SSS2.p1" class="ltx_para">
<p class="ltx_p"><a name="prefix-rules" id="prefix-rules" class="ltx_anchor"></a></p>
</div>
<div id="S4.SS2.SSS2.p2" class="ltx_para">
<p class="ltx_p">Variables declared with the flow or the stream type prefix shall be a
subtype of Real.</p>
</div>
<div id="S4.SS2.SSS2.p3" class="ltx_para">
<p class="ltx_p">Type prefixes (that is , flow, stream, discrete, parameter, constant,
input, output) shall only be applied for type, record and connector
components – see also record specialized class, Section <a href="#S6" title="4.6 Specialized Classes ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.6</span></a>. In
addition components of classes extending from ExternalObject may in
addition have type prefixes parameter and constant, and in functions
also type prefixes input and output - see Section 12.9.7. An exception
is input for components whose type is of the special class function type
(these can only be used for function formal parameters and has special
semantics, see Section 12.4.2), and the input prefix is not applied to
the elements of the component and is allowed even if the elements have
input or output prefix.</p>
</div>
<div id="S4.SS2.SSS2.p4" class="ltx_para">
<p class="ltx_p">The type prefixes flow, stream, input and output of a structured
component are also applied to the elements of the component (this is
done after verifying that the type prefixes occurring on elements of the
component are correct; e.g. the flow prefix can be used on a record
component and all the record elements will generate zero-sum equations,
even if elements of a record may not be declared with the flow prefix).
The type prefixes flow, stream, input and output shall only be applied
for a structured component, if no element of the component has a
corresponding type prefix of the same category (the two categories are
input/output and flow/stream). [<em class="ltx_emph">For example,</em> input <em class="ltx_emph">can
only be used, if none of the elements has an</em> input <em class="ltx_emph">or</em> output
<em class="ltx_emph">type prefix</em>]. The corresponding rules for the type prefixes
discrete, parameter and constant are described in Section <a href="#S4.SS4.SSS1" title="Variability of Structured Entities ‣ 4.4.4 Component Variability Prefixes discrete, parameter, constant ‣ 4.4 Component Declarations ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.4.4</span></a> for
structured components.</p>
</div>
<div id="S4.SS2.SSS2.p5" class="ltx_para">
<p class="ltx_p">The prefixes input and output have a slightly different semantic meaning
depending on the context where they are used:</p>
</div>
<div id="S4.SS2.SSS2.p6" class="ltx_para">
<ul id="I4" class="ltx_itemize">
<li id="I4.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I4.i1.p1" class="ltx_para">
<p class="ltx_p">In <em class="ltx_emph">functions</em>, these prefixes define the computational causality
of the function body, i.e., given the variables declared as input, the
variables declared as output are computed in the function body, see
Section 12.4.</p>
</div>
</li>
</ul>
</div>
<div id="S4.SS2.SSS2.p7" class="ltx_para">
<ul id="I5" class="ltx_itemize">
<li id="I5.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I5.i1.p1" class="ltx_para">
<p class="ltx_p">In <em class="ltx_emph">simulation</em> <em class="ltx_emph">models</em> and <em class="ltx_emph">blocks</em> (i.e., on the top
level of a model or block that shall be simulated), these prefixes
define the interaction with the environment where the simulation model
or block is used. Especially, the input prefix defines that values for
such a variable have to be provided from the simulation environment
and the output prefix defines that the values of the corresponding
variable can be directly utilized in the simulation environment, see
the notion of Globally balanced in Section <a href="#S7" title="4.7 Balanced Models ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.7</span></a>.</p>
</div>
</li>
<li id="I5.i2" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I5.i2.p1" class="ltx_para">
<p class="ltx_p">In component <em class="ltx_emph">models</em> and <em class="ltx_emph">blocks</em>, the input prefix defines
that a binding equation has to be provided for the corresponding
variable when the component is utilized in order to guarantee a
locally balanced model (i.e., the number of local equations is
identical to the local number of unknowns), see Section <a href="#S7" title="4.7 Balanced Models ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.7</span></a>. Example:</p>
</div>
<div id="I5.i2.p2" class="ltx_para">
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,YmxvY2sgRmlyc3RPcmRlcgogaW5wdXQgUmVhbCB1OwogLi4uCmVuZCBGaXJzdE9yZGVyOwptb2Rl%0AbCBVc2VGaXJzdE9yZGVyCiBGaXJzdE9yZGVyIGZpcnN0T3JkZXIodT10aW1lKTsgLy8gYmluZGlu%0AZyBlcXVhdGlvbiBmb3IgdQogLi4uCmVuZCBVc2VGaXJzdE9yZGVyOw==%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">block</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">FirstOrder</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">input</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">u</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">…</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">FirstOrder</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">UseFirstOrder</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">FirstOrder</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">firstOrder</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">u</span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">time</span><span class="ltx_text" style="font-size:80%;">);</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>binding<span class="ltx_text ltx_lst_space"> </span>equation<span class="ltx_text ltx_lst_space"> </span>for<span class="ltx_text ltx_lst_space"> </span>u</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">…</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">UseFirstOrder</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
</div>
</div>
<div id="I5.i2.p3" class="ltx_para">
<p class="ltx_p">The output prefix does not have a particular effect in a model or block
component and is ignored.</p>
</div>
</li>
<li id="I5.i3" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I5.i3.p1" class="ltx_para">
<p class="ltx_p">In <em class="ltx_emph">connectors</em>, prefixes input and output define that the
corresponding connectors can only be connected according to block
diagram semantics, see Section 9.1 (e.g., a connector with an output
variable can only be connected to a connector where the corresponding
variable is declared as input). There is the restriction that
connectors which have at least one variable declared as input must be
externally connected, see Section <a href="#S7" title="4.7 Balanced Models ‣ Chapter 4 Classes, Predefined Types, and Declarations ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">4.7</span></a> (in order to get a locally
balanced model, where the number of local unknowns is identical to the
number of unknown equations). Together with the block diagram
semantics rule this means, that such connectors must be connected
<em class="ltx_emph">exactly once externall</em>y.</p>
</div>
</li>
<li id="I5.i4" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I5.i4.p1" class="ltx_para">
<p class="ltx_p">In <em class="ltx_emph">records</em>, prefixes input and output are not allowed, since
otherwise a record could not be, e.g., passed as input argument to a
function.</p>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="S4.SS3" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">4.4.3 </span>Acyclic Bindings of Constants and Parameters</h3>
<div id="S4.SS3.p1" class="ltx_para">
<p class="ltx_p">The binding equations for parameters and constants in the translated
model must be acyclic after flattening; except that cycles are allowed
if the cycles disappear when evaluating parameters having annotation
Evaluate=true that are not part of the cycle.Thus it is not possible to
introduce equations for parameters by cyclic dependencies.</p>
</div>
<div id="S4.SS3.p2" class="ltx_para">
<p class="ltx_p">[<em class="ltx_emph">Example</em>:</p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,Y29uc3RhbnQgUmVhbCBwPTIqcTsKY29uc3RhbnQgUmVhbCBxPXNpbihwKTsgLy8gSWxsZWdhbCBz%0AaW5jZSBwPTIqcSwgcT1zaW4ocCkgYXJlIGN5Y2xpY2FsCm1vZGVsIEFCQ0QKIHBhcmFtZXRlciBS%0AZWFsIEFbbixuXTsKIHBhcmFtZXRlciBJbnRlZ2VyIG49c2l6ZShBLDEpOwplbmQgQUJDRDsKCmZp%0AbmFsIEFCQ0QgYTsKLy8gSWxsZWdhbCBzaW5jZSBjeWNsaWMgZGVwZW5kZW5jaWVzIGJldHdlZW4g%0Ac2l6ZShhLkEsMSkgYW5kIGEubgoKQUJDRCBiKHJlZGVjbGFyZSBSZWFsIEFbMiwyXT1bMSwyOzMs%0ANF0pOwovLyBMZWdhbCBzaW5jZSBzaXplIG9mIEEgaXMgbm8gbG9uZ2VyIGRlcGVuZGVudCBvbiBu%0ALgoKQUJDRCBjKG49Mik7IC8vIExlZ2FsIHNpbmNlIG4gaXMgbm8gbG9uZ2VyIGRlcGVuZGVudCBv%0AbiB0aGUgc2l6ZSBvZiBBLgoKcGFyYW1ldGVyIFJlYWwgciA9IDIqc2luKHIpOyAvLyBJbGxlZ2Fs%0ALCBzaW5jZSByID0gMipzaW4ocikgaXMgY3ljbGljCgpwYXJ0aWFsIG1vZGVsIFBhcnRpYWxMdW1w%0AZWRWb2x1bWUKIHBhcmFtZXRlciBCb29sZWFuIHVzZV9UX3N0YXJ0ID0gdHJ1ZSAiPSB0cnVlLCB1%0Ac2UgVF9zdGFydCwgb3RoZXJ3aXNlIGhfc3RhcnQiCiBhbm5vdGF0aW9uKERpYWxvZyh0YWIgPSAi%0ASW5pdGlhbGl6YXRpb24iKSwgRXZhbHVhdGU9dHJ1ZSk7CiBwYXJhbWV0ZXIgTWVkaXVtLlRlbXBl%0AcmF0dXJlIFRfc3RhcnQ9aWYgdXNlX1Rfc3RhcnQgdGhlbiBzeXN0ZW0uVF9zdGFydCBlbHNlCiBN%0AZWRpdW0udGVtcGVyYXR1cmVfcGhYKHBfc3RhcnQsaF9zdGFydCxYX3N0YXJ0KQogYW5ub3RhdGlv%0AbihEaWFsb2codGFiID0gIkluaXRpYWxpemF0aW9uIiwgZW5hYmxlID0gdXNlX1Rfc3RhcnQpKTsK%0AcGFyYW1ldGVyIE1lZGl1bS5TcGVjaWZpY0VudGhhbHB5IGhfc3RhcnQ9aWYgdXNlX1Rfc3RhcnQg%0AdGhlbgogTWVkaXVtLnNwZWNpZmljRW50aGFscHlfcFRYKHBfc3RhcnQsIFRfc3RhcnQsIFhfc3Rh%0AcnQpIGVsc2UgTWVkaXVtLmhfZGVmYXVsdAogYW5ub3RhdGlvbihEaWFsb2codGFiID0gIkluaXRp%0AYWxpemF0aW9uIiwgZW5hYmxlID0gbm90IHVzZV9UX3N0YXJ0KSk7CmVuZCBQYXJ0aWFsTHVtcGVk%0AVm9sdW1lOwovLyBDeWNsZSBmb3IgVF9zdGFydCBhbmQgaF9zdGFydCwgYnV0IG9rIHNpbmNlIGRp%0Ac2FwcGVhcnMKLy8gd2hlbiBldmFsdWF0aW5nIHVzZV9UX3N0YXJ0CgovLyBJbGxlZ2FsIHNpbmNl%0AIHRoZSB1bmV4cGFuZGVkIGJpbmRpbmdzIGhhdmUgY3ljbGVzIGZvciBib3RoIHggYW5kIHkKLy8g%0AKGV2ZW4gaWYgdGhleSB3b3VsZCBkaXNhcHBlYXIgaWYgYmluZGluZ3Mgd2VyZSBleHBhbmRlZCku%0ACm1vZGVsIEhhc0N5Y2xlcwogcGFyYW1ldGVyIEludGVnZXIgbj0xMDsKIGZpbmFsIGNvbnN0YW50%0AIFJlYWwgQVszLDNdPVswLDAsMDsxLDAsMDsyLDMsMF07CiBwYXJhbWV0ZXIgUmVhbCB5WzNdPUEq%0AeStvbmVzKDMpOwogcGFyYW1ldGVyIFJlYWwgeFtuXT1jYXQoMSwgezMuNH0sIHhbMToobi0xKV0p%0AOwplbmQgSGFzQ3ljbGVzOw==%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">constant</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">p</span><span class="ltx_text" style="font-size:80%;">=2*</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">q</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">constant</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">q</span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">sin</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">p</span><span class="ltx_text" style="font-size:80%;">);</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Illegal<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>p=2*q,<span class="ltx_text ltx_lst_space"> </span>q=sin(p)<span class="ltx_text ltx_lst_space"> </span>are<span class="ltx_text ltx_lst_space"> </span>cyclical</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">ABCD</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">n</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">n</span><span class="ltx_text" style="font-size:80%;">];</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Integer</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">n</span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">size</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">,1);</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">ABCD</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">final</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">ABCD</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">a</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Illegal<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>cyclic<span class="ltx_text ltx_lst_space"> </span>dependencies<span class="ltx_text ltx_lst_space"> </span>between<span class="ltx_text ltx_lst_space"> </span>size(a.A,1)<span class="ltx_text ltx_lst_space"> </span>and<span class="ltx_text ltx_lst_space"> </span>a.n</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_identifier" style="font-size:80%;">ABCD</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">b</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">redeclare</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">[2,2]=[1,2;3,4]);</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Legal<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>size<span class="ltx_text ltx_lst_space"> </span>of<span class="ltx_text ltx_lst_space"> </span>A<span class="ltx_text ltx_lst_space"> </span>is<span class="ltx_text ltx_lst_space"> </span>no<span class="ltx_text ltx_lst_space"> </span>longer<span class="ltx_text ltx_lst_space"> </span>dependent<span class="ltx_text ltx_lst_space"> </span>on<span class="ltx_text ltx_lst_space"> </span>n.</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_identifier" style="font-size:80%;">ABCD</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">c</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">n</span><span class="ltx_text" style="font-size:80%;">=2);</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Legal<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>n<span class="ltx_text ltx_lst_space"> </span>is<span class="ltx_text ltx_lst_space"> </span>no<span class="ltx_text ltx_lst_space"> </span>longer<span class="ltx_text ltx_lst_space"> </span>dependent<span class="ltx_text ltx_lst_space"> </span>on<span class="ltx_text ltx_lst_space"> </span>the<span class="ltx_text ltx_lst_space"> </span>size<span class="ltx_text ltx_lst_space"> </span>of<span class="ltx_text ltx_lst_space"> </span>A.</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">r</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">2*</span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">sin</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">r</span><span class="ltx_text" style="font-size:80%;">);</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Illegal,<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>r<span class="ltx_text ltx_lst_space"> </span>=<span class="ltx_text ltx_lst_space"> </span>2*sin(r)<span class="ltx_text ltx_lst_space"> </span>is<span class="ltx_text ltx_lst_space"> </span>cyclic</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">partial</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">PartialLumpedVolume</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Boolean</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">use_T_start</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">true</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_string" style="font-size:80%;color:#000000;">"=<span class="ltx_text ltx_lst_space"> </span>true,<span class="ltx_text ltx_lst_space"> </span>use<span class="ltx_text ltx_lst_space"> </span>T_start,<span class="ltx_text ltx_lst_space"> </span>otherwise<span class="ltx_text ltx_lst_space"> </span>h_start"</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">annotation</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Dialog</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">tab</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_string" style="font-size:80%;color:#000000;">"Initialization"</span><span class="ltx_text" style="font-size:80%;">),</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Evaluate</span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">true</span><span class="ltx_text" style="font-size:80%;">);</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Medium.Temperature</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">T_start</span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">if</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">use_T_start</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">then</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">system.T_start</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">else</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Medium.temperature_phX</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">p_start</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">h_start</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">X_start</span><span class="ltx_text" style="font-size:80%;">)</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">annotation</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Dialog</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">tab</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_string" style="font-size:80%;color:#000000;">"Initialization"</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">enable</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">use_T_start</span><span class="ltx_text" style="font-size:80%;">));</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Medium.SpecificEnthalpy</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">h_start</span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">if</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">use_T_start</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">then</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Medium.specificEnthalpy_pTX</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">p_start</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">T_start</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">X_start</span><span class="ltx_text" style="font-size:80%;">)</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">else</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Medium.h_default</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">annotation</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Dialog</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">tab</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_string" style="font-size:80%;color:#000000;">"Initialization"</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">enable</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">not</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">use_T_start</span><span class="ltx_text" style="font-size:80%;">));</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">PartialLumpedVolume</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Cycle<span class="ltx_text ltx_lst_space"> </span>for<span class="ltx_text ltx_lst_space"> </span>T_start<span class="ltx_text ltx_lst_space"> </span>and<span class="ltx_text ltx_lst_space"> </span>h_start,<span class="ltx_text ltx_lst_space"> </span>but<span class="ltx_text ltx_lst_space"> </span>ok<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>disappears</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>when<span class="ltx_text ltx_lst_space"> </span>evaluating<span class="ltx_text ltx_lst_space"> </span>use_T_start</span>
</div>
<div class="ltx_listingline">
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>Illegal<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>the<span class="ltx_text ltx_lst_space"> </span>unexpanded<span class="ltx_text ltx_lst_space"> </span>bindings<span class="ltx_text ltx_lst_space"> </span>have<span class="ltx_text ltx_lst_space"> </span>cycles<span class="ltx_text ltx_lst_space"> </span>for<span class="ltx_text ltx_lst_space"> </span>both<span class="ltx_text ltx_lst_space"> </span>x<span class="ltx_text ltx_lst_space"> </span>and<span class="ltx_text ltx_lst_space"> </span>y</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>(even<span class="ltx_text ltx_lst_space"> </span>if<span class="ltx_text ltx_lst_space"> </span>they<span class="ltx_text ltx_lst_space"> </span>would<span class="ltx_text ltx_lst_space"> </span>disappear<span class="ltx_text ltx_lst_space"> </span>if<span class="ltx_text ltx_lst_space"> </span>bindings<span class="ltx_text ltx_lst_space"> </span>were<span class="ltx_text ltx_lst_space"> </span>expanded).</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">HasCycles</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Integer</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">n</span><span class="ltx_text" style="font-size:80%;">=10;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">final</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">constant</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">[3,3]=[0,0,0;1,0,0;2,3,0];</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">y</span><span class="ltx_text" style="font-size:80%;">[3]=</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span><span class="ltx_text" style="font-size:80%;">*</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">y</span><span class="ltx_text" style="font-size:80%;">+</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">ones</span><span class="ltx_text" style="font-size:80%;">(3);</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">x</span><span class="ltx_text" style="font-size:80%;">[</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">n</span><span class="ltx_text" style="font-size:80%;">]=</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">cat</span><span class="ltx_text" style="font-size:80%;">(1,</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">{3</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">.4</span><span class="ltx_text" style="font-size:80%;">},</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">x</span><span class="ltx_text" style="font-size:80%;">[1:(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">n</span><span class="ltx_text" style="font-size:80%;">-1)]);</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">HasCycles</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
</div>
<p class="ltx_p"><em class="ltx_emph"></em>]</p>
</div>
</section>
<section id="S4.SS4" class="ltx_subsection">
<h3 class="ltx_title ltx_title_subsection">
<span class="ltx_tag ltx_tag_subsection">4.4.4 </span>Component Variability Prefixes discrete, parameter, constant</h3>
<div id="S4.SS4.p1" class="ltx_para">
<p class="ltx_p"><a name="component-variability-prefixes" id="component-variability-prefixes" class="ltx_anchor"></a></p>
</div>
<div id="S4.SS4.p2" class="ltx_para">
<p class="ltx_p">The prefixes discrete, parameter, constant of a component declaration
are called variability prefixes and define in which situation the
variable values of a component are initialized (see Section 8.5 and
Section 8.6) and when they are changed in transient analysis (=
solution of initial value problem of the hybrid DAE):</p>
</div>
<div id="S4.SS4.p3" class="ltx_para">
<ul id="I6" class="ltx_itemize">
<li id="I6.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I6.i1.p1" class="ltx_para">
<p class="ltx_p">A variable vc declared with the parameter or constant prefixes remains
constant during transient analysis.</p>
</div>
</li>
<li id="I6.i2" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I6.i2.p1" class="ltx_para">
<p class="ltx_p">A <em class="ltx_emph">discrete-time</em> variable vd has a vanishing time derivative
(informally der(vd)=0, but it is not legal to apply the der() operator
to discrete-time variables) and can change its values only at event
instants during transient analysis (see Section 8.5).</p>
</div>
</li>
<li id="I6.i3" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span>
<div id="I6.i3.p1" class="ltx_para">
<p class="ltx_p">A <em class="ltx_emph">continuous-time</em> variable vn may have a non-vanishing time
derivative (der(vn)<>0 possible) and may also
change its value discontinuously at any time during transient analysis
(see Section 8.5). If there are any discontinuities the variable is
not differentiable.</p>
</div>
</li>
</ul>
</div>
<div id="S4.SS4.p4" class="ltx_para">
<p class="ltx_p">If a Real variable is declared with the prefix discrete it must in a
simulation model be assigned in a when-clause, either by an assignment
or an equation. The variable assigned in a when-clause may not be
defined in a sub-component of model or block specialized class.
[<em class="ltx_emph">This is to keep the property of balanced models</em>]
</p>
</div>
<div id="S4.SS4.p5" class="ltx_para">
<p class="ltx_p">A Real variable assigned in a when-clause is a discrete-time variable,
even though it was not declared with the prefix discrete. A Real
variable not assigned in any when-clause and without any type prefix is
a continuous-time variable.</p>
</div>
<div id="S4.SS4.p6" class="ltx_para">
<p class="ltx_p">The default variability for Integer, String, Boolean, or enumeration
variables is discrete-time, and it is not possible to declare
continuous-time Integer, String, Boolean, or enumeration variables.
[<em class="ltx_emph">A Modelica translator is able to guarantee this property due to
restrictions imposed on discrete expressions, see Section <a href="Ch3.html#S8" title="3.8 Variability of Expressions ‣ Chapter 3 Operators and Expressions ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">3.8</span></a></em>]</p>
</div>
<div id="S4.SS4.p7" class="ltx_para">
<p class="ltx_p">The variability of expressions and restrictions on variability for
definition equations is given in Section <a href="Ch3.html#S8" title="3.8 Variability of Expressions ‣ Chapter 3 Operators and Expressions ‣ Modelica® - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4" class="ltx_ref"><span class="ltx_text ltx_ref_tag">3.8</span></a>.</p>
</div>
<div id="S4.SS4.p8" class="ltx_para">
<p class="ltx_p">[<em class="ltx_emph">A discrete-time variable is a piecewise constant signal which
changes its values only at event instants during simulation. Such types
of variables are needed in order that special algorithms, such as the
algorithm of Pantelides for index reduction, can be applied (it must be
known that the time derivative of these variables is identical to zero).
Furthermore, memory requirements can be reduced in the simulation
environment, if it is known that a component can only change at event
instants. </em></p>
</div>
<div id="S4.SS4.p9" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">A parameter variable is constant during simulation. This prefix
gives the library designer the possibility to express that the physical
equations in a library are only valid if some of the used components are
constant during simulation. The same also holds for discrete-time and
constant variables. Additionally, the parameter prefix allows a
convenient graphical user interface in an experiment environment, to
support quick changes of the most important constants of a compiled
model. In combination with an if-clause, a parameter prefix allows to
remove parts of a model before the symbolic processing of a model takes
place in order to avoid variable causalities in the model (similar to
#ifdef in C). Class parameters can be sometimes used as an alternative.
Example: </em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,bW9kZWwgSW5lcnRpYQogcGFyYW1ldGVyIEJvb2xlYW4gc3RhdGUgPSB0cnVlOwogLi4uCmVxdWF0%0AaW9uCiBKKmEgPSB0MSAtIHQyOwogaWYgc3RhdGUgdGhlbiAvLyBjb2RlIHdoaWNoIGlzIHJlbW92%0AZWQgZHVyaW5nIHN5bWJvbGljCiBkZXIodikgPSBhOyAvLyBwcm9jZXNzaW5nLCBpZiBzdGF0ZT1m%0AYWxzZQogZGVyKHIpID0gdjsKIGVuZCBpZjsKZW5kIEluZXJ0aWE7%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">model</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Inertia</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">parameter</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Boolean</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">state</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">true</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">…</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">equation</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">J*</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">a</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">t1</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">-</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">t2</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">if</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">state</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">then</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>code<span class="ltx_text ltx_lst_space"> </span>which<span class="ltx_text ltx_lst_space"> </span>is<span class="ltx_text ltx_lst_space"> </span>removed<span class="ltx_text ltx_lst_space"> </span>during<span class="ltx_text ltx_lst_space"> </span>symbolic</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">der</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">v</span><span class="ltx_text" style="font-size:80%;">)</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">a</span><span class="ltx_text" style="font-size:80%;">;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>processing,<span class="ltx_text ltx_lst_space"> </span>if<span class="ltx_text ltx_lst_space"> </span>state=false</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">der</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">r</span><span class="ltx_text" style="font-size:80%;">)</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">v</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">if</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">end</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">Inertia</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
</div>
</div>
<div id="S4.SS4.p10" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">A constant variable is similar to a parameter with the difference
that constants cannot be changed after translation and usually not
changed after they have been given a value. It can be used to represent
mathematical constants, e.g. </em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,ZmluYWwgY29uc3RhbnQgUmVhbCBQST00KmF0YW4oMSk7%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">final</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">constant</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">PI</span><span class="ltx_text" style="font-size:80%;">=4*</span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">atan</span><span class="ltx_text" style="font-size:80%;">(1);</span>
</div>
</div>
<p class="ltx_p"><em class="ltx_emph">There are no continuous-time <em class="ltx_emph">Boolean</em>, <em class="ltx_emph">Integer</em> or <em class="ltx_emph">String</em>
variables. In the rare cases they are needed they can be
faked by using <em class="ltx_emph">Real</em> variables, e.g.:</em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,IEJvb2xlYW4gb2ZmMSwgb2ZmMWE7CiBSZWFsIG9mZjI7CmVxdWF0aW9uCiBvZmYxID0gczEgPCAw%0AOwogb2ZmMWEgPSBub0V2ZW50KHMxIDwgMCk7IC8vIGVycm9yLCBzaW5jZSBvZmYxYSBpcyBkaXNj%0AcmV0ZQogb2ZmMiA9IGlmIG5vRXZlbnQoczIgPCAwKSB0aGVuIDEgZWxzZSAwOyAvLyBwb3NzaWJs%0AZQogdTEgPSBpZiBvZmYxIHRoZW4gczEgZWxzZSAwOyAvLyBzdGF0ZSBldmVudHMKIHUyID0gaWYg%0Abm9FdmVudChvZmYyID4gMC41KSB0aGVuIHMyIGVsc2UgMDsgLy8gbm8gc3RhdGUgZXZlbnRz%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Boolean</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">off1</span><span class="ltx_text" style="font-size:80%;">,</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">off1a</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">off2</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">equation</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">off1</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">s1</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;"><</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">0;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">off1a</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">noEvent</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">s1</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;"><</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">0);</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>error,<span class="ltx_text ltx_lst_space"> </span>since<span class="ltx_text ltx_lst_space"> </span>off1a<span class="ltx_text ltx_lst_space"> </span>is<span class="ltx_text ltx_lst_space"> </span>discrete</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">off2</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">if</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">noEvent</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">s2</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;"><</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">0)</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">then</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">1</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">else</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">0;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>possible</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">u1</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">if</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">off1</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">then</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">s1</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">else</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">0;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>state<span class="ltx_text ltx_lst_space"> </span>events</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">u2</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">=</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">if</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">noEvent</span><span class="ltx_text" style="font-size:80%;">(</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">off2</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">></span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">0</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">.5</span><span class="ltx_text" style="font-size:80%;">)</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">then</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">s2</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">else</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text" style="font-size:80%;">0;</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_comment" style="font-size:80%;color:#006600;">//<span class="ltx_text ltx_lst_space"> </span>no<span class="ltx_text ltx_lst_space"> </span>state<span class="ltx_text ltx_lst_space"> </span>events</span>
</div>
</div>
</div>
<div id="S4.SS4.p11" class="ltx_para">
<p class="ltx_p"><em class="ltx_emph">Since <em class="ltx_emph">off1</em> is a discrete-time variable, state events are
generated such that <em class="ltx_emph">off1</em> is only changed at event instants.
Variable <em class="ltx_emph">off2</em> may change its value during continuous integration.
Therefore, <em class="ltx_emph">u1</em> is guaranteed to be continuous during continuous
integration whereas no such guarantee exists for <em class="ltx_emph">u2</em>.</em>]
</p>
</div>
<section id="S4.SS4.SSS1" class="ltx_subsubsection">
<h4 class="ltx_title ltx_title_subsubsection">Variability of Structured Entities</h4>
<div id="S4.SS4.SSS1.p1" class="ltx_para">
<p class="ltx_p"><a name="variability-of-structured-entities" id="variability-of-structured-entities" class="ltx_anchor"></a></p>
</div>
<div id="S4.SS4.SSS1.p2" class="ltx_para">
<p class="ltx_p">For elements of structured entities with variability prefixes the most
restrictive of the variability prefix and the variability of the
component wins (using the default variability for the component if there
is no variability prefix on the component).</p>
</div>
<div id="S4.SS4.SSS1.p3" class="ltx_para">
<p class="ltx_p">[<em class="ltx_emph">Example:</em></p>
<div class="ltx_listing ltx_lst_language_modelica ltx_lstlisting ltx_listing" style="background-color:#FFFFFF;">
<div class="ltx_listing_data"><a href="data:text/plain;base64,cmVjb3JkIEEKIGNvbnN0YW50IFJlYWwgcGk9My4xNDsKIFJlYWwgeTsKIEludGVnZXIgaTsKZW5k%0AIEE7CnBhcmFtZXRlciBBIGE7CiAgLy8gYS5waSBpcyBhIGNvbnN0YW50CiAgLy8gYS55IGFuZCBh%0ALmkgYXJlIHBhcmFtZXRlcnMKICBBIGI7CiAgLy8gYi5waSBpcyBhIGNvbnN0YW50CiAvLyBiLnkg%0AaXMgYSBjb250aW51b3VzLXRpbWUgdmFyaWFibGUKIC8vIGIuaSBpcyBhIGRpc2NyZXRlLXRpbWUg%0AdmFyaWFibGU=%0A">⬇</a></div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">record</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">A</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords2 ltx_font_bold" style="font-size:80%;color:#000066;">constant</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">pi</span><span class="ltx_text" style="font-size:80%;">=3</span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">.14</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Real</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">y</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>
<div class="ltx_listingline">
<span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_keywords3" style="font-size:80%;color:#E60000;">Integer</span><span class="ltx_text ltx_lst_space" style="font-size:80%;"> </span><span class="ltx_text ltx_lst_identifier" style="font-size:80%;">i</span><span class="ltx_text" style="font-size:80%;">;</span>
</div>