Defining a Project Variable

A project variable can be assigned to a parameter value in the Twin Builder project in which it was created. Twin Builder differentiates project variables from other types of variables by prefixing the variable name with the $ symbol. You can manually include the $ symbol in the project variable’s name when you create it, or Twin Builder will append the project variable’s name with the symbol after you define the variable.

  1. On the Project menu, click Project Variables.

The Properties dialog box appears, containing three tabs: Project Variables, Intrinsic Variables, and Constants.

Note:

The Intrinsic Variables and Constants tabs provide non-editable reference listings of Twin Builder’s predefined internal variables and constants.

  1. Under the Project Variables tab, click Add. The Add Property dialog box appears.
  1. In the Name text box, type the name of the variable.
    Note:
    • Project variable names must start with the $ symbol followed by a letter. Variable names may include only alphanumeric characters and underscores ( _ ).
    • Names of reserved variables, reserved (intrinsic) functions and pre-defined constants cannot be used as variable names.
    • Twin Builder prepends the $ symbol to each project variable name you specify. The $ symbol becomes an essential part of the project variable name and must be included whenever you specify an existing project variable as a parameter value.
    • In netlists, the $ prefix is changed to Pjt_. For example, project variable $RNom appears as Pjt_RNom in the netlist.
  2. In the Unit Type text box, use the drop-down list to select from the available unit types. None is the default.

When you select a unit type, the choices in the Units drop-down list adapt to that unit type. For example, selecting Length as the unit type causes the Unit menu to show a range of metric and English units for length. Similarly, if you select the Resistance unit type, the Units drop-down list shows a range of standard Ohm units.

  1. In the Value text box, type the quantity that the variable represents. Optionally, include the units of measurement.
    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.

The quantity can be a numerical value, a mathematical expression, or a mathematical function. The quantity entered is the current, (or default) value for the variable. If the mathematical expression includes a reference to an existing variable, the system treats this variable as a dependent variable. The units for a dependent variable 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/Design of Experiments, sensitivity analysis, tuning, or statistical analysis.

  1. Click OK to return to the Properties dialog box.

    The new variable and its value appear in the table. If the value is an expression, the evaluated value displays. Updating the expression also changes the evaluated value display.

  1. Optionally, type a description of the variable in the Description text box.
  2. Optionally, select Read Only. The variable’s name, value, unit, and description cannot be modified when Read Only is selected.
  3. Optionally, select Hidden. If you clear the Show Hidden option, the hidden variable will not appear in the Properties dialog box.

The new variable can now be assigned to a parameter value in the project in which it was created.

Related Topics 

Viewing and Editing Project Variables

Deleting Project Variables

Add/Edit Property Dialog Boxes