A project variable can be assigned to a parameter value in the Maxwell project in which it was created. Maxwell differentiates project variables from other types of variables by prefixing the variable name with the following symbol: $. You can manually include the $ symbol in the project variable's name when you create it, or Maxwell automatically appends the project variable's name with the symbol after you define the variable. Project variables can be used in any design within the project.

  1. Click Project > Project Variables.
  2. Alternatively, right-click the project name in the Project Manager tree, and then click Project Variables on the shortcut menu.

    You can also access the Project variables from a menu in the lower left corner of the following Optimization windows: Parametric, Optimization, Sensitivity, Statistical, Design of Experiments, and Design Xplorer Setup. Click Edit Variables and from the menu select Edit Project Variables.

    The Properties window appears.

  3. Under the Project Variables tab, click Add.
  4. The Add Property window appears.

  5. In the Name box, type the name of the variable.
  6. Project variable names must start with the $ symbol followed by a letter. Variable names may include alphanumeric characters and underscores ( _ ). The names of intrinsic functions and the predefined constant pi (p) cannot be used as variable names.

    You can sort the project variables by clicking on the Name column header. By default, variables are sorted in original order. Clicking once sorts them in ascending order, noted by a triangle pointing up. Clicking again sorts in descending order, noted by a triangle pointing down. Clicking a third time sorts in original order, with no triangle.

  7. Select a radio button for the variable use:

    Selected Use

    Setable Properties

    Variable

    Unit Type, Units, Value.

    Separator

    Value

    Array Index Variable

    Associate Array variable, Value


  8. Each selection affects the settable options.

  9. For Project Variables in the Unit Type text box, you can use the drop-down menu to select from the list of available unit types. None is the default.
  10. When you select a unit type, the choices in drop-down menu for the Units text box adapt to that unit type. For example, selecting Length as the unit type causes the Unit menu to show a range of metric and US units for length. Similarly, if you select the Resistance unit type, the Units drop-down menu lists a range of standard Ohm units.

  11. In the Value text box, type the quantity that the variable represents. If you did not specify the unit type and the unit, you can also 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.
  12. The quantity can be a numerical value, a mathematical expression, or a mathematical function. 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.

  13. Click OK.
  14. You return to the Properties window. The new variable and its value are listed in the table. If the value is an expression, the evaluated value is shown. Updating the expression also changes the evaluated value display. The evaluated values of any dependent variables also are changed.

    Properties window with variable defined with an expression and its evaluated value.
  15. Optionally, type a description of the variable in the Description box.
  16. Optionally, select Read-Only. The variable's name, value, unit, and description cannot be modified when Read-only is selected.
  17. Optionally, select Hidden. If you clear the Show Hidden option, the hidden variable does not appear in the Properties window.
  18. You can also designate a variable as part of a sweep. You may need to use the scroll bar or resize the dialog to view the check boxes.
  19. Properties window with variable defined as a sweep

    The Sweep check box lets you designate variables to include in solution indexing as a way to permit faster postprocessing. Variables with Sweep unchecked are not used in solution indexing. If a solution exists, checking or unchecking a variable’s Sweep setting produces a warning that the change will invalidate existing solutions. To continue, click OK to dismiss the warning dialog.

    If a variable has dependent variables, the Sweep check box is disabled and cannot be changed.

    Properties window for a dependent variable shows Sweep check box disabled
  20. Click OK.

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

Related Topics 

Adding a Design Variable

Deleting Project Variables

Defining an Expression

Defining Mathematical Functions

Exporting Variables for Documentation