The Simulation Data Inspector can compare runs and individual signals. This example is a continuation of the workflow described in Inspect Simulation Data.
This example compares the
Stick input signal
to the output observed at
alpha, rad and uses the
tolerance feature in the Simulation Data Inspector to analyze the
To compare the
alpha, rad signal to the
In the Inspect pane, right-click
1 and select Compare Signals > Set as Baseline.
alpha, rad and select Compare Signals > Set as Compare
Switch to the Compare pane, and click the Compare button.
alpha, rad and
are compared from
Run 1. The comparison fails because
the signals do not match within the absolute and relative tolerances,
both specified as 0 by default.
From a visual inspection of the signals, you can see
Stick. Add a time tolerance
In the properties pane, click the Override
Global Tolerance baseline value field, and select
When the Override Global Tolerance field
is set to
yes, the tolerance values specified in
the signal properties are applied instead of the global tolerances
specified above the graphical viewing area.
0.5 into the Time
Tolerance field in the properties pane to the left of the
graphical viewing area.
The comparison automatically runs again, with the updated tolerance value.
The Simulation Data Inspector draws the tolerance band around the plotted Baseline signal and around the signed difference signal displayed in the bottom subplot.
Note: The Simulation Data Inspector operates with the most lenient interpretation of the specified tolerances. For more information on tolerances, see Tolerances in the Simulation Data Inspector.
The time tolerance covers the phase difference between the two
signals, but the comparison still does not pass due to the amplitude
difference. To add an absolute tolerance to the
0.05 into the Absolute Tolerance field
in the properties pane.
With the combination of the absolute and time tolerances, the signal comparison passes.
You can also use the Simulation Data Inspector to compare all logged signals in a model at once by comparing runs. Run comparisons provide useful information about the effects of changing model parameters. For example, change the frequency cutoff of the filter for the control stick input signal. Then, evaluate the effect on the output signal with the Simulation Data Inspector.
Click the Model Explorer button to access the Model Workspace variables.
Change the value of
Ts in the Model
Close the Model Explorer.
Simulate the model with the new filter.
In the Simulation Data Inspector, click Compare to switch to the Compare pane.
Run 2: slexAircraftExample in
the Baseline drop-down menu.
Run 3: slexAircraftExample in
the Compare To drop-down menu.
The Compare pane lists all signals from the runs with a comparison result. In this example, the comparison results of the aligned signals do not match. The signal differences are not within the acceptable specified tolerance values, all of which are set to zero.
Note: The Simulation Data Inspector only compares signals from the Baseline run that align with a signal from the Compare To run. If a signal from the Baseline run does not align with a signal from the Compare To run, the signal is listed in the Compare pane with a warning. . For more information on signal alignment, see Signal Alignment in the Simulation Data Inspector.
To plot comparison data, select the signal you want to see in
the Compare pane. Here, the top plot shows the
rad/sec signals from the Baseline and Compare
To runs. The bottom plot shows the difference between the
signals and a graphical representation of the tolerance. For information
on manipulating the plot, see Customize the Simulation Data Inspector Interface.
To qualify signals in the run comparison, you can add global
tolerances to the comparison using the global tolerance fields above
the graphical viewing area. Enter one or more desired tolerance values,
then hit the Compare button to run the comparison
again and compare the results against the tolerance values. The Simulation
Data Inspector draws the tolerance band around the Baseline signal
and on the signed difference plot on the lower half of the graphical
viewing area. To apply different tolerance values to specific signals,
set the Override Global Tolerance property to
specify the desired tolerance values in the signal properties.