---
title: "SystemModelUncertaintyPlot"
language: "en"
type: "Symbol"
summary: "SystemModelUncertaintyPlot[sys, spec] plots the uncertainty in outputs in the system model sys from uncertainty in inputs according to spec."
keywords: 
- model verification
- model validation
- digital twin
- Monte Carlo simulation
canonical_url: "https://reference.wolfram.com/language/ref/SystemModelUncertaintyPlot.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "System Model Simulation"
    link: "https://reference.wolfram.com/language/guide/SystemModelSimulation.en.md"
related_functions: 
  - 
    title: "SystemModelCalibrate"
    link: "https://reference.wolfram.com/language/ref/SystemModelCalibrate.en.md"
  - 
    title: "SystemModelSimulate"
    link: "https://reference.wolfram.com/language/ref/SystemModelSimulate.en.md"
  - 
    title: "SystemModelMeasurements"
    link: "https://reference.wolfram.com/language/ref/SystemModelMeasurements.en.md"
  - 
    title: "SystemModel"
    link: "https://reference.wolfram.com/language/ref/SystemModel.en.md"
  - 
    title: "SystemModelExamples"
    link: "https://reference.wolfram.com/language/ref/SystemModelExamples.en.md"
related_tutorials: 
  - 
    title: "Getting Started with Model Simulation and Analysis"
    link: "https://reference.wolfram.com/language/tutorial/GettingStartedWithModelSimulationAndAnalysis.en.md"
  - 
    title: "Numerical Operations on Data"
    link: "https://reference.wolfram.com/language/tutorial/NumericalOperationsOnData.en.md"
---
[EXPERIMENTAL]

# SystemModelUncertaintyPlot
⚠ *Unsupported in Cloud*
*New in 14*

SystemModelUncertaintyPlot[sys, spec] plots the uncertainty in outputs in the system model sys from uncertainty in inputs according to spec.

## Details and Options

* ``SystemModelUncertaintyPlot`` is typically used to visualize the uncertainty of key signals in a system model resulting from uncertainty in parameters, initial values or inputs. This allows for graphical validation of the impact of uncertainties.

[image]

* Given the uncertain parameters, initial values and inputs, the system is simulated a large number of times and a slice function is applied at every point in time to compute aggregate statistics. By default, quantiles are used as a slice function.

[image]

* The system model ``sys`` can have the following forms:

|                             |                             |
| --------------------------- | --------------------------- |
| SystemModel[…]              | general system model        |
| StateSpaceModel[…]          | state-space model           |
| TransferFunctionModel[…]    | transfer function model     |
| AffineStateSpaceModel[…]    | affine state-space model    |
| NonlinearStateSpaceModel[…] | nonlinear state-space model |
| DiscreteInputOutputModel[…] | discrete input-output model |

* ``spec`` is an ``Association`` that allows the following keys:

|                      |                 |                                          |
| -------------------- | --------------- | ---------------------------------------- |
| "InitialValues"      | {v1 -> val1, …}  | variable vi has initial value vali       |
| "Inputs"             | {in1 -> fun1, …} | input ini has value funi                 |
| "Outputs"            | {v1, …}         | variables to plot                        |
| "ParameterValues"    | {p1 -> val1, …}  | parameter pi has value vali              |
| "SimulationCount"    | 200             | target number of simulations             |
| "SimulationInterval" | {tmin, tmax}    | simulate and plot from time tmin to tmax |
| "SliceFunction"      | sfun            | function to compute for each time slice  |

* When multiple sources of uncertainty are provided, simulations are performed covering their combinations, using the target number of simulations as an upper bound.

* The values ``vali`` in ``"ParameterValues"`` and ``"InitialValues"`` can take the following forms:

|            |                                                   |
| ---------- | ------------------------------------------------- |
| pval       | a single value                                    |
| {pval1, …} | custom list of values randomly sampled            |
| int        | an Interval or CenteredInterval uniformly sampled |
| dist       | an Around or a distribution to sample             |
| reg        | a region to sample uniformly                      |

* Multidimensional regions and distributions ``vald`` for sets of ``d`` variables can be set with ``{v1, …, vd} -> vald``.

* The inputs ``funi`` in ``"Inputs"`` can take the following forms:

