Defining Expressions for Transient Solutions
You can specify additional evaluation criteria through the use of expressions and output variables.
To set expressions as evaluation criteria:
- Right-click on the Analysis icon in the Project Manager tree to open the Solve Setup window.
- Click the Expression Cache tab and click the Add... button to open the Add to Expression Cache dialog box.
- Specify the Context for the expression, including Report Type, Solution, and Parameter.
- Under the Trace tab, select from the Category, Quantity, and Function lists to create expressions.
- When finished defining the expression that you want to add to the cache, click the Add Calculation button.
- When finished adding expressions, click Done to close the Add to Expression Cache dialog box.
- The Title field is editable, by default showing the name as built from the expression (with underscores removed).
- The Expression field shows the full expression. If necessary, you can resize the Solve Setup window. You can also resize each columns in the table.
- The Context
column for non-field types lists the parameter type specifying the force,
torque or matrix setup. For these types the context also can be given
as part of the expression. For example, the expression Force1.Force_x
with a context of None is equivalent
to an expression of Force_x with a context
of Force1.
For field quantities, the Context can be the geometry on which to evaluate the field quantity - a point or line. If you use a line you need to use some range function to reduce the dimensionality to a single value (or use the Calculation Range tab to specify a single point along the line). Note that, if you create a named expression in the field calculator that already evaluates to a single value, then the Context here will likely be None. - The Intrinsics
column shows a clickable button that opens an Edit
Calculation Range dialog box. If the Intrinsics
column button shows None you cannot
edit the value. If the button shows variables, click the ellipsis [...] in the Edit
column to display a list of the variable values from which you can select.
Click OK to close the Edit Calculation Range dialog box and
apply your selections to the Expression Cache.
The Intrinsics field lists the values you may have set in the Calculation Range tab when you added the expression. This is used to set the values of “other” sweeps. Usually there are no other sweeps because the values of the variables are set in the definition of each variation. In some cases you may need to specify the values of “other” sweeps. For field values with a line for the context, you can specify the (normalized) distance along the line For eddy current field quantities you can also specify the phase for the calculation. - In the Evaluation Timestep panel, set how often the solver is to output field solutions. Select Constant to output solutions at a preset time interval (e.g., every 0.1 s); or Number of solve steps to output solutions each preset number of timesteps (for example, every three timesteps).
- Optionally, buttons allow you to Edit and Remove selected expressions, and to Remove All expressions in the table.
- When finished defining expressions, click OK to close the Solve Setup window.
Selecting a listed category lists the Quantities and Functions available for each category. If you have defined one or more output variables, you can see them by selecting the Output Variables category. The Output Variables button opens a dialog box that lets you define output variables. See Specifying Output Variables.
When you have created an expression, it appears in the Expression field of the Trace tab. If desired, you can use the Range Function button to select range functions to apply to the expression.
Under the Calculation Range tab, you can view the values of available sweep variables. Clicking the ellipsis [...] button in the Edit column opens a list of values from which you can select.
This adds the selected expression and the associated context to a table in the Expression Cache tab. You can define additional expressions with contexts and add them in the same way.
The Expression Cache tab lists the expressions you have added in a table:
Speeding Up a Maxwell 2D Parametric Transient Design that Uses Expression Cache
A Optimetrics\Parametric analysis of a Maxwell 2D transient design that uses expression cache can require substantial simulation time. To cut down on simulation time for this type of analysis, use the Optimetrics Variations and Single level only HPC settings.
The following example demonstrates how to configure these settings. The Solve Setup Expression Cache tab has been configured to have several expressions:
-
Open the Optimetrics\ParametricSetup window, and click HPC and Analysis Options.
-
In the window that opens, double-click an active configuration to open the Analysis Configuration.
-
From the Machines tab, specify multiple tasks to run.
-
Click the Job Distribution tab.
-
From the Enable Distribution Types list, select Optimetrics Variations. And for Distribution, select Single level only.
-
In the Project Manager tree, right-click the Optimetrics\ParametricStudy, and select Analyze.