Create uncertain real parameter
p = ureal('name',nominalvalue) p = ureal('name',nominalvalue,'Property1',Value1,... 'Property2',Value2,...)
An uncertain real parameter is used to represent a real number whose value is uncertain. Uncertain real parameters have a name (the
Name property), and a nominal value (
The uncertainty (potential deviation from
NominalValue) is described (equivalently) in 3 different properties:
PlusMinus: the additive deviation from
Range: the interval containing
Percentage: the percentage deviation from
Mode property specifies which one of these three descriptions remains unchanged if the
NominalValue is changed (the other two descriptions are derived). The possible values for the
Mode property are
'Range', 'Percentage' and
[-1 1] is the default value for the
'PlusMinus' property. The range of uncertainty need not be symmetric about
AutoSimplify controls how expressions involving the uncertain matrix are simplified. Its default value is
'basic', which means elementary methods of simplification are applied as operations are completed. Other values for
'off'', no simplification performed, and
'full', which applies model-reduction-like techniques to the uncertain object.
Create an uncertain real parameter and use
get to display the properties and their values. Create uncertain real parameter object
a with the internal name
'a' and nominal value
a = ureal('a',5) Uncertain Real Parameter: Name a, NominalValue 5, variability = [-1 1] get(a) Name: 'a' NominalValue: 5 Mode: 'PlusMinus' Range: [4 6] PlusMinus: [-1 1] Percentage: [-20 20] AutoSimplify: 'basic'
Note that the
'PlusMinus', and that the value of
PlusMinus is indeed
[-1 1]. As expected, the range description of uncertainty is
[4 6], while the percentage description of uncertainty is
Set the range to
[3 9]. This leaves
NominalValue unchanged, but all three descriptions of uncertainty have been modified.
a.Range = [3 9]; get(a) Name: 'a' NominalValue: 5 Mode: 'PlusMinus' Range: [3 9] PlusMinus: [-2 4] Percentage: [-40 80] AutoSimplify: 'basic'
Property/Value pairs can also be specified at creation.
b = ureal('b',6,'Percentage',[-30 40],'AutoSimplify','full'); get(b) Name: 'b' NominalValue: 6 Mode: 'Percentage' Range: [4.2000 8.4000] PlusMinus: [-1.8000 2.4000] Percentage: [-30.0000 40.0000] AutoSimplify: 'full'
Mode is automatically set to
Specify the uncertainty in terms of percentage, but force
c = ureal('c',4,'Mode','Range','Percentage',25); get(c) Name: 'c' NominalValue: 4 Mode: 'Range' Range: [3 5] PlusMinus: [-1 1] Percentage: [-25 25] AutoSimplify: 'basic'
urealelements is uniform in actual values
Behavior changed in R2020a
Beginning in R2020a,
usample uniformly samples the
actual uncertainty range of
ureal objects. Previously,
usample first normalized the uncertain element, and then
sampled uniformly in the normalized range. As a result of this change, you might
obtain different results when you use
usample to sample
ureal elements or
uss models that contain
them, even if you use the same random seed.
The new implementation yields more uniform sampling for
parameters with skewed ranges (nominal value closer to one end of the range than the
other). However, highly skewed ranges can lead to poor numeric conditioning and poor
results. Therefore, for meaningful results, avoid highly skewed ranges where the
nominal value is orders of magnitude closer to one end of the range than to the