|         |                                             |
| ------- | ------------------------------------------- |
| f       | a single function f[t] at time t            |
| {f1, …} | a custom list of functions randomly sampled |
| rproc   | a random process to sample                  |

* Vector-valued functions and processes ``fund`` for sets of ``d`` inputs can be set with ``{in1, …, ind} -> fund``.

* The slice function ``sfun`` can take the following forms:

|                          |                                                  |
| ------------------------ | ------------------------------------------------ |
| "MinMax"                 | min and max                                      |
| "Quantiles"              | quantiles 0%, 25%, 50%, 75%, 100%                |
| {"Quantiles", {q1, …}}   | quantiles {q1, …}                                |
| "Confidence"             | mean and 95% confidence bands                    |
| {"Confidence", {cl1, …}} | confidence bands with confidence levels {cl1, …} |
| {sfun1, …}               | list of custom scalar-valued functions           |

* ``SystemModelUncertaintyPlot`` has the same options as ``ListLinePlot``, with the following additions and changes: []

|                    |                     |                                         |
| ------------------ | ------------------- | --------------------------------------- |
| AxesLabel          | Automatic           | indicate units on the axis              |
| Filling            | Automatic           | filling to insert under each curve      |
| FrameLabel         | Automatic           | frame labels                            |
| Method             | Automatic           | what simulation and plot methods to use |
| PlotLabel          | Automatic           | overall label for the plot              |
| PlotLayout         | Automatic           | how to position data                    |
| PlotLegends        | Automatic           | legends for curves                      |
| ProgressReporting  | \$ProgressReporting | control display of progress             |
| SamplingPeriod     | Automatic           | sample period for random processes      |
| TargetUnits        | Automatic           | units to display in the plot            |

* Method settings take the form Method -> <\|"Subscript[sub, 1]"->Subscript[val, 1],\[Ellipsis]\|>.

* Method suboptions "Subscript[sub, i]" include:

|                    |           |                   |
| ------------------ | --------- | ----------------- |
| "PlotMethod"       | Automatic | plot method       |
| "SimulationMethod" | Automatic | simulation method |

* ``"PlotMethod"`` settings are the same as the ``Method`` settings in ``ListLinePlot``.

* ``"SimulationMethod"`` settings are the same as the ``Method`` settings in ``SystemModelSimulate``.

* ``SystemModelUncertaintyPlot`` uses the output as a plot label in the default ``PlotLayout``.

* With ``PlotLayout -> "Association"``, ``SystemModelUncertaintyPlot`` gives an ``Association`` with the output as the key and its corresponding plot as the value for each requested variable.

* Possible settings for ``TargetUnits`` include:

|               |                                         |
| ------------- | --------------------------------------- |
| None          | no unit                                 |
| "Unit"        | unit defined in model                   |
| "DisplayUnit" | display unit defined in model (default) |
| unit          | explicit unit                           |
| {unitt, unit} | units for time and data                 |

* Models with ``"Epoch"`` in their simulation settings trigger the use of ``DateScale``.

### List of all options

