Editing Component Parameters

You can edit and modify the parameters of a component, and some other modifiers.

Note that the Component Parameters Edition dialog box displays different tabs depending on the selected component.

From this dialog box, you can also propagate a parameter or a replaceable class. Refer to Propagating a Parameter and Propagating a Replaceable Class.

This task shows you how to:


Related Topics
About Parameters and Variables

Edit Component Parameters

The Component Parameters Edition

  1. From the Component Browser or from the diagram, select a component.

  2. Select Edit Component Parameters from the Balloon contextual toolbar, from the contextual menu or from the Parameter and Variable Editor.

    The Component Parameters Edition dialog box appears to let you edit the component parameters.

    For more about this dialog box, refer to Component Parameters Edition Dialog Box.



  3. To find and insert any variable (except protected ones) from the current model, including variables in sub-components;

    1. Right-click the parameter input field, then select Insert component reference from the contextual menu.

      A Select a parameter dialog box appears.

    2. Browse for the wanted variable in the browser.
    3. Select the variable.
    4. Click OK.

    The variable, including the path to it, is inserted in the parameter input field.

    Note: The current content of the field is not replaced.

  4. You can get help on how to e.g. insert matrix values by clicking on the icon (if any) after the parameter input field. By posing over it you can see what kind of help that is given.

    For more information about the alternatives and how to use them, please see Edit Command Dialog Boxes/Editors.

  5. A simple text editor faciliates working with long texts. Right-click the parameter input field, then select Modelica Text from the contextual menu.

  6. To define a final parameter, right-click the parameter input field, then select Final from the contextual menu.

    Important: Such final parameter (with all its elements) can be modified in this package context, but cannot be modified nor redeclared once instantiated.

  7. To define how a start value in the Initialization section of the dialog box should behave;

    1. Right-click the icon in front of the start value.
    2. Select the wanted behavior.

    An icon indicates the behavior of the start value. This can also be shown as text by posing over the icon. There are four possible behaviors:

    • The start value is used to initialize (modifier "fixed" = true).
    • The start value is only a guess value (modifier "fixed" = false).
    • The behavior of the start value is inherited (modifier "fixed" gets its value from other levels).
    • The behavior of the start value can not be presented here (modifier "fixed" is modified from another tool and is an expression).

  8. Click OK to exit the dialog box and save the component parameters.

Edit a Component Parameter Attribute

You can define an attribute (minimum, maximum, unit...) for a parameter, variable or sub-parameters.

Note:

  • The dialog box looks different depending on the type of parameter.
  • If an Edit command is present after the input field, you can use this command or the contextual menu described in this scenario. It displays a matrix editor. For more information about the matrix editor, refer to Working With the Matrix Editor.

The Component Parameters Edition dialog box of the relevant component must be displayed.

In this example, we edit a parameter of real type.

  1. Right-click the input field of the parameter/variable that should be edited, and select Edit in the context menu that is displayed.

    A Component Parameters Edition dialog box appears. For a simple real value it can look like:

  2. Define the following attributes for the component parameter:

    • quantity can be used to change the value of the parameter.
    • unit: to change the unit of the parameter used in calculations.
    • displayUnit: to change the unit of the parameter that is displayed in e.g. plotter windows.
    • min: to change the minimum value of the parameter.
    • max: to change the maximum value of the parameter.
    • start: to change the start value of the parameter.
    • fixed: to set the value of the modifier fixed for the parameter. True or false can be selected using the drop-down list.
      • true means that the start value is used to initialize.
      • false means that the start value is used only as a guess value.

        Note: The default is true for parameters, false for variables.

    • nominal: to indicate the magnitude of the value.
    • stateSelect sets the preference state selection. Use the drop-down list to select preference.

      Note: By not entering anything the default value is selected.

    • StateSelect.never - do not use as state at all.
    • StateSelect.avoid - use as state only if it cannot be avoided.
    • StateSelect.default - use as state only if appropriate.
    • StateSelect.prefer - prefer as state over the default ones.
    • StateSelect.always - use as state always.

  3. Click OK to validate your parameter attributes.

    The dialog box is closed, and you're back to the component parameter edition.