Creating an Adams View Computed Measure
Adams View computed measures allow you to create
measures in the Adams View
Expression language that can be evaluated before a
Simulation or any time after. You build them using
Design-Time Functions and typically use them in the initial model set up.
An Adams View computed measure is convenient because it can reference any Adams View variable. For example, if you create two measures and you want to add or subtract them, you can use an Adams View computed measure to do so. You can also compute data from a run-time measure. Sometimes during a simulation, computed measures referencing run-time measures may generate errors similar to "Matrices must be of same shape to apply...". These errors are the result of the order of expression evaluation when a run-time measure that is an operand of an expression has been updated before a run-time measure used in another operand. The errors can safely be ignored. To avoid the errors, change the order in which the measures are created. Run-time measures should be created before any computed measures and ordered so that any dependent computed measures evaluate in the proper order.
For example, consider a model containing two run-rime measures and two computed measures:
measure create point measure_name=runtime_1...
measure create point measure_name=runtime_2...
measure create computed measure_name=comp_1 text_of_expr="runtime_2"
measure create computed measure_name=comp_2 text_of_expr="runtime_1 + comp_1"
When results are processed, computed measures dependent on runtime_1 (comp_2) are evaluated first. However, comp_1, the other operand in comp_2 has not been updated yet. This generates the "Matrix..." error since the two operands ore different sized arrays.
Creating runtime_1 after runtime_2 causes comp_1 to be updated first, before evaluating comp_2, eliminating the error.
Caution: | Making changes in your model can cause a potential problem because model changes can invalidate the accuracy of any measure that depends on the results of a simulation. The simulation redefines the model data and re-evaluates your Adams View computed measures. |
Learn more:
To create an Adams View computed measure:
1. Click the
Design Exploration tab. From the
Measures container, click the
Computed tool

.
or
(Classic interface) From the Build menu, point to Measure, point to Computed, and then select New.
The Function Builder dialog box appears in computed-measure mode.
Example of Function Builder in Computed Measure Mode.
2. Build your expression using the functions and object data and format the
Strip chart using the options in the Attributes area.
3. Select OK.