|                        |                     |                                                                                    |
| ---------------------- | ------------------- | ---------------------------------------------------------------------------------- |
| AlignmentPoint         | Center              | the default point in the graphic to align with                                     |
| AspectRatio            | 1 / GoldenRatio     | ratio of height to width                                                           |
| Axes                   | True                | whether to draw axes                                                               |
| AxesLabel              | Automatic           | indicate units on the axis                                                         |
| AxesOrigin             | Automatic           | where axes should cross                                                            |
| AxesStyle              | {}                  | style specifications for the axes                                                  |
| Background             | None                | background color for the plot                                                      |
| BaselinePosition       | Automatic           | how to align with a surrounding text baseline                                      |
| BaseStyle              | {}                  | base style specifications for the graphic                                          |
| ClippingStyle          | None                | what to draw when lines are clipped                                                |
| ColorFunction          | Automatic           | how to determine the coloring of lines                                             |
| ColorFunctionScaling   | True                | whether to scale arguments to ColorFunction                                        |
| ContentSelectable      | Automatic           | whether to allow contents to be selected                                           |
| CoordinatesToolOptions | Automatic           | detailed behavior of the coordinates tool                                          |
| DataRange              | Automatic           | the range of x values to assume for data                                           |
| Epilog                 | {}                  | primitives rendered after the main plot                                            |
| Filling                | Automatic           | filling to insert under each curve                                                 |
| FillingStyle           | Automatic           | style to use for filling                                                           |
| FormatType             | TraditionalForm     | the default format type for text                                                   |
| Frame                  | False               | whether to put a frame around the plot                                             |
| FrameLabel             | Automatic           | frame labels                                                                       |
| FrameStyle             | {}                  | style specifications for the frame                                                 |
| FrameTicks             | Automatic           | frame ticks                                                                        |
| FrameTicksStyle        | {}                  | style specifications for frame ticks                                               |
| GridLines              | None                | grid lines to draw                                                                 |
| GridLinesStyle         | {}                  | style specifications for grid lines                                                |
| ImageMargins           | 0.                  | the margins to leave around the graphic                                            |
| ImagePadding           | All                 | what extra padding to allow for labels etc.                                        |
| ImageSize              | Automatic           | the absolute size at which to render the graphic                                   |
| InterpolationOrder     | None                | the polynomial degree of curves used in joining data points                        |
| IntervalMarkers        | Automatic           | how to render uncertainty                                                          |
| IntervalMarkersStyle   | Automatic           | style for uncertainty elements                                                     |
| LabelingFunction       | Automatic           | how to label points                                                                |
| LabelingSize           | Automatic           | maximum size of callouts and labels                                                |
| LabelStyle             | {}                  | style specifications for labels                                                    |
| MaxPlotPoints          | Infinity            | the maximum number of points to include                                            |
| Mesh                   | None                | how many mesh points to draw on each line                                          |
| MeshFunctions          | {#1&}               | how to determine the placement of mesh points                                      |
| MeshShading            | None                | how to shade regions between mesh points                                           |
| MeshStyle              | Automatic           | the style for mesh points                                                          |
| Method                 | Automatic           | what simulation and plot methods to use                                            |
| MultiaxisArrangement   | None                | how to arrange multiple axes for data                                              |
| PerformanceGoal        | \$PerformanceGoal   | aspects of performance to try to optimize                                          |
| PlotHighlighting       | Automatic           | highlighting effect for points                                                     |
| PlotLabel              | Automatic           | overall label for the plot                                                         |
| PlotLabels             | None                | labels for data                                                                    |
| PlotLayout             | Automatic           | how to position data                                                               |
| PlotLegends            | Automatic           | legends for curves                                                                 |
| PlotMarkers            | None                | markers to use to indicate each point                                              |
| PlotRange              | Automatic           | range of values to include                                                         |
| PlotRangeClipping      | True                | whether to clip at the plot range                                                  |
| PlotRangePadding       | Automatic           | how much to pad the range of values                                                |
| PlotRegion             | Automatic           | the final display region to be filled                                              |
| PlotStyle              | Automatic           | graphics directives to determine the style of each line                            |
| PlotTheme              | \$PlotTheme         | overall theme for the plot                                                         |
| PreserveImageOptions   | Automatic           | whether to preserve image options when displaying new versions of the same graphic |
| ProgressReporting      | \$ProgressReporting | control display of progress                                                        |
| Prolog                 | {}                  | primitives rendered before the main plot                                           |
| RotateLabel            | True                | whether to rotate y labels on the frame                                            |
| SamplingPeriod         | Automatic           | sample period for random processes                                                 |
| ScalingFunctions       | None                | how to scale individual coordinates                                                |
| TargetUnits            | Automatic           | units to display in the plot                                                       |
| Ticks                  | Automatic           | axes ticks                                                                         |
| TicksStyle             | {}                  | style specifications for axes ticks                                                |

---

## Examples (45)

### Basic Examples (1)

Plot the uncertainty in the voltage of a capacitor in an RC circuit when the resistance takes values in a given interval:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"ParameterValues" -> {"R" -> Quantity[Interval[{2, 7}], "Milliohms"]}|>]

