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