root/branches/maintenance/2.2.1/Modelica/Blocks/Types.mo

Revision 463, 9.4 kB (checked in by hubertus, 22 months ago)

Created maintenance version from Dynasims version with minimal changes (no checksum, 1 graphics, a few improved documentation places, structurallyIncomplete annotations in Visualizers)

Line 
1package Types "Constants and types with choices, especially to build menus" 
2  extends Modelica.Icons.Library;
3 
4  annotation (preferedView="info", Documentation(info="<HTML>
5<p>
6In this package <b>types</b> and <b>constants</b> are defined that are used
7in library Modelica.Blocks. The types have additional annotation choices
8definitions that define the menus to be built up in the graphical
9user interface when the type is used as parameter in a declaration.
10</p>
11</HTML>"));
12  package Extrapolation
13    "Type, constants and menu choices to define the extrapolation of time table interpolation" 
14   
15    annotation (Documentation(info="<html>
16 
17</html>"));
18    extends Modelica.Icons.Enumeration;
19   
20    constant Integer HoldLastPoint=0 
21      "Hold the last table point outside of the table scope";
22    constant Integer LastTwoPoints=1 
23      "Extrapolate linearly through the last two table points outside of the table scope";
24    constant Integer Periodic=2 "Repeat the table scope periodically";
25   
26    type Temp
27      "Temporary type of Extrapolation with choices for menus (until enumerations are available)" 
28     
29      extends Modelica.Icons.TypeInteger;
30      annotation (choices(
31        choice=Modelica.Blocks.Types.Extrapolation.HoldLastPoint 
32            "hold last point (constant extrapolation)",
33        choice=Modelica.Blocks.Types.Extrapolation.LastTwoPoints 
34            "last two points (linear extrapolation)",
35        choice=Modelica.Blocks.Types.Extrapolation.Periodic 
36            "periodic (repeat table)"), Documentation(info="<html>
37<p>
38Type of extrapolation in a table.
39</p>
40 
41<table border=1 cellspacing=0 cellpadding=2>
42  <tr><td><b>choice</b></td>
43      <td><b>Meaning of choice</b></td>
44  </tr>
45 
46  <tr><td>HoldLastPoint</td>
47      <td>Hold the last table point outside of the table scope</td>
48  </tr>
49  <tr><td>LastTwoPoints</td>
50      <td>Extrapolate linearly through the last two table points
51          outside of the table scope</td>
52  </tr>
53  <tr><td>Periodic</td>
54      <td>Repeat the table scope periodically</td>
55  </tr>
56</table>
57</html>"));
58    end Temp;
59  end Extrapolation;
60 
61  package Init
62    "Type, constants and menu choices to define initialization of blocks" 
63    annotation (Documentation(info="<html>
64 
65</html>"));
66   
67    extends Modelica.Icons.Enumeration;
68    constant Integer NoInit=1 
69      "no initialization (start values are used as guess values with fixed=false)";
70    constant Integer SteadyState=2 
71      "steady state initialization (derivatives of states are zero)";
72    constant Integer InitialState=3 "initialization with initial states";
73    constant Integer InitialOutput=4 
74      "initialization with initial outputs (and steady state of the states if possibles)";
75   
76    type Temp
77      "Temporary type of initialization with choices for menus (until enumerations are available)" 
78      extends Modelica.Icons.TypeInteger(min=1,max=4);
79     
80      annotation (Evaluate=true, choices(
81          choice=Modelica.Blocks.Types.Init.NoInit 
82            "no initialization (start values are used as guess values with fixed=false)",
83          choice=Modelica.Blocks.Types.Init.SteadyState 
84            "steady state initialization (derivatives of states are zero)",
85          choice=Modelica.Blocks.Types.Init.InitialState 
86            "initialization with initial states",
87          choice=Modelica.Blocks.Types.Init.InitialOutput 
88            "initialization with initial outputs (and steady state of the states if possibles)"));
89    end Temp;
90   
91  end Init;
92 
93  package InitPID
94    "Type, constants and menu choices to define initialization of PID and LimPID blocks" 
95    annotation (Documentation(info="<html>
96<p>
97This initialization type is identical to Types.Init and has just one
98additional option <b>DoNotUse_InitialIntegratorState</b>. This options
99is only introduced in order that the default initialization for the
100Continuous.PID and Continuous.LimPID blocks are backward
101compatible. In Modelica 2.2, the integrators have been initialized
102with their given states wheresas the D-part has not been initialized.
103The option \"DoNotUse_InitialIntegratorState\" leads to this
104initialization definition.
105</p>
106
107</html>"));
108   
109    extends Modelica.Icons.Enumeration;
110    constant Integer NoInit=1 
111      "no initialization (start values are used as guess values with fixed=false)";
112    constant Integer SteadyState=2 
113      "steady state initialization (derivatives of states are zero)";
114    constant Integer InitialState=3 "initialization with initial states";
115    constant Integer InitialOutput=4 
116      "initialization with initial outputs (and steady state of the states if possibles)";
117    constant Integer DoNotUse_InitialIntegratorState=5 
118      "don't use, only for backward compatibility (initialize only integrator state)";
119   
120    type Temp
121      "Temporary type of initialization with choices for menus (until enumerations are available)" 
122      extends Modelica.Icons.TypeInteger(min=1,max=5);
123     
124      annotation (Evaluate=true, choices(
125          choice=Modelica.Blocks.Types.Init.NoInit 
126            "no initialization (start values are used as guess values with fixed=false)",
127          choice=Modelica.Blocks.Types.Init.SteadyState 
128            "steady state initialization (derivatives of states are zero)",
129          choice=Modelica.Blocks.Types.Init.InitialState 
130            "initialization with initial states",
131          choice=Modelica.Blocks.Types.Init.InitialOutput 
132            "initialization with initial outputs (and steady state of the states if possibles)",
133          choice=Modelica.Blocks.Types.Init.DoNotUse_InitialIntegratorState 
134            "don't use, only for backward compatibility (initialize only integrator state)"));
135    end Temp;
136   
137  end InitPID;
138 
139  package SimpleController
140    "Type, constants and menu choices to define a simple controller type" 
141   
142    annotation (Documentation(info="<html>
143 
144</html>"));
145    extends Modelica.Icons.Enumeration;
146    constant Integer P=1 "P controller";
147    constant Integer PI=2 "PI controller";
148    constant Integer PD=3 "PD controller";
149    constant Integer PID=4 "PID controller";
150   
151    type Temp
152      "Temporary type of simple controller type with choices for menus (until enumerations are available)" 
153      extends Modelica.Icons.TypeInteger(min=1,max=4);
154     
155      annotation (Evaluate=true, choices(
156          choice=Modelica.Blocks.Types.SimpleController.P "P controller",
157          choice=Modelica.Blocks.Types.SimpleController.PI "PI controller",
158          choice=Modelica.Blocks.Types.SimpleController.PD "PD controller",
159          choice=Modelica.Blocks.Types.SimpleController.PID "PID controller"));
160    end Temp;
161   
162  end SimpleController;
163 
164  package Smoothness
165    "Type, constants and menu choices to define the smoothness of table interpolation" 
166   
167    annotation (Documentation(info="<html>
168   
169</html>"));
170    extends Modelica.Icons.Enumeration;
171   
172    constant Integer LinearSegments=0 "Table points are linearly interpolated";
173    constant Integer ContinuousDerivative=1 
174      "Table points are interpolated such that the first derivative is continuous";
175   
176    type Temp
177      "Temporary type of Smoothness with choices for menus (until enumerations are available)" 
178     
179      extends Modelica.Icons.TypeInteger;
180      annotation (choices(
181        choice=Modelica.Blocks.Types.Smoothness.LinearSegments 
182            "linear segments",
183        choice=Modelica.Blocks.Types.Smoothness.ContinuousDerivative 
184            "continuous derivative"), Documentation(info="<html>
185<p>
186Smoothness of interpolation in a table.
187</p>
188 
189<table border=1 cellspacing=0 cellpadding=2>
190  <tr><td><b>choice</b></td>
191      <td><b>Meaning of choice</b></td>
192  </tr>
193 
194  <tr><td>LinearSegments</td>
195      <td>Table points are linearly interpolated</td>
196  </tr>
197  <tr><td>ContinuousDerivative</td>
198      <td>Table points are interpolated such that the
199          first derivative is continuous</td>
200  </tr>
201</table>
202</html>"));
203    end Temp;
204  end Smoothness;
205 
206  package StateSelection
207    "Type, constants and menu choices to define state selection of variables" 
208   
209    annotation (Documentation(info="<html>
210 
211</html>"));
212   
213    extends Modelica.Icons.Enumeration;
214    constant Integer Never=1 "Never (never use as state)";
215    constant Integer Avoid=2 "Avoid (avoid to use as state)";
216    constant Integer Default=3 "Default (default behaviour)";
217    constant Integer Prefer=4 "Prefer (use as state if possible)";
218    constant Integer Always=5 "Always (always use as state)";
219   
220    type Temp
221      "Temporary type of state selection with choices for menus (until enumerations are available)" 
222      extends Modelica.Icons.TypeInteger(min=1,max=5);
223     
224      annotation (Evaluate=true, choices(
225          choice=Modelica.Blocks.Types.StateSelection.Never 
226            "Never (never use as state)",
227          choice=Modelica.Blocks.Types.StateSelection.Avoid 
228            "Avoid (avoid to use as state)",
229          choice=Modelica.Blocks.Types.StateSelection.Default 
230            "Default (default behaviour)",
231          choice=Modelica.Blocks.Types.StateSelection.Prefer 
232            "Prefer (use as state if possible)",
233          choice=Modelica.Blocks.Types.StateSelection.Always 
234            "Always (always use as state)"));
235    end Temp;
236   
237  end StateSelection;
238end Types;
Note: See TracBrowser for help on using the browser.