Out[1]= [image]
```

### Scope (20)

#### Models (4)

Plot uncertainty in two variables of a ``SystemModel`` :

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x", "y"}, "ParameterValues" -> {"theta" -> Interval[{0, π}]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot the uncertainty in the output of an ``AffineStateSpaceModel`` :

```wl
In[1]:=
SystemModelUncertaintyPlot[AffineStateSpaceModel[{{Cos[x2], Rational[-1, 10]*x2 - 
    Cos[x1^2]}, {{0}, {1}}, {x2}, {{0}}}, 
 {x1, x2}, Automatic, {Automatic}, Automatic, SamplingPeriod -> None], <|"InitialValues" -> {x1 -> Interval[{1, 2}]}, "SimulationInterval" -> 3|>]

Out[1]= [image]
```

---

Plot the uncertainty in the output of a ``NonlinearStateSpaceModel`` :

```wl
In[1]:=
SystemModelUncertaintyPlot[NonlinearStateSpaceModel[
 {{Cos[x] + 4*a*Sin[Rational[1, 2]*x]}, 
  {x + Sin[x]}}, {x}, {}, {Automatic}, Automatic, 
 SamplingPeriod -> None], <|"ParameterValues" -> {a -> Interval[{1, 10}]}|>]

Out[1]= [image]
```

---

Plot the uncertainty in the output of a ``DiscreteInputOutputModel`` :

```wl
In[1]:=
diom = DiscreteInputOutputModel[Association["SampledSeries" -> TemporalData[TimeSeries, 
    {{{{u[0] + y[-2] + a*y[-1]}, {u[-1] + u[0] + u[1]}}}, {{0, 1, 1}}, 1, {"Discrete", 1}, 
     {"Discrete", 1}, {1}, {MissingDataMethod -> None, ResamplingMethod -> ... ime", "LastValue", "OutputCount", "OutputVariables", "Path", 
  "PathComponent", "PathComponents", "PathFunction", "PathLength", "SamplingPeriod", "StateCount", 
  "TemporalData", "TimePath", "Times", "TimeSeries", "TimeValues", "Type", "Values"}];
```

Use a ``SquareWave`` input:

```wl
In[2]:= SystemModelUncertaintyPlot[diom, <|"ParameterValues" -> {a -> Interval[{0.1, 1}]}, "Inputs" -> {1 -> SquareWave}|>, PlotRange -> All]

Out[2]= [image]
```

#### Specification (4)

Plot the uncertainty for a specific output:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, π}]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot the uncertainty in a model using a custom number of simulations:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"SimulationCount" -> 5, "Outputs" -> {"x", "y"}, "ParameterValues" -> {"theta" -> Interval[{0, π}]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot the uncertainty for a specific output using a custom simulation interval:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "SimulationInterval" -> {0, 3}, "ParameterValues" -> {"theta" -> Interval[{0, π}]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Models with ``"Epoch"`` in their simulation settings are plotted as values at a sequence of dates:

```wl
In[1]:= model = SystemModel[[image], <|"ModelName" -> "MyModel", "SimulationSettings" -> {"Epoch" -> Now, "StopTime" -> Quantity[3, "Hours"]}|>]

Out[1]= [image]
```

Plot the model:

```wl
In[2]:= SystemModelUncertaintyPlot[model, <|"Outputs" -> {"room.temperature.T"}, "ParameterValues" -> {"room.roomInertia.C" -> Range[70000, 90000, 5000]}|>]

Out[2]= [image]
```

#### Uncertainty in Values (5)

Plot the uncertainty generated from giving a list of values for a parameter:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Range[0, 1 / 2, 1 / 200]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot the uncertainty generated from sampling an interval for a parameter value:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot the uncertainty generated from sampling a distribution for a parameter value:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> NormalDistribution[2, 0.1]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot the uncertainty generated from sampling a geometric region for a parameter value:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> MeshRegion[{{0}, {1}, {2}}, Line[{1, 2, 3}]]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot the uncertainty generated from sampling a ``Circle`` for two initial values:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x", "y"}, "InitialValues" -> {{"x", "y"} -> Circle[]}|>, PlotRange -> All]

Out[1]= [image]
```

#### Uncertainty in Inputs (3)

Plot the uncertainty generated when an ``ARIMAProcess`` is used for an input:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"SimulationInterval" -> {0, 10}, "Outputs" -> {"syse.sys.rs"}, "Inputs" -> {"T" -> ARIMAProcess[{-.01}, 1, {.01}, 10^-6]}|>, PlotRange -> All, TargetUnits -> "Millimeters"]

Out[1]= [image]
```

---

Plot the uncertainty generated when several functions are used as input:

```wl
In[1]:= inputs = Table[With[{k = k}, Function[t, 0.1(k Tanh[t] + 0.1k Sin[0.15t])]], {k, 1, 10}];

In[2]:= Plot[Through[inputs[x]], {x, 0, 60}]

Out[2]= [image]
```

Use these profiles for the input flow rate in a continuous stirred tank reactor:

```wl
In[3]:= SystemModelUncertaintyPlot[[image], <|"Inputs" -> {"deltaFJ" -> inputs}|>, PlotRange -> All]

Out[3]= [image]
```

---

Plot the uncertainty generated when using a two-dimensional process for two inputs:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"w"}, "Inputs" -> {{"V", "TL"} -> MAProcess[{{{.2, .1}, {-.1, .2}}}, {{0.001, 0}, {0, 0.001}}]}|>, PlotRange -> All]

Out[1]= [image]
```

#### Slice Function (4)

Plot the range between the minimum and maximum of the temporal data:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}, "SliceFunction" -> "MinMax"|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot custom quantiles of the temporal data:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}, "SliceFunction" -> {"Quantiles", {0, 0.45, 0.5, 0.55, 1}}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot confidence bands for the temporal data with custom confidence levels:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}, "SliceFunction" -> {"Confidence", {0.95, 0.98, 0.99}}|>, PlotRange -> All]

