Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Optimization   

randunc - Random values of uncertain parameters

Syntax

uncpar=randunc(N,'ParameterName',Range,...)

Description

uncpar=randunc(N,'ParameterName',Range,...) generates random values of uncertain parameters, specified as comma separated 'ParameterName' and Range value pairs. Range specifies the lower and upper bounds for the uncertain parameter. Enter Range as a cell array {[Min],[Max]} for vector- and scalar-valued parameters or vector [Min,Max] for scalar-valued parameters. Dimensions of each cell element must match the corresponding parameter dimension. N is the number of samples inside the hypercube formed by Min and Max of each parameter. uncpar contains the uncertain parameter values.

Examples

Generate random values for vector-valued uncertain parameters Kp and Kd:

uset=randunc(10,'Kp',{[1,4,3,0],[4,10,7.5,6]},'Kd',{[2,2],[8,7]})
 

Generate random values for scalar-valued uncertain parameters w0 and zeta:

uset=randunc(4,'w0',[0.45,0.55],'zeta',[0.45,0.55])
 

Generate random values for uncertain parameters and test model robustness:

% Open the Simulink model.
sldo_model1_desreq_optim
% Extract response optimization project from the model.
proj=getsro('sldo_model1_desreq_optim');
% Create random values for uncertain parameters w0 and zeta.
uset=randunc(4,'w0',[0.45,0.55],'zeta',[0.45,0.55])
% View values for the uncertain parameter w0.
uset.w0
% The default value of the Optimized property of uset is false.
% This value implies that the uncertain parameter values are not
% enabled for testing model robustness.
% Set the value to true to enable all uncertain parameter
% values for testing model robustness.
uset.Optimized(1:end)=true;
% Specify parameter uncertainty in response optimization project.
setunc(proj,uset);
% Test model robustness.
optimize(proj);

Algorithm

For parameters p with range specified as [Min,Max] or {[Min],[Max]} , randunc interprets the range of the uncertain parameters as:

Min(i,j) <= p(i,j) <= Max(i,j)

randunc generates a set of uncertain parameter values consists of the following:

Alternatives

To generate random values of uncertain parameters using the GUI:

  1. In the Simulink model, double-click the Signal Constraint block to open the Block Parameters: Signal Constraint window.

  2. In the Block Parameters window, select Optimization > Uncertain Parameters to open the Uncertain Parameters dialog box.

  3. Select Random (Monte Carlo) as the Sampling method.

  4. Specify the number of samples in the Number of samples field.

  5. Specify the uncertain parameters and their range:

    1. Click Add to open the Add Parameters dialog box.

    2. Select the uncertain parameters and click OK to add them to the Uncertain Parameters dialog box.

    3. Specify the range for the corresponding parameter in the Min and Max columns.

See Also

gridunc | setunc

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS