Defining Local Variables at the Design Level

Adding a Local Variable

To define a Local Variable:

  1. Access Design Properties one of three ways:
    • Click HFSS > Design Properties.
    • Right-click the design name in the Project Tree and select Design Properties.
    • From a menu in the lower left corner of the following Optimization dialogs: Parametric, Optimization, Sensitivity, Statistical, Design of Experiments, and Design Xplorer Setup. Click Edit Variables and from the menu select Edit Design Variables

    The Properties window appears with the Local Variables tab.

  2. Click Add.

    The Add Property window appears.

    Add Property

  3. Enter information for the variable, as applicable:
    • Name – the name must start with a letter and can contain alphanumeric characters and underscores (_). You cannot use any names already defined on the General tab.
    • Variable Type – use the Variable, Separator, ArrayIndexVariable, and PostProcessingVariable radio buttons to select the variable type.
      Note:

      Not all variable types are available for all designs.

      Your selection impacts which properties you can edit:

      Variable Type

      Editable Properties

      Variable

      Unit Type, Units, Value.

      Separator

      Name. A separator variable provides a bolded name for a blank line to facilitate grouping variables in variable lists.

      Array Index Variable

      Associate Array Variable, Value

      PostProcessingVariableUnit Type, Units, Value.
    • Unit Type – for Variables and PostProcessingVariables, use the drop-down menu to select a type from the list (for example, Charge, Density, Energy, ...).

    • Units – for Variables and PostProcessingVariables, use the drop-down menu to select a unit of measure.
    • Value – for Variables, ArrayIndexVariables, and PostProcessingVariables, enter a number, variable, or mathematical expression. The quantity entered will be the current (or default) value for the variable. If the mathematical expression includes a reference to an existing variable, this variable is treated as a dependent variable. The units for a dependent variable will automatically change to those of the independent variable on which the value depends. Additionally, dependent variables, though useful in many situations, cannot be the direct subject of optimization, sensitivity analysis, tuning, or statistical analysis.

      For ArrayIndexVariables, the index reference can be a constant (for example, 1), an index (for example, ii) or an expression (for example, ii + 1). This allows you to sweep the index and simulate for different values that are stored in the array variable itself. In particular, it also enables you to sweep different text strings. This allows you to set a property to different string values as the index is swept.

      Warning:

      If you include the variable's units in its definition (in the Value text box), do not include the variable's units when you enter the variable name for a parameter value.

    • Associate Array Variable – for ArrayIndexVariables, select an associated array from the drop-down list. You must have previously created an array.
  4. Click OK.

    The new variable appears in the list. You can sort local variables by clicking the Name column header. Clicking once sorts them in ascending order, noted by a triangle pointing up. Clicking against sorts in descending order, noted by a triangle pointing down. Clicking a third time sorts in original order, with no triangle.

  5. If desired, use the check boxes to designate a variable as Read-only, Hidden, or Sweep.
    • Read-only – when selected, the variable's name, value, unit, and description cannot be modified.
    • Hidden – hidden variables do not appear in the Properties window unless Show Hidden is selected.
    • Sweep – allows you to designate variables to include in solution indexing as a way to permit faster post-processing. Variables with the Sweep check box cleared are not used in solution indexing. If a solution exists, selecting or clearing a variable's Sweep setting produces a warning that the change will invalidate existing solutions. To continue, click OK to dismiss the warning.
  6. Click Apply to apply changes.
  7. Click OK to exit the window.

The new variable can be assigned to a parameter value in the project in which it was created. You can enable defined variables for Optimization/Design of Experiments, Tuning, Sensitivity, or Statistics. See: Optimetrics.

Importing and Exporting Variables

Once you have defined Design Variables, you can export them to a csv file, and import them to another project or design. If there are naming conflicts on import, these are flagged as errors. The Properties dialogs for Design Variables include Import... and Export... buttons.

Deleting a Local Variable

To remove a Local Variable:

  1. Access Local Variables as described above.
  2. Remove one or more variables:
    • To remove a specific variable, select it and click RemoveRemove Selected.
    • To remove all unused variables, click RemoveRemove All Unused.
    • To force the removal of all unused variables, including those in the project's undo/redo history, click RemoveForce Remove All Unused.

Editing a Local Variable

To edit a Local Variable:

  1. Access Local Variables as described above.
  2. Select the variable you want to edit and click Edit.
  3. Change the properties as desired and click OK.

Overriding a Local Variable

You can override a variable value from an analysis setup's General tab.

Select the Override check box next to the value you wish to override, and enter a new value in the Value field.

Variable Override