Out[1]= [image]
```

---

Plot a custom slice function:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}, "SliceFunction" -> {Mean[#] - StandardDeviation[#]&, Mean, Mean[#] + StandardDeviation[#]&}|>, PlotRange -> All, PlotLegends -> {μ - σ, μ, μ + σ}]

Out[1]= [image]
```

### Options (17)

#### AxesLabel (2)

``AxesLabel`` is set to ``None`` by default in the default ``PlotLayout`` :

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All, Frame -> False, Axes -> True]

Out[1]= [image]
```

---

Set custom labels:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All, AxesLabel -> {"time", "position"}, Frame -> False, Axes -> True]

Out[1]= [image]
```

#### Filling (2)

Known slice functions use a customized ``Filling`` by default:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Set a custom filling:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All, Filling -> {1 -> {5}}]

Out[1]= [image]
```

#### FrameLabel (2)

The units of the plotted variables are used as the ``FrameLabel`` by default:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All]

Out[1]= [image]
```

---

Set custom labels:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, FrameLabel -> {"time", "position"}, PlotRange -> All]

Out[1]= [image]
```

#### Method (1)

Set a custom simulation method with ``Method`` :

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, Method -> <|"SimulationMethod" -> {"InterpolationPoints" -> 10}|>, PlotRange -> All]

Out[1]= [image]
```

#### PlotLabel (1)

Set a custom plot label:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x", "y"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All, PlotLabel -> {"Position: x", "Position: y"}]

Out[1]= [image]
```

#### PlotLayout (2)

Obtain an ``Association`` with individual plots for each output:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x", "vy"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All, PlotLayout -> "Association"]

Out[1]= [image]
```

---

Merge individual plots:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x", "vy"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All, PlotLayout -> "Shared"]

Out[1]= [image]
```

#### PlotLegends (2)

Known slice functions use customized ``PlotLegends`` by default:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}, "SliceFunction" -> {"Quantiles", {0, 0.45, 0.5, 0.55, 1}}|>, PlotRange -> All]

Out[1]= [image]
```

---

Set a custom plot legend:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}, "SliceFunction" -> {"Quantiles", {0, 0.45, 0.5, 0.55, 1}}|>, PlotLegends -> {None, None, "Median", None, None}]

Out[1]= [image]
```

#### ProgressReporting (1)

Control progress reporting with ``ProgressReporting`` :

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All, ProgressReporting -> False]

Out[1]= [image]
```

#### SamplingPeriod (1)

