- From the Parameter and Variable Editor, select the parameter you want to edit.
- Select Edit the selected parameter, constant or variable (or Create a parameter, constant or variable if you need a new parameter/variable).
The Parameter and Variable Edition dialog box for that parameter/variable appears (or the Parameter and Variable Definition dialog box if you create a new variable/parameter) . - From the Declaration tab, modify or enter your Modelica specifications. This information appears in the Modelica text browser.
- In the first box Variability select the variability: any of the variable types Parameter, Constant, or Discrete, or keep this box empty. By default, the box is empty and a continuous variable is created.
-
Type: from the box, select a basic type
(Real, Integer,
Boolean, or String) or one of the
other classes under the basic types. You can also click Switch between
class and basic type selection
to select a class from the Package
Browser.
Notes:
For the Type box:
- By default, there are some SI unit types available from the box, in addition
to the basic types. Your own type selections are later inserted before those SI
unit types.
- The list in the box is limited to 20 types, excluding the basic types.
-
Name: type the name to appear from the Parameter
and Variable Editor.
-
Array Dimension: If need be, define an array. By default,
this box is left empty and the value is 1.
-
Value: Enter the default value for this parameter/variable.
The value can be a number or the complete modifier of the variable. Example for a
Resistor instance "(R=4)".
-
Description box: If need be, enter a description for the
parameter/variable.
- Select the Attributes tab to specify additional type prefixes.
- From the Properties area on the Attributes tab, specify how the parameter/variable can be accessed or changed in modifiers.
- Select Final if the value of the parameter/variable should not be able to modify.
- Select Protected if the parameter/variable should not be accessible from outside the model.
- Select Replaceableif the parameter/variable should be re-declarable in a modifier.
- From the Connector members, specify connector attributes, if needed.
- Select Flow to specify that this quantity sums to zero when connected. This option is available for the parameters/variables of a connector. Examples of such quantities are torque and current.
- Select Stream to specify that this quantity
-
From the Causality area on the Attributes
tab, specify the causality that is required for public parameters/variables.
- None: the parameter/variable has unspecified causality
(determined during translation).
- Input: the parameter/variable is an input to the
model.
- Output: the parameter/variable is calculated by the
model.
- From the Dynamic Typing area on the Attributes tab, specify type properties for the parameter/variable:
- Normal: the parameter/variable has no dynamic type.
- Inner: the parameter/variable can be referenced by the inner
parameter/variable in nested components.
- Outer: the parameter/variable matches an outer parameter/variable in an enclosing scope.
- From the Expose in Knowledgeware area on the Attributes tab, specify attributes for the linked Knowledge parameter. See Exposing Modelica Parameters as Knowledgeware Parameters.
- Select Annotations tab to create and edit annotations.
-
From the Evaluate area on the Annotations
tab, specify whether a parameter is to be evaluated during translation.
- Default: the parameter is evaluated as defined in the
Execution Setup dialog box. See Execution Setup.
- On: the parameter is always evaluated during translation.
- Off: the parameter is never evaluated during
translation.
- From the Hide area on the Annotations tab, specify whether a variable should be hidden.
Note:
If a variable is internal, it is better to declare it protected using the Attributes tab.
- Default: show variable (if not declared as protected).
- On: never show variable in variable browser.
- Off: always show variable in variable browser.
- From the Parameter dialog placement area on the Annotations tab, define the following options:
-
Tab: Specify in which tab of the parameter dialog the box
should be added.
-
Group: Specify in which group of parameters in the parameter
dialog the box should be added.
-
Enable: Specify if the box should be enabled in the
parameter dialog. If true, the conditional box in the parameter dialog box is
enabled.
-
Show start: Specify if the box should be displayed as a box
with a corresponding start value box, under the Initialization
group of the parameter dialog.
As an example, if you define a parameter MyTest and
specify this option to true for it, the result in the parameter
dialog is:
-
From the Graphical information area on the
Annotations tab, specify the attributes of the graphical
component.
-
Extent: Define the extent of the graphical component.
Accepted value format is {{real,real},{real,real}}, for example
{{-10, -10},{10,10}}.
-
Origin: Define the origin of the graphical component.
Accepted value format is {real,real}, for example
{0,0}.
-
Rotation: Define the rotation of the graphical component.
Accepted value format is real, for example
90.
- Click OK to exit the Variable and Parameter Declaration dialog box and validate your modifications.
|