root/trunk/ModelicaReference/package.mo

Revision 1158, 175.8 kB (checked in by dietmarw, 5 weeks ago)

fixes #100 by changing the annotation to a vendor specific annotation

  • DocumentationClass is changed to vendor specific annotation __Dymola_DocumentationClass

From: Dietmar Winkler <Dietmar.Winkler@…>

  • Property svn:keywords set to Author Date Id Revision
Line 
1within ;
2package ModelicaReference "Modelica Reference"
3annotation (__Dymola_DocumentationClass=true,
4    versionBuild="$Rev$",
5    versionDate="$Date::                            $",
6    Documentation(info="<html>
7<p>
8This package is a reference to Modelica keywords and Modelica builtin
9operators and is based on the
10<a href=\"http://www.modelica.org/documents/ModelicaSpec30.pdf\">Modelica Language Specification version 3.0</a> from Sept. 2007.
11
12
13<dl>
14<dt><b>Main Author:</b></dt>
15<dd><a href=\"http://www.robotic.dlr.de/Christian.Schweiger/\">Christian.Schweiger</a><br>
16    Deutsches Zentrum f&uuml;r Luft und Raumfahrt e.V. (DLR)<br>
17    Institut f&uuml;r Robotik und Mechatronik<br>
18    Postfach 11 16<br>
19    D-82230 Wessling<br>
20    Germany<br>
21    email: <A HREF=\"mailto:Christian.Schweiger@dlr.de\">Christian.Schweiger@dlr.de</A><br></dd>
22</dl>
23
24<p>
25<b>Copyright &copy; 2003-2004, 2008 Modelica Association and DLR.</b>
26</p>
27<p>
28<i>The <b>ModelicaReference</b> package is <b>free</b> software;
29it can be redistributed and/or modified
30under the terms of the <b>Modelica license</b>, see the license conditions
31and the accompanying <b>disclaimer</b>
32<a href=\"Modelica://Modelica.UsersGuide.ModelicaLicense\">here</a>.</i>
33</p><br>
34</html>", revisions="<html>
35
36<ul>
37<li><i>Jan. 2, 2008</i>
38    by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br>
39    Adapted to Modelica language version 3.0</li>
40
41<li><i>Sept. 30, 2004</i>
42    by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br>
43    Moved the content of \"Functions\" into \"Operators\" and updated
44    \"Operators\" according to Modelica 2.1</li>
45
46<li><i>July 10, 2003</i>
47     by <a href=\"http://www.robotic.dlr.de/Christian.Schweiger/\">Christian Schweiger</a>:<br>
48     Implemented.</li>
49</ul>
50</html>"));
51
52
53package Annotations "Annotations"
54  class choices "choices"
55
56    annotation (Documentation(info="<html>
57<p>
58Define graphical layout of choices in a parameter menu
59</p>
60
61<h4><font color=\"#008000\">Examples</font></h4>
62
63<pre><b>replaceable model</b> MyResistor=Resistor
64  <b>annotation</b>(choices(
65              choice(redeclare MyResistor=lib2.Resistor(a={2}) \"...\"),
66              choice(redeclare MyResistor=lib2.Resistor2 \"...\")));
67
68<b>replaceable</b> Resistor Load(R=2) constrainedby TwoPin
69  <b>annotation</b>(choices(
70              choice(redeclare lib2.Resistor Load(a={2}) \"...\"),
71              choice(redeclare Capacitor Load(L=3) \"...\")));
72
73<b>replaceable</b> FrictionFunction a(func=exp) constrainedby Friction
74  <b>annotation</b>(choices(
75             choice(redeclare ConstantFriction a(c=1) \"...\"),
76             choice(redeclare TableFriction a(table=\"...\") \"...\"),
77             choice(redeclare FunctionFriction a(func=exp) \"...\"))));
78
79<b>type</b> KindOfController=Integer(min=1,max=3)
80   <b>annotation</b>(choices(
81                choice=1 \"P\",
82                choice=2 \"PI\",
83                choice=3 \"PID\"));
84
85<b>model</b> A
86  KindOfController x;
87<b>end</b> A;
88A a(x=3 \"PID\");
89</pre>
90
91
92
93<h4><font color=\"#008000\">Description</font></h4>
94
95<p>
96A declaration can have an annotation \"choices\" containing modifiers on choice, where each of them indicates a suitable redeclaration or modifications of the element.
97This is a hint for users of the model, and can also be used by the user interface to suggest reasonable redeclaration, where the string comments on the choice declaration can be used as textual explanations of the choices.  The annotation is not restricted to replaceable elements but can also be applied to non-replaceable elements, enumeration types, and simple variables.
98</p>
99
100</html>"));
101  end choices;
102
103  class defaultComponentName "defaultComponentName"
104
105    annotation (Documentation(info="<html>
106<p>
107Default name when dragging component
108</p>
109
110<h4><font color=\"#008000\">Syntax</font></h4>
111
112<pre>   <b>annotation</b>\"(\" defaultComponentName \"=\" STRING \")\"
113</pre>
114
115
116<h4><font color=\"#008000\">Description</font></h4>
117
118<p>
119When creating a component of the given class, the recommended component name is the
120giving string.
121</p>
122
123</html>"));
124  end defaultComponentName;
125
126  class defaultComponentPrefixes "defaultComponentPrefixes"
127
128    annotation (Documentation(info="<html>
129<p>
130Default prefixes when dragging component
131</p>
132
133<h4><font color=\"#008000\">Examples</font></h4>
134
135<pre><b>annotation</b>(defaultComponentPrefixes=\"inner\",
136           defaultComponentName=\"world\")
137</pre>
138
139<h4><font color=\"#008000\">Syntax</font></h4>
140
141<pre>   <b>annotation</b>\"(\" defaultComponentPrefixes \"=\" STRING \")\"
142</pre>
143
144
145<h4><font color=\"#008000\">Description</font></h4>
146
147<p>
148The following prefixes may be included in the string prefixes: inner, outer, replaceable, constant, parameter, discrete. In combination with defaultComponentName it can be used to make it easy for users to create inner components matching the outer declarations.
149</p>
150
151</html>"));
152  end defaultComponentPrefixes;
153
154  class derivative "derivative"
155
156    annotation (Documentation(info="<html>
157<p>
158Define derivative of function
159</p>
160
161<h4><font color=\"#008000\">Examples</font></h4>
162
163<pre><b>function</b> foo0 <b>annotation</b>(derivative=foo1); <b>end</b> foo0;
164<b>function</b> foo1 <b>annotation</b>(derivative(order=2)=foo2); <b>end</b> foo1;
165<b>function</b> foo2 <b>end</b> foo2;
166</pre>
167
168
169
170<h4><font color=\"#008000\">Description</font></h4>
171
172<p>
173Derivatives of functions can be declared explicitly using the derivative annotation, whereas a function can be defined as a partial derivative of another function using the der-operator in a short function definition.
174</p>
175
176<p>
177A function declaration can have an annotation derivative specifying the derivative function. This can influence simulation time and accuracy and can be applied to both functions written in Modelica and to external functions. A derivative annotation can state that it is only valid under certain restrictions on the input arguments. These restrictions are defined using the following optional attributes: order (only a restriction if order &gt; 1, the default for order is 1), noDerivative, and zeroDerivative. The given derivative-function can only be used to compute the derivative of a function call if these restrictions are satisfied. There may be multiple restrictions on the derivative, in which case they must all be satisfied. The restrictions also imply that some derivatives of some inputs are excluded from the call of the derivative (since they are not necessary). A function may supply multiple derivative functions subject to different restrictions.
178</p>
179
180<p>
181The inputs to the derivative function of order 1 are constructed as follows:
182</p>
183
184<ul>
185<li> First are all inputs to the original function, and after all them we will
186     in order append one derivative for each input containing reals.<br>&nbsp;</li>
187<li> The outputs are constructed by starting with an empty list and then in
188     order appending one derivative for each output containing reals.<br>&nbsp;</li>
189<li> If the Modelica function call is a nth derivative (n>=1), i.e., this
190     function call has been derived from an (n-1)th derivative, an
191     annotation(order=n+1)=?,  specifies the (n+1)th derivative, and the
192     (n+1)th derivative call is constructed as follows:<br>&nbsp;</li>
193<li> The input arguments are appended with the (n+1)th derivative,
194     which are constructed in order from the nth order derivatives.<br>&nbsp;</li>
195<li> The output arguments are similar to the output argument for the
196     nth derivative, but each output is one higher in derivative order.</li>
197</ul>
198
199<p>
200Example: Given the declarations
201</p>
202
203<pre> function foo0
204   ...
205   input Real x;
206   input Boolean linear;
207   input ...;
208   output Real y;
209   ...
210   annotation(derivative=foo1);
211 end foo0;
212
213 function foo1
214   ...
215   input Real x;
216   input Boolean linear;
217   input ...;
218   input Real der_x;
219   ...
220   output Real der_y;
221   ...
222   annotation(derivative(order=2)=foo2);
223 end foo1;
224
225 function foo2
226   ...
227   input Real x;
228   input Boolean linear;
229   input ...;
230   input Real der_x;
231   ...;
232   input Real der_2_x;
233   ...
234   output Real der_2_y;
235   ...
236</pre>
237
238<p>
239the equation
240</p>
241
242<pre>(...,y(t),...)=foo0(...,x(t),b,...);
243</pre>
244
245<p>
246implies that:
247<p>
248
249<pre>(...,d y(t)/dt,...)=foo1(...,x(t),b,..., ...,d x(t)/dt,...);
250(...,d^2 y(t)/dt^2,...)=foo2(...,x(t),b,...,d x(t)/dt,..., ...,d^2 x(t)/dt^2,...);
251</pre>
252
253<p>
254An input or output to the function may be any simple type (Real, Boolean, Integer, String and enumeration types) or a record, provided the record does not contain both reals and non-reals predefined types. The function must have at least one input containing reals. The output list of the derivative function may not be empty.
255</p>
256
257<ul>
258<li> zeroDerivative=input_var1<br>
259    The derivative function is only valid if input_var1 is independent
260    of the variables the function call is  differentiated with respect to
261    (i.e., that the derivative of input_var1 is \"zero\").
262    The derivative of input_var1 is excluded from the argument list of the derivative-function.
263    Assume that function f takes a matrix and a scalar. Since the matrix argument is
264    usually a parameter expression it is then useful to define the function
265    as follows (the additional derivative = f_general_der is optional and
266    can be used when the derivative of the matrix is non-zero).
267<pre>function f \"Simple table lookup\"
268  input Real x;
269  input Real y[:, 2];
270  output Real z;
271  annotation(derivative(zeroDerivative=y) = f_der,
272             derivative=f_general_der);
273algorithm
274  ...
275end f;
276
277function f_der \"Derivative of simple table lookup\"
278  input Real x;
279  input Real y[:, 2];
280  input Real x_der;
281  output Real z_der;
282algorithm
283  ...
284end f_der;
285
286function f_general_der \"Derivative of table lookup taking into account varying tables\"
287  input Real x;
288  input Real y[:, 2];
289  input Real x_der;
290  input Real y_der[:, 2];
291  output Real z_der;
292algorithm
293  ...
294end f_general_der;
295
296</pre></li>
297
298<li> noDerivative(input_var2 = f(input_var1, ...) )<br>
299    The derivative function is only valid if the input argument input_var2
300    is computed as f(input_var1, ...). The derivative of input_var2
301    is excluded from the argument list of the derivative-function.
302    Assume that function fg is defined as a composition f(x, g(x)).
303    When differentiating f it is useful to give the derivative under the
304    assumption that the second argument is defined in this way:
305<pre>function fg
306  input Real x;
307  output Real z;
308algorithm
309   z := f(x, g(x));
310end fg;
311
312function f
313  input Real x;
314  input Real y;
315  output Real z;
316  annotation(derivative(noDerivative(y = g(x))) = f_der);
317algorithm
318  ...
319end f;
320
321function f_der
322  input Real x;
323  input Real x_der;
324  input Real y;
325  output Real z_der;
326algorithm
327  ...
328end f_der;
329</pre>
330This is useful if g represents the major computational effort of fg).</li>
331</ul>
332
333</html>"));
334  end derivative;
335
336  class Dialog "Dialog"
337
338    annotation (Documentation(info="<html>
339<p>
340Define graphical layout of parameter menu
341</p>
342
343<h4><font color=\"#008000\">Examples</font></h4>
344
345<pre><b>model</b> BodyShape
346  ...
347  <b>parameter</b> Boolean animation = true;
348  <b>parameter</b> Modelica.SIunits.Length length \"Length of shape\"
349     <b>annotation</b>(Dialog(enable = animation, tab = \"Animation\",
350                        group = \"Shape definition\"));
351  ...
352<b>end</b> BodyShape;
353</pre>
354
355<h4><font color=\"#008000\">Syntax</font></h4>
356
357<pre>   <b>annotation</b>(Dialog(enable = parameter-expression, tab = \"tab\", group = \"group\"))
358</pre>
359
360
361<h4><font color=\"#008000\">Description</font></h4>
362
363<p>
364Defines the placement of the component or class parameter in a parameter dialog with optional tab and group specification. If enable is false, the input field may be disabled [and no input can be given]. \"Dialog\" is defined as:
365</p>
366
367<pre>   <b>record</b> Dialog
368     <b>parameter</b> String  tab    = \"General\";
369     <b>parameter</b> String  group  = \"Parameters\";
370     <b>parameter</b> Boolean enable = <b>true</b>;
371   <b>end Dialog;
372</pre>
373
374<p>
375A parameter dialog is a sequence of tabs with a sequence of groups inside them.
376</p>
377
378</html>"));
379  end Dialog;
380
381  class Documentation "Documentation"
382
383    annotation (Documentation(info="<html>
384<p>
385Annotations for documentation
386</p>
387
388<h4><font color=\"#008000\">Syntax</font></h4>
389
390<pre>documentation_annotation:
391   <b>annotation</b>\"(\" Documentation \"(\" \"info\" \"=\" STRING
392                            [\",\" \"revisions\" \"=\" STRING ] \")\" \")\"
393</pre>
394
395<h4><font color=\"#008000\">Description</font></h4>
396<P>
397The \"Documentation\" annotation can contain the \"info\" annotation giving a textual description, the \"revisions\" annotation giving a list of revisions and other annotations defined by a tool [The \"revisions\" documentation may be omitted in printed documentation]. How the tool interprets the information in \"Documentation\" is unspecified. Within a string of the \"Documentation\" annotation, the tags &lt;HTML&gt; and &lt;/HTML&gt; or &lt;html&gt; and &lt;/html&gt; define optionally begin and end of content that is HTML encoded. Links to Modelica classes may be defined with the HTML link command using scheme \"Modelica\", e.g.,
398</p>
399
400<pre>    &lt;a href=\"Modelica://MultiBody.Tutorial\"&gt;MultiBody.Tutorial&lt;/a&gt;
401</pre>
402
403<p>
404Together with scheme \"Modelica\" the (URI)  fragment specifiers #diagram, #info, #text, #icon may be used to reference different layers. Example:
405</p>
406
407<pre>   &lt;a href=\"Modelica://MultiBody.Joints.Revolute#info\"&gt;Revolute&lt;/a&gt;
408</pre>
409
410</html>"));
411  end Documentation;
412
413  annotation (Documentation(info="<html>
414<p>
415In this package annotations are described.
416Annotations are intended for storing extra information about a model, such as graphics, documentation or versioning. A Modelica tool is free to define and use other annotations, in addition to those defined here. The only requirement is that any tool shall save files with all annotations from this chapter and all vendor-specific annotations intact. To ensure this, annotations must be represented with constructs according to the Modelica grammar. The Modelica language specification defines the semantic meaning if a tool implements any of these annotations.
417</p>
418
419</html>"));
420  class DynamicSelect "DynamicSelect"
421
422    annotation (Documentation(info="<html>
423<p>
424Define schematic animation of diagram layer
425</p>
426
427<h4><font color=\"#008000\">Examples</font></h4>
428
429<blockquote>
430<p>
431The level of a tank is animated by a rectangle expanding in vertical direction and its color depending on a variable overflow:
432</p>
433
434<pre><b>annotation</b>(
435  Icon(graphics={Rectangle(
436    extent=<b>DynamicSelect</b>({{0,0},{20,20}},{{0,0},{20,level}}),
437    fillColor=<b>DynamicSelect</b>({0,0,255},
438                            <b>if</b> overflow <b>then</b> {255,0,0} <b>else</b> {0,0,255}))}
439);
440</pre></blockquote>
441
442
443<h4><font color=\"#008000\">Description</font></h4>
444
445<p>
446Any value (coordinates, color, text, etc.) in graphical annotations can be dependent on class variables using the DynamicSelect expression. DynamicSelect has the syntax of a function call with two arguments, where the first argument specifies the value of the editing state and the second argument the value of the non-editing state. The first argument must be a literal expression
447and this value is used for the annotation when editing and/or browsing the diagram layer.
448The second argument may contain references to variables to enable a dynamic behavior
449and the actual value is used for the annotation for schematic animation
450of the diagram layer, e.g., after a simulation.
451</p>
452
453</html>"));
454  end DynamicSelect;
455
456  class Evaluate "Evaluate"
457
458    annotation (Documentation(info="<html>
459<p>
460Annotation for code generation (evaluate parameter value)
461</p>
462
463<h4><font color=\"#008000\">Syntax</font></h4>
464
465<pre>   <b>annotation</b>\"(\" Evaluate \"=\" ( <b>false</b> | <b>true</b> ) \")
466</pre>
467
468
469<h4><font color=\"#008000\">Description</font></h4>
470
471<p>
472Has only an effect for a declaration with the prefix parameter.
473</p>
474
475<p>
476If Evaluate = true, the model developer proposes to utilize the value for the symbolic processing. In that case, it is not possible to change the parameter value after symbolic pre-processing.
477</p>
478
479<p>
480If Evaluate = false, the model developer proposes to not utilize the value of the corresponding parameter for the symbolic processing.
481</p<
482
483<p>
484Evaluate is for example used for axis of rotation parameters in the Modelica.Mechanics.MultiBody library in order to improve the efficiency of the generated code
485</p>
486
487</html>"));
488  end Evaluate;
489
490  class experiment "experiment"
491
492    annotation (Documentation(info="<html>
493<p>
494Define default experiment parameters
495</p>
496
497<h4><font color=\"#008000\">Examples</font></h4>
498
499<pre><b>annotation</b>(experiment(StartTime=0, StopTime=5, Tolerance=1e-6))
500</pre>
501
502
503<h4><font color=\"#008000\">Syntax</font></h4>
504
505<pre>experiment_annotation:
506   <b>annotation</b>\"(\" \"experiment\" \"(\" [experimentOption] {, experimentOption}] \")\"
507
508experimentOption:
509   StartTime  \"=\" [\"+\" | \"-\"] UNSIGNED_NUMBER |
510   StopTime   \"=\" [\"+\" | \"-\"] UNSIGNED_NUMBER |
511   Tolerance  \"=\" UNSIGNED_NUMBER
512</pre>
513
514
515<h4><font color=\"#008000\">Description</font></h4>
516
517<p>
518The experiment annotation defines the default start time (StartTime) in [s], the default stop time (StopTime) in [s], and the default relative integration tolerance (Tolerance) for simulation experiments to be carried out with the model or block at hand.
519</p>
520
521</html>"));
522  end experiment;
523
524  class HideResult "HideResult"
525
526    annotation (Documentation(info="<html>
527<p>
528Annotation for code generation (hide result)
529</p>
530
531<h4><font color=\"#008000\">Syntax</font></h4>
532
533<pre>   <b>annotation</b>\"(\" HideResult \"=\" ( <b>false</b> | <b>true</b> ) \")
534</pre>
535
536
537<h4><font color=\"#008000\">Description</font></h4>
538
539<p>
540HideResult = true defines that the model developer proposes to not show the simulator results of the corresponding component [e.g., it will not be possible to plot this variable].
541</p>
542
543<p>
544HideResult = false defines that the developer proposes to show the corresponding component [if a variable is declared in a protected section, a tool might not include it in a simulation result. By setting HideResult = false, the modeler would like to have the variable in the simulation result, even if in the protected section].
545</p>
546
547<p>
548HideResult is for example used in the connectors of the Modelica.StateGraph library to not show variables to the modeler that are of no interest to him and would confuse him.
549</p>
550
551</html>"));
552  end HideResult;
553
554  class Inline "Inline"
555
556    annotation (Documentation(info="<html>
557<p>
558Annotation for code generation (inline function body)
559</p>
560
561<h4><font color=\"#008000\">Syntax</font></h4>
562
563<pre>   <b>annotation</b>\"(\" Inline \"=\" ( <b>false</b> | <b>true</b> ) \")
564</pre>
565
566
567<h4><font color=\"#008000\">Description</font></h4>
568
569<p>
570Has only an effect within a function declaration.
571</p>
572
573<p>
574If \"Inline = true\", the model developer proposes to inline the function.
575This means, that the body of the function is included at all places where the function is called.
576</p>
577
578<p>
579If \"Inline = false\", the model developer proposes to not inline the function.
580</p>
581
582<p>
583Inline = true is for example used in Modelica.Mechanics.MultiBody.Frames and in functions of Modelica.Media to have no overhead for function calls such as resolving a vector in a different coordinate system and at the same time the function can be analytically differentiated, e.g., for index reduction needed for mechanical systems.
584</p>
585
586</html>"));
587  end Inline;
588
589  class LateInline "LateInline"
590
591    annotation (Documentation(info="<html>
592<p>
593Annotation for code generation (inline function body after symbolic processing)
594</p>
595
596<h4><font color=\"#008000\">Syntax</font></h4>
597
598<pre>   <b>annotation</b>\"(\" LateInline \"=\" ( <b>false</b> | <b>true</b> ) \")
599</pre>
600
601
602<h4><font color=\"#008000\">Description</font></h4>
603
604<p>
605Has only an effect within a function declaration.
606</p>
607
608<p>
609If \"LateInline = true\", the model developer proposes to inline the function after all symbolic transformations have been performed, but before common subexpression elimination takes place.
610</p>
611
612<p>
613If \"LateInline = false\", the model developer proposes to not inline the function after symbolic transformations have been performed.
614</p>
615
616<p>
617This annotation is for example used in Modelica.Media.Water.IF97_Utilities.T_props_ph to provide in combination with common subexpression elimination the automatic caching of function calls. Furthermore, it is used in order that a tool is able to propagate specific enthalpy over connectors in the Modelica_Fluid library.
618</p>
619
620</html>"));
621  end LateInline;
622
623  class missingInnerMessage "missingInnerMessage"
624
625    annotation (Documentation(info="<html>
626<p>
627Warning message, if inner declaration is missing
628</p>
629
630<h4><font color=\"#008000\">Examples</font></h4>
631
632<pre><b>model</b> World
633  <b>annotation</b>(defaultComponentName     = \"world\",
634             defaultComponentPrefixes = \"inner replaceable\",
635             missingInnerMessage      = \"The World object is missing\");
636  ...
637<b>end</b> World;
638</pre>
639
640<h4><font color=\"#008000\">Syntax</font></h4>
641
642<pre>   <b>annotation</b>\"(\" missingInnerMessage \"=\" STRING \")\"
643</pre>
644
645
646<h4><font color=\"#008000\">Description</font></h4>
647
648<p>
649When an outer component of the class does not have a corresponding inner component, the string message may be used as a diagnostic message.
650</p>
651
652</html>"));
653  end missingInnerMessage;
654
655  class PreferredView "preferredView"
656
657    annotation (Documentation(info="<html>
658<p>
659Define default view when selecting class
660</p>
661
662<h4><font color=\"#008000\">Syntax</font></h4>
663
664<pre>preferred view_annotation:
665   <b>annotation</b>\"(\" preferredView \"=\" (\"info\" | \"diagram\" | \"text\") \")\"
666</pre>
667
668
669<h4><font color=\"#008000\">Description</font></h4>
670
671<p>
672The preferredView annotation defines the default view when selecting the class. info means info layer, i.e., the documentation of the class, diagram means diagram layer and text means the Modelica text layer.
673</p>
674
675</html>"));
676  end PreferredView;
677
678  class smoothOrder "smoothOrder"
679
680    annotation (Documentation(info="<html>
681<p>
682Define differentiability of function body
683</p>
684
685<h4><font color=\"#008000\">Syntax</font></h4>
686
687<pre>   <b>annotation</b>\"(\" smoothOrder \"=\" UNSIGNED_INTEGER \")\"
688</pre>
689
690
691<h4><font color=\"#008000\">Description</font></h4>
692
693<p>
694This annotation has only an effect within a function declaration.
695</p>
696
697<p>
698smoothOrder defines the minimum number of differentations of the function, in order that all of the differentiated outputs are continuous provided all input arguments and their derivatives up to order smoothOrder are continuous.
699</p>
700
701<p>
702This means that the function is at least C<sup>smoothOrder</sup>. smoothOrder = 1 means that the function can be differentiated at least once in order that all output arguments are still continuous, provided the input arguments are continuous. If a tool needs the derivative of a function, e.g., for index reduction or to compute an analytic Jacobian, the function can be differentiated analytically at least smoothOrder times.
703</p>
704
705</html>"));
706  end smoothOrder;
707
708  class version "version"
709
710    annotation (Documentation(info="<html>
711<p>
712Define version information of package
713</p>
714
715<h4><font color=\"#008000\">Examples</font></h4>
716
717<pre><b>package</b> Modelica
718  <b>annotation</b>(version=\"2.1\",
719             conversion(noneFromVersion=\"2.1 Beta 1\",
720                        from(version=\"1.5\",
721                             script=\"convertFromModelica1_5.mos\")));
722  ...
723<b>end</b> Modelica;
724
725<b>model</b> A
726  <b>annotation</b>(version=\"1.0\",
727     uses(Modelica(version=\"1.5\")));
728  ...
729<b>end</b> A;
730
731<b>model</b> B
732  <b>annotation</b>(uses(Modelica(version=\"2.1 Beta 1\")));
733  ...
734<b>end</b> B;
735</pre>
736
737<p>
738In this example the model A uses an older version of the Modelica library and can be upgraded using the given script, and model B uses an older version of the Modelica library but no changes are required when upgrading.
739</p>
740
741
742
743<h4><font color=\"#008000\">Description</font></h4>
744
745<p>
746Version numbers are of the forms:
747</p>
748
749<ul>
750<li> Main release versions:
751     <pre>\"\"\" UNSIGNED_INTEGER { \".\" UNSIGNED_INTEGER } \"\"\"</pre>
752     Example: <code>\"2.1\"</code><br>&nbsp;</li>
753
754<li> Pre-release versions:
755     <pre>\"\"\" UNSIGNED_INTEGER { \".\" UNSIGNED_INTEGER } \" \" {S-CHAR} \"\"\"</pre>
756     Example: <code>\"2.1 Beta 1\"</code><br>&nbsp;</li>
757
758<li> Un-ordered versions:
759     <pre> \"\"\" NON-DIGIT {S-CHAR} \"\"\" </pre>
760     Example: <code>\"Test 1\"</code></li>
761</ul>
762
763<p>
764The main release versions are ordered using the hierarchical numerical names, and follow the corresponding pre-release versions. The pre-release versions of the same main release version are internally ordered alphabetically.
765</p>
766
767<p>
768In a top-level class, the version number and the dependency to earlier versions of this class are defined using one or more of the following annotations:
769</p>
770
771<ul>
772<li> <code>version = CURRENT-VERSION-NUMBER</code><br>
773     Defines the version number of the model or package.
774     All classes within this top-level class have this version number.<br>&nbsp;</li>
775
776<li> <code>conversion ( noneFromVersion = VERSION-NUMBER)</code><br>
777     Defines that user models using the VERSION-NUMBER can be upgraded to
778     the CURRENT-VERSION-NUMBER of the current class without any changes.<br>&nbsp;</li>
779
780<li> <code>conversion ( from (version = VERSION-NUMBER, script = \"?\") )       </code><br>
781     Defines that user models using the VERSION-NUMBER can be upgraded to
782     the CURRENT-VERSION-NUMBER of the current class by applying the given
783     script. The semantics of the conversion script is not defined.<br>&nbsp;</li>
784
785<li> <code>uses(IDENT (version = VERSION-NUMBER) )</code><br>
786     Defines that classes within this top-level class uses version
787     VERSION-NUMBER of classes within the top-level class IDENT.
788     The annotations uses and conversion may contain several different sub-entries.<li>
789</ul>
790
791<p>
792A top-level class, IDENT, with version VERSION-NUMBER can be stored in one
793of the following ways in a directory given in the MODELICAPATH:
794</p>
795
796<ul>
797<li> The file IDENT \".mo\"<br>
798     Example: Modelica.mo</li>
799<li> The file IDENT \" \" VERSION-NUMBER \".mo\"<br>
800     Example: Modelica 2.1.mo</li>
801<li> The directory IDENT<br>
802     Example: Modelica</li>
803<li> The directory IDENT \" \" VERSION-NUMBER<br>
804     Example: Modelica 2.1</li>
805</ul>
806
807<p>
808This allows a tool to access multiple versions of the same package.
809</p>
810
811</html>"));
812  end version;
813
814  class unassignedMessage "unassignedMessage"
815
816    annotation (Documentation(info="<html>
817<p>
818Error message, if variable is not assigned
819</p>
820
821<h4><font color=\"#008000\">Examples</font></h4>
822
823<pre><b>connector</b> Frame \"Frame of a mechanical system\"
824    ...
825  <b>flow</b> Modelica.SIunits.Force f[3] <b>annotation</b>(unassignedMessage =
826\"All Forces cannot be uniquely calculated. The reason could be that the
827mechanism contains a planar loop or that joints constrain the same motion.
828For planar loops, use in one revolute joint per loop the option
829PlanarCutJoint=true in the Advanced menu.
830\");
831<b>end</b> Frame;
832</pre>
833
834
835<h4><font color=\"#008000\">Syntax</font></h4>
836
837<pre>   <b>annotation</b>\"(\" unassignedMessage \"=\" STRING \")\"
838</pre>
839
840
841<h4><font color=\"#008000\">Description</font></h4>
842
843<p>
844When the variable to which this annotation is attached in the declaration cannot be computed due to the structure of the equations, the string message can be used as a diagnostic message. When using BLT partitioning, this means if a variable \"a\" or one of its aliases \"b = a\", \"b = -a\", cannot be assigned, the message is displayed. This annotation is used to provide library specific error messages.
845</p>
846
847</html>"));
848  end unassignedMessage;
849end Annotations;
850
851
852package Classes "Classes (model, function, ...)"
853  class Block "block"
854
855    annotation (Documentation(info="<html>
856<p>
857Define specialized class <i>block</i>
858</p>
859<h4><font color=\"#008000\">Examples</font></h4>
860
861<pre><b>block</b> Integrator
862  <b>input</b> Real u;
863  <b>output</b> Real y;
864<b>protected</b>
865  Real x;
866<b>equation
867  der</b>(x) = u;
868  y = x;
869<b>end</b> Integrator;</pre>
870
871<h4><font color=\"#008000\">Syntax</font></h4>
872
873<PRE>   [ <B>encapsulated</B> ][ <B>partial </B>] <B>block</B>
874   IDENT class_specifier
875
876class_specifier :
877   string_comment composition <B>end</B> IDENT
878   | \"=\" base_prefix name [ array_subscripts ] [ class_modification ] comment
879   | \"=\" <B>enumeration</B> \"(\" ( [enum_list] | \":\" ) \")\" comment</PRE>
880
881<p>See Modelica Language Specification for further details.</p>
882
883<h4><font color=\"#008000\">Description</font></h4>
884<P>
885A block class is the same as a model class
886with the restriction that each connector component of a block must
887have prefixes input and/or output for all connector variables.
888The purpose is to model input/output blocks of block diagrams.
889Due to the restrictions on input and output prefixes,
890connections between blocks are only possible according
891to block diagram semantic.
892</P>
893</html>"));
894  end Block;
895
896  class Class "class"
897
898    annotation (Documentation(info="<html>
899<p>
900Define class
901</p>
902<h4><font color=\"#008000\">Examples</font></h4>
903
904<pre><b>class</b> MyTable
905  <b>extends</b> ExternalObject;
906  <b>function</b> constructor
907     ...
908  <b>end</b> constructor;
909
910  <b>function</b> destructor
911     ...
912  <b>end</b> destructor;
913<b>end</b> MyTable;</pre>
914
915<h4><font color=\"#008000\">Syntax</font></h4>
916<PRE>   [ <B>encapsulated</B> ][ <B>partial </B>] <B>class</B>
917   IDENT class_specifier
918
919class_specifier :
920   string_comment composition <B>end</B> IDENT
921   | \"=\" base_prefix name [ array_subscripts ] [ class_modification ] comment
922   | \"=\" <B>enumeration</B> \"(\" ( [enum_list] | \":\" ) \")\" comment</PRE>
923
924<p>See Modelica Language Specification for further details.</p>
925
926<h4><font color=\"#008000\">Description</font></h4>
927
928<p>
929The keyword class is used to define general classes (without any restrictions).
930It is identical to the keyword model.
931In most cases, it is recommended to use specialized classes as <b>block</b>,
932<b>connector</b>, <b>model</b>, <b>package</b>, <b>record</b>, <b>function</b>or <b>type</b>.
933\"class\" should only be used to define ExternalObjects.
934</p>
935</html>"));
936  end Class;
937
938  class Connector "connector"
939
940    annotation (Documentation(info="<html>
941<p>
942Define specialized class <i>connector</i>
943</p>
944<h4><font color=\"#008000\">Examples</font></h4>
945
946<pre><b>connector</b> flange
947  Modelica.SIunits.Angle phi;
948  <b>flow</b> Modelica.SIunits.Torque tau;
949<b>end</b> flange;</pre>
950
951<h4><font color=\"#008000\">Syntax</font></h4>
952<PRE>   [ <B>encapsulated</B> ][ <B>partial </B>] <B>connector</B>
953   IDENT class_specifier
954
955class_specifier :
956   string_comment composition <B>end</B> IDENT
957   | \"=\" base_prefix name [ array_subscripts ] [ class_modification ] comment
958   | \"=\" <B>enumeration</B> \"(\" ( [enum_list] | \":\" ) \")\" comment</PRE>
959
960<p>See Modelica Language Specification for further details.</p>
961
962<h4><font color=\"#008000\">Description</font></h4>
963<P>The keyword connector is used to define connectors, which are used
964in connect statements. In connectors, no equations are allowed in the
965definition or in any of its components.
966With respect to \"class\", it is enhanced to allow connect(..) to components
967of connector classes.
968</P>
969</html>"));
970  end Connector;
971
972  class Function "function"
973
974    annotation (Documentation(info="<html>
975<p>
976Define specialized class <i>function</i>
977</p>
978<h4><font color=\"#008000\">Examples</font></h4>
979
980<pre><b>function</b> si
981  <b>input</b> Real x;
982  <b>output</b> Real y;
983<b>algorithm</b>
984  y =