Set a custom sampling period when sampling a random process:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"SimulationInterval" -> {0, 10}, "Outputs" -> {"syse.sys.rs"}, "Inputs" -> {"T" -> ARIMAProcess[{-.01}, 1, {.01}, 10^-6]}|>, PlotRange -> All, TargetUnits -> "mm", SamplingPeriod -> 5]

Out[1]= [image]
```

#### ScalingFunctions (2)

Plot the model with log-scaled values using ``ScalingFunctions`` :

```wl
In[1]:=
SystemModelUncertaintyPlot[AffineStateSpaceModel[{{x1, 2*x1}, {{}}}, 
 {{x1, 1}, {x2, 1}}], <|"Outputs" -> {x1, x2}, "InitialValues" -> {x1 -> {1, 10, 100, 1000}}|>, ScalingFunctions -> "Log"]

Out[1]= [image]
```

---

Models with ``"Epoch"`` in its simulation settings are plotted as values at a sequence of dates:

```wl
In[1]:= model = SystemModel[[image], <|"ModelName" -> "MyModel", "SimulationSettings" -> {"Epoch" -> Now}|>]

Out[1]= [image]
```

Plot the model:

```wl
In[2]:= SystemModelUncertaintyPlot[model, <|"Outputs" -> {"H"}, "ParameterValues" -> {"k" -> Range[100, 130, 5]}|>]

Out[2]= [image]
```

Use ``ScalingFunctions -> {None, Automatic}`` to produce simulation time plots instead:

```wl
In[3]:= SystemModelUncertaintyPlot[model, <|"Outputs" -> {"H"}, "ParameterValues" -> {"k" -> Range[100, 130, 5]}|>, ScalingFunctions -> {None, Automatic}, TargetUnits -> {"Years", Automatic}]

Out[3]= [image]
```

Use ``DateTicksFormat`` to format for date tick labels:

```wl
In[4]:= SystemModelUncertaintyPlot[model, <|"Outputs" -> {"H"}, "ParameterValues" -> {"k" -> Range[100, 130, 5]}|>, ScalingFunctions -> {DateScale[DateTicksFormat -> "YearShort"], Automatic}]

Out[4]= [image]
```

#### TargetUnits (1)

Set custom units with ``TargetUnits`` :

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> {"x"}, "ParameterValues" -> {"theta" -> Interval[{0, 2π}]}|>, PlotRange -> All, TargetUnits -> {"Seconds", "Decimeters"}]

Out[1]= [image]
```

### Applications (4)

#### Trajectories Near Equilibrium (1)

Plot the uncertainty in the angle and angular velocity of a simple damped pendulum when the initial conditions take values near equilibrium points:

```wl
In[1]:= model = CreateSystemModel["DampedPendulum", {ω'[t] == -g Sin[θ[t]] / l - b ω[t], θ'[t] == ω[t]}, t, {θ∈"Units.SI.Angle"}, <|"ParameterValues" -> {g -> 10, l -> 1 / 2, b -> 2}|>]

Out[1]= [image]
```

When the system starts at rest at small angles, it evolves toward the stable ground position:

```wl
In[2]:= SystemModelUncertaintyPlot[model, <|"SimulationInterval" -> 5, "Outputs" -> θ, "InitialValues" -> {θ -> CenteredInterval[0, π / 4]}|>, ...]

Out[2]= [image]
```

When the system starts near the unstable fully inverted position, it also evolves toward the ground position:

```wl
In[3]:= SystemModelUncertaintyPlot[model, <|"SimulationInterval" -> 5, "Outputs" -> θ, "InitialValues" -> {θ -> Interval[{3π / 4, π - π / 100}]}|>, ...]

Out[3]= [image]
```

Plot a few randomly chosen trajectories:

```wl
In[4]:= SystemModelUncertaintyPlot[model, <|"SimulationInterval" -> 5, "Outputs" -> θ, "InitialValues" -> {θ -> Interval[{3π / 4, π - π / 100}]}, "SliceFunction" -> Table[With[{k = k}, Part[#, k]&], {k, RandomSample[Range[200], 20]}]|>, ...]

Out[4]= [image]
```

#### System Tolerance (1)

