This is the information about the quality of a parameter value and, thus, an essential part of a credible model. Besides a mathematical description of the uncertainty (see e.g. [Otter2022]), also the same information as for the traceability of parameter value needs to be given:
Additionally, the mathematical description of uncertainties of scalars and of arrays/tables must be provided. Particular descriptions provided with the library are collected in package Types.Uncertainty.
The treatment implemented in the library is focused on providing the information in a way that it can be used by models described with the Modelica language, FMI or SSP. Furthermore, not only physical/measured quantities are taken into account, but the same description form is also used to define requirements or specifications. For example, a simulation result must match a reference result with some uncertainty, or the result of a design must match some criteria that is specified with an uncertainty description.
Every physical quantity has inherent limits. Therefore, the upper and lower limits of a scalar value need to be defined, independent of the kind of the mathematical description of the uncertainty. For this reason, the minimum information to be provided for a scalar parameter with an uncertainty description of any kind is:
Often, it is inconvenient to provide absolute ranges and instead, relative or absolute deviations are more practical. In the eFMI standard (Section 3.2.4) tolerances for reference results are defined in a similar way as tolerances for numerical integration algorithms. Due to its generality, this description form of eFMI is used here as well:
The lower and upper values are computed from these parameters in the following way:
tol = max(absTol, relTol*|nominal|) lower = nominal − tol upper = nominal + tol
The resistance of an electrical resistor can be defined using following tolerances:
There is a huge literature on the mathematical description of uncertainties. [Riedmaier2021] provides a comprehensive literature overview. In [Bouskela2011], some constructs are proposed to describe uncertain values in the Modelica language. In the Credibility Library, the following uncertainty descriptions are currently provided for scalar Real parameters, see Types:
Uncertainty name | Parameters | Uncertainty type |
---|---|---|
Interval |
nominal , lower , upper
|
epistemic |
Uniform |
nominal , lower , upper
|
uniform distribution |
TruncatedNormal |
nominal , lower , upper , stdDev
|
truncated normal distribution |
IntervalTolerance |
nominal , relTol=0 , absTol=0
|
epistemic |
UniformTolerance |
nominal , relTol=0 , absTol=0
|
uniform distribution |
TruncatedNormalTolerance |
nominal , relTol=0 , absTol=0 ,
stdDevFactor=3
|
truncated normal distribution |
An example for a TruncatedNormalTolerance uncertainty of the abovementioned resistance is given in the next two figures:
Arrays occur in system modelling and analysis in various ways:
All these examples have parameter arrays, where the uncertainties of the array elements need to be described.
If a characteristic is determined by detailed measurements, then typically for every element upper and lower limits are known from the available measurement data. This means that the measurements can be summarized by a nominal array that has been determined by the calibration process and arrays lower and upper of the same size that define lower and upper limits, so all measured data of the respective characteristics is between these limits. Furthermore, it must be defined how to interpolate between the table values, given the vectors of the independent variables (an n-dimensional table is defined by n vectors of independent variables). Often, linear interpolation is used for tables derived from measurements.
An envisaged uncertainty description with generic parameterization of 2-dim. array can be demonstrated in the following example. The vectors of the two independent variables are u1 = [0.1, 0.2, 0.3, 0.4] and u2 = [10, 20, 30]. The nominal array is a matrix of size [4, 3] and, e.g., of values [110 120 130; 210 220 230; 310 320 330; 410 420 430] (i.e. y = 230 is the nominal value for u1 = 0.2 and u2 = 30). Both the lower and upper limits are matrices of size [4, 3] as well and have exemplary values lower = [11 12 13; 21 22 23; 31 32 33; 41 42 43] and upper = [119 129 139; 219 229 239; 319 329 339; 419 429 439]. Thus, e.g. the uncertain table value of u1 = 0.2 and u2 = 30 (i.e. array element [2, 3]) must be in the range [23 … 239].
The question arises how a parameter array can be used to compute the uncertainty distributions of output variables. For scalar parameters, the standard Monte Carlo simulation method is based on the approach to draw sufficient numbers of random numbers according to the respective distributions and for each set of selected parameter values perform a simulation. Such a procedure might not be directly applicable to parameter arrays, because randomly selected elements of an array might give a table that does not represent physics (for example, if the table output is a monotonically increasing function of the input, then this property might be lost if table elements are randomly selected).
For simplicity, the following method is used for 1-dim. tables in the Library. A generalization to multi-dimensional tables is straightforward. A 1-dim. table defines a function y = f (u ) that computes the output y from the input u by interpolation in a table, cf. Modelica.Blocks.Tables.CombiTable1Ds. The table is defined as "table[i,j]" with the first column "table[:,1] = u[:]" which contains the grid points ui, and the second column "table[:,2] = y[:]" which contains the data yi to be interpolated. This "table[i,j]" is computed from the given matrix "uncertainty" by a convex combination utilizing uncertain parameter λ. Hereby, the matrix "uncertainty" contains
The convex combination is defined in a way that λ = −1 results in "y[i] = lower[i]", λ = 0 results in "y[i] = nominal[i]" and λ = 1 results in "y[i] = upper[i]", in particular:
A realization can be seen in Credibility.Table1D
where "uncertainty" table is in fact defined by parameter uncertainty.table
.
In this record, the abovementioned calculation is done in the function
getTableLambdaByInterval.
There is also implemented an alternative calculation of "table[i,j]" called
getTableLambdaByTolerance
utilizing – either relative or absolute –
tolerances.