Uncertain real parameters have a name (the
Name property), and a
nominal value (the
NominalValue property). Several other properties
describe the uncertainty in parameter values.
All properties of a
ureal can be accessed through
set. The properties are:
Nominal value of element
Signifies which description (from
Additive variation (% of absolute value of nominal)
PlusMinus are all automatically synchronized. If the nominal value is
0, then the
Mode cannot be
Mode property controls what aspect of the uncertainty remains unchanged
NominalValue is changed. Assigning to any of
changes the value, but does not change the mode.
AutoSimplify property controls how expressions involving the real
parameter are simplified. Its default value is
'basic', which means
elementary methods of simplification are applied as operations are completed. Other values
'off' (no simplification
'full' (model-reduction-like techniques are applied). See
Simplifying Representation of Uncertain Objects to learn
more about the
AutoSimplify property and the command
If no property/value pairs are specified, default values are used. The default
PlusMinus, and the default value of
[-1 1]. Some examples are shown below.
In many cases, the full property name is not specified, taking advantage of the
case-insensitive, partial name property matching.
This example shows how to create uncertain real parameters, modify properties such as range of uncertainty, and sample uncertain parameters.
Create an uncertain real parameter, nominal value 3, with default values for all unspecified properties (including plus/minus variability of 1).
a = ureal('a',3)
a = Uncertain real parameter "a" with nominal value 3 and variability [-1,1].
View the properties and their values, and note that the
Percentage descriptions of variability are automatically maintained.
NominalValue: 3 Mode: 'PlusMinus' Range: [2 4] PlusMinus: [-1 1] Percentage: [-33.3333 33.3333] AutoSimplify: 'basic' Name: 'a'
Create an uncertain real parameter, nominal value 2, with 20% variability. Again, view the properties, and note that the
PlusMinus descriptions of variability are automatically maintained.
b = ureal('b',2,'Percentage',20)
b = Uncertain real parameter "b" with nominal value 2 and variability [-20,20]%.
NominalValue: 2 Mode: 'Percentage' Range: [1.6000 2.4000] PlusMinus: [-0.4000 0.4000] Percentage: [-20 20] AutoSimplify: 'basic' Name: 'b'
Change the range of the parameter. All descriptions of variability are automatically updated, while the nominal value remains fixed. Although the change in variability was accomplished by specifying the
Mode is unaffected, and remains
b.Range = [1.9 2.3]; get(b)
NominalValue: 2 Mode: 'Percentage' Range: [1.9000 2.3000] PlusMinus: [-0.1000 0.3000] Percentage: [-5.0000 15.0000] AutoSimplify: 'basic' Name: 'b'
As mentioned, the
Mode property signifies what aspect of the uncertainty remains unchanged when
NominalValue is modified. Hence, if a real parameter is in
Percentage mode, then the
PlusMinus properties are determined from the
Percentage property and
NominalValue preserves the
Percentage property, and automatically updates the
b.NominalValue = 2.2; get(b)
NominalValue: 2.2000 Mode: 'Percentage' Range: [2.0900 2.5300] PlusMinus: [-0.1100 0.3300] Percentage: [-5.0000 15.0000] AutoSimplify: 'basic' Name: 'b'
Create an uncertain parameter with an asymmetric variation about its nominal value. Examine the properties to confirm the asymmetric range.
c = ureal('c',-5,'Percentage',[-20 30]); get(c)
NominalValue: -5 Mode: 'Percentage' Range: [-6 -3.5000] PlusMinus: [-1 1.5000] Percentage: [-20 30] AutoSimplify: 'basic' Name: 'c'
Create an uncertain parameter, specifying variability with
Percentage, but force the
Mode to be
d = ureal('d',-1,'Mode','Range','Percentage',[-40 60]); get(d)
NominalValue: -1 Mode: 'Range' Range: [-1.4000 -0.4000] PlusMinus: [-0.4000 0.6000] Percentage: [-40 60] AutoSimplify: 'basic' Name: 'd'
Finally, create an uncertain real parameter, and set the
AutoSimplify property to
e = ureal('e',10,'PlusMinus',[-23],'Mode','Percentage','AutoSimplify','Full')
e = Uncertain real parameter "e" with nominal value 10 and variability [-230,230]%.
NominalValue: 10 Mode: 'Percentage' Range: [-13 33] PlusMinus: [-23 23] Percentage: [-230 230] AutoSimplify: 'full' Name: 'e'
Specifying conflicting values for
Range/Percentage/PlusMinus when creating a
ureal element does not result in an error. In this case, the last specified property is used. This last occurrence also determines the
Mode is explicitly specified, in which case that is used, regardless of the property/value pairs ordering.
f = ureal('f',3,'PlusMinus',[-2 1],'Percentage',40)
f = Uncertain real parameter "f" with nominal value 3 and variability [-40,40]%.
g = ureal('g',2,'PlusMinus',[-2 1],'Mode','Range','Percentage',40)
g = Uncertain real parameter "g" with nominal value 2 and range [1.2,2.8].
ans = 'Range'
Create an uncertain real parameter, use
usample to generate 1000 instances (resulting in a 1-by-1-by-1000 array), reshape the array, and plot a histogram, with 20 bins (within the range of 2 to 4).
h = ureal('h',3); hsample = usample(h,1000); hist(reshape(hsample,[1000 1]),20);
Make the range nonsymmetric about the nominal value, and repeat the sampling, and histogram plot (with 40 bins over the range of 2-to-6)
h.Range = [2 6]; hsample = usample(h,1000); hist(reshape(hsample,[1000 1]),40);
The distribution is still uniform. The distribution used by
usample is uniform in the actual value of the uncertain real parameter. 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 other.
There is no notion of an empty
ureal (or any other uncertain element, for that matter).
ureal, by itself, creates an element named
'UNNAMED', with default property values.