The performance of a circuit depends heavily on its components and parameter tolerances. When the resistance of one of the components in this model of a speaker follows a truncated normal distribution, the variation in the current going through the speaker can be measurable:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> "speaker.l.i", "SimulationInterval" -> Quantity[40, "Milliseconds"], "ParameterValues" -> {"r1.R" -> TruncatedDistribution[{0, ∞}, NormalDistribution[6, 5]]}|>]

Out[1]= [image]
```

External disturbances can also affect the performance of a circuit. For instance, the input voltage of the speaker can be affected by high-frequency signals:

```wl
In[2]:= inputs = Table[With[{k = k}, Function[{t}, 2.5Sin[2 π t 50] + k Sin[2 π t 2000]]], {k, 0, 0.6, 0.05}];

In[3]:= Plot[Through[inputs[t]], {t, 0, 0.01}]

Out[3]= [image]
```

Plot the uncertainty in the current of the speaker when affected by these high-frequency disturbances:

```wl
In[4]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> "speaker.l.i", "SimulationInterval" -> Quantity[10, "Milliseconds"], "Inputs" -> {"vi" -> inputs}|>, TargetUnits -> {"Milliseconds", "Milliamperes"}]

Out[4]= [image]
```

#### Validation of Controlled Systems (1)

Validate a controlled ball and beam system by placing the ball away from the stable position:

[image]

The system model:

```wl
In[1]:= model = [image];
```

The farther away the ball starts from the equilibrium point, the more the system will struggle bringing it back to the stable position:

```wl
In[2]:= spec = <|"SimulationInterval" -> {0, 1.2}, "InitialValues" -> {"syse.sys.ballAndBeamDynamics.rs" -> Interval[{0, 0.15}]}|>;

In[3]:= SystemModelUncertaintyPlot[model, Append[spec, "Outputs" -> {"syse.sys.ballAndBeamDynamics.rs"}], PlotRange -> All, PlotLabel -> "r"]

Out[3]= [image]
```

The control effort peaks at the start and then later a few more times to stop the ball from overshooting the stable position:

```wl
In[4]:= SystemModelUncertaintyPlot[model, Append[spec, "Outputs" -> {"syse.sys.T"}], PlotRange -> All, PlotLabel -> "Control effort"]

Out[4]= [image]
```

Controlled systems should also be validated against external disturbances. Stress the controlled ball and beam system with a white noise torque disturbance and plot the control effort as the system experiences various sampling periods of the noise:

```wl
In[5]:= SystemModelUncertaintyPlot[model, <|"SimulationInterval" -> {0, 1.2}, "Outputs" -> {"syse.sys.T"}, "Inputs" -> {"T" -> WhiteNoiseProcess[0.1]}|>, SamplingPeriod -> 0.3, PlotRange -> All, PlotLabel -> "Control effort"]

Out[5]= [image]
```

#### Orbital Maneuver (1)

Study the effect of a short-time tangential boost on a toy spacecraft in a circular orbit:

```wl
In[1]:= model = ConnectSystemModelComponents["BoostModel", {"orbit"∈"Control.CircularOrbit", "zero"∈"Blocks.Sources.Constant", "boost"∈"Blocks.Sources.Pulse"}, {"orbit.fr"\[UndirectedEdge]"zero.y", "orbit.fphi"\[UndirectedEdge]"boost.y"}, IconizedObject[«model settings»]]

Out[1]= [image]
```

Boosts of large magnitude can lead to unbounded trajectories:

```wl
In[2]:= sim = SystemModelSimulate[model, {"orbit.x", "orbit.y"}, Quantity[8, "Hours"], <|"ParameterValues" -> {"boost.amplitude" -> {0, 600, 700, 800, 900, 1000}}|>];

In[3]:= SystemModelPlot[sim, PlotLegends -> None, Axes -> False, Frame -> True]

Out[3]= [image]
```

Bounded or unbounded trajectories can unfold if the magnitude of the boost follows a normal distribution. Plot the uncertainty in the distance to the center of force:

```wl
In[4]:= SystemModelUncertaintyPlot[model, <|"Outputs" -> {"orbit.r"}, "ParameterValues" -> {"boost.amplitude" -> NormalDistribution[600, 100]}|>]

Out[4]= [image]
```

### Properties & Relations (2)

Use ``SystemModelPlot`` to plot individual curves:

```wl
In[1]:= model = [image];

