Adding a Project Variable Array
You can define array variables that contain numbers or strings. Number array variables can be used in component property expressions, while string array variables can be used in certain component property values.
Text array variables can be used in certain component property values, but not all, and cannot be combined with operators to form more complex expressions.
The index for a text array variable reference can either be a constant (1) or can be an index (ii) or even an expression (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. The following are properties that currently allow text array variables:
- V_PRBS
- V_PRBS_JITTER
- V_PRBSD
- V_PRBSG_JITTER
- V_PSK
- V_QAM
- V_CPM
To define an array variable, you must first define a Project Variable Array:
- Access Project Variables one of three ways:
- Click Project > Project Variables.
- Right-click the project name in the Project Tree and select Project Variables.
- 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 Project Variables
The Properties window appears, on the Project Variables tab.
- Click Add Array.
The Add Array window appears.
The value grid displays each array item's Index number, and the Data associated with that index number.
- Give the variable array a Name, and select a Unit Type and Unit from the drop-down menus.
- Use the control buttons to add, delete, and reposition rows in the
value grid at left. The default is Edit in grid, but you may select
Edit in plain text field.
Note:
Quotation marks (“ ”) are required as delimeters when array values are entered in either the grid or text field.
- When you have finished entering values, click OK.
The array appears in the Project Variables list.
You can add a variable to the array by adding an ArrayIndexVariable on the Project Variables tab.
- Access Project Variables one of three ways:
- Click Project > Project Variables.
- Right-click the project name in the Project Tree and select Project Variables.
- From the Setup Optimization dialog box, click Edit Variables > Edit Project Variables.
The Properties window appears, on the Project Variables tab.
- From the Project Variables tab, click Add.
The Add Property dialog box appears.
- Enter information for the variable, as applicable:
- Name – project variable names must start with the dollar sign symbol ($), followed by a letter. The name can contain alphanumeric characters and underscores (_). You cannot use the names of Intrinsic Variables or pre-defined Constants.
- Variable Type – select ArrayIndexVariable.
- Value – 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.
- Click OK.