In[2]:= SystemModelPlot[model, {"Inertia2.w"}, <|"ParameterValues" -> {"Inertia2.J" -> 2}|>]

Out[2]= [image]
```

Use ``SystemModelPlot`` to plot individual curves when doing a parameter sweep:

```wl
In[3]:= SystemModelPlot[model, {"Inertia2.w"}, <|"ParameterValues" -> {"Inertia2.J" -> {1, 2, 3}}|>]

Out[3]= [image]
```

Use ``SystemModelPlot`` to plot sensitivity bands computed with ``SystemModelSimulateSensitivity`` :

```wl
In[4]:= sim = SystemModelSimulateSensitivity[model, 10, {"Inertia2.J"}, <|"ParameterValues" -> {"Inertia2.J" -> 2}|>]

Out[4]=
SystemModelSimulationData["/tmp/WolframSystemModeler-secavarat-14.3/WL/wsml_HybridMotor_lsim_79888_\
45830_423505504923419989902778409928_1.mat", "DocumentationExamples.Simulation.HybridMotor", 75, 
 {0., 10.}, "/tmp/WolframSystemModeler-secavarat- ... -6, "DisplayTimeUnit" -> None, "Epoch" -> None, 
  "DisplayTimeZone" -> Automatic, "InterpolationPoints" -> 2000, "Method" -> Automatic, 
  "StepSize" -> 0, "SynchronizeWithRealTime" -> False, "SimulationRate" -> 1., 
  "CommunicationRate" -> 20]]

In[5]:= SystemModelPlot[sim, {{"Inertia2.w", "Inertia2.J", 0.5}}]

Out[5]= [image]
```

Use ``SystemModelUncertaintyPlot`` to plot uncertainty:

```wl
In[6]:= SystemModelUncertaintyPlot[model, <|"Outputs" -> "Inertia2.w", "ParameterValues" -> {"Inertia2.J" -> CenteredInterval[{{1, 1, 536870912, -29}, 63}]}|>]

Out[6]= [image]
```

---

``Interval`` and ``CenteredInterval`` are sampled as regions:

```wl
In[1]:= model = [image];

In[2]:= SystemModelUncertaintyPlot[model, <|"Outputs" -> "Inertia2.w", "ParameterValues" -> {"Inertia2.J" -> CenteredInterval[{{1, 1, 858993460, -33}, 66}]}|>]

Out[2]= [image]
```

``Around`` and ``VectorAround`` are sampled as their corresponding distributions:

```wl
In[3]:= SystemModelUncertaintyPlot[model, <|"Outputs" -> "Inertia2.w", "ParameterValues" -> {"Inertia2.J" -> Around[2., 0.1]}|>]

Out[3]= [image]
```

### Neat Examples (1)

Visualize the sensitivity of a chaotic system with respect to small changes in initial conditions:

```wl
In[1]:= SystemModelUncertaintyPlot[[image], <|"Outputs" -> "x", "InitialValues" -> {"x" -> CenteredInterval[{{0, 0, 549755814, -39}, 72}]}|>]

Out[1]= [image]
```

## See Also

* [`SystemModelCalibrate`](https://reference.wolfram.com/language/ref/SystemModelCalibrate.en.md)
* [`SystemModelSimulate`](https://reference.wolfram.com/language/ref/SystemModelSimulate.en.md)
* [`SystemModelMeasurements`](https://reference.wolfram.com/language/ref/SystemModelMeasurements.en.md)
* [`SystemModel`](https://reference.wolfram.com/language/ref/SystemModel.en.md)
* [`SystemModelExamples`](https://reference.wolfram.com/language/ref/SystemModelExamples.en.md)

## Tech Notes

* [Getting Started with Model Simulation and Analysis](https://reference.wolfram.com/language/tutorial/GettingStartedWithModelSimulationAndAnalysis.en.md)
* [Numerical Operations on Data](https://reference.wolfram.com/language/tutorial/NumericalOperationsOnData.en.md)

## Related Guides

* [System Model Simulation](https://reference.wolfram.com/language/guide/SystemModelSimulation.en.md)

## Related Links

* [Wolfram System Modeler Documentation](http://reference.wolfram.com/system-modeler/)

## History

* [Introduced in 2024 (14.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn140.en.md)