Robust Control Toolbox™ Previous page   Next Page 
usample
 Provide feedback about this page

Generate random samples of uncertain object

Syntax

Description

B = usample(A) substitutes a random sample of the uncertain objects in A, returning a certain (i.e., not uncertain) array of size [size(A)].

B = usample(A,N) substitutes N random samples of the uncertain objects in A, returning a certain (i.e., not uncertain) array of size [size(A) N].

[B,SampleValues] = usample(A,N) additionally returns the specific sampled values (as a Struct whose field names are the names of A's uncertain elements) of the uncertain elements. Hence, B is the same as usubs(A,SampleValues).

[B,SampleValues] = usample(A,Names,N) samples only the uncertain elements listed in the Names variable (cell, or char array). If Names does not include all the uncertain objects in A, then B will be an uncertain object. Any entries of Names that are not elements of A are simply ignored. Note that usample(A,fieldnames(A.Uncertainty),N) is the same as usample(A,N).

[B,SampleValues] = usample(A,Names1,N1,Names2,N2,...) takes N1 samples of the uncertain elements listed in Names1, and N2 samples of the uncertain elements listed in Names2, and so on. size(B) will equal [size(A) N1 N2 ...].

The scalar parameter BW in

affects how ultidyn elements within A are sampled, restricting the poles of the samples. If A is a continuous-time uss or ufrd, then the poles of sampled GainBounded ultidyn elements in SampleValues will each have magnitude <= BW. If A is a discrete-time, then sampled GainBounded ultidyn elements are obtained by Tustin transformation, using BW/(2*TS) as the (continuous) pole magnitude bound. In this case, BW should be < 1. If the ultidyn type is PositiveReal, then the samples are obtained by bilinearly transforming (see Normalizing Functions for Uncertain Atoms) the GainBounded elements described above.

Example

Sample a real parameter and plot a histogram.

The second example illustrates the open and closed-loop response of an uncertain plant model. You can create two uncertain real parameters and an uncertain plant.

Create an integral controller based on nominal plant parameter.

Now create an uncertain closed-loop system.

You can sample the plant P at 10 values in the tau parameter and 15 values in the gamma parameter.

You can plot the 1-D sampled plant step responses

You can also evaluate the uncertain closed-loop at the same values, and plot the step response using usubs.

To see the effect of the bandwidth parameter, create two ultidyn objects

Sample 10 instances of each, using a bandwidth limit of 1 rad/sec on A and 20 rad/sec on B.

Plot 10-second step responses, for the two sample sets. Plot the slow sample (from A ) in red, and the faster samples (from B.) in blue.

See Also
usubs       Substitutes values for uncertain atoms

usimfill

Purpose

Helper function for USS System blocks, used to set the "User-defined Uncertainty" field or the state of the "Uncertainty value" pulldown menu.

Syntax

Description

The command usimfill allows simple control of some parameters of all uss System blocks in a Simulink® model.

usimfill(ModelName,str) pushes the string in str into the Uncertainty value name field of all USS System blocks in the Simulink model specified by ModelName.

usimfill(ModelName,'Uncertainty value','Nominal') sets the Uncertainty value pulldown menu to Nominal for all USS System blocks in the Simulink model specified by ModelName. Only a limited number of characters are needed to make this specification, so usimfill(ModelName,'U','N') accomplishes the same effect.

usimfill(ModelName,'Uncertainty value','User defined') sets the Uncertainty value pulldown menu to User defined for all USS System blocks in the Simulink model specified by ModelName. Only a limited number of characters are needed to make this specification, so usimfill(ModelName,'U','U') accomplishes the same effect.

Example

See the Robust Control Toolbox™ demo entitled "Uncertain Simulink Blocks" for a more detailed example of how to use usimfill.

Open the model file associated with the demo,

This has 3 USS System blocks. They are plant with a ureal atom named unc_pole; input_unc which is a ultidyn object, and sensor_gain which is a ureal atom.

Run usimfill on the model, filling in the field with the string 'newData'.

Now generate a random sample of the uncertain atoms, and run the simulation

See Also
usample     Generate random samples of uncertain object

usiminfo    Find USS System blocks within Simulink model

usimsamp    Generate random instance of all USS System blocks in a Simulink model

usubs       Substitutes values for uncertain atoms

usiminfo

Purpose

Find USS System blocks within specified Simulink® model and checks for consistency

Syntax

Description

The command usiminfo returns information regarding the locations of all USS System blocks within a Simulink model and determines if these conpatiblilty conditions are satisfied. It is possible to have uncertain objects of the same name through out a Simulink model. The helper functions usimsamp and usimfill assume that these are the same uncertainty. Hence uncertain objects of the same name should have the same object properties and Uncertainty value in the USS System pull-down menu. usiminfo provides information about the uncertainty in the Simulink diagram sname.

The following describes the input and outputs arguments of usiminfo:

Inputs:

sname       Simulink diagram name

silent      Display inconsistencies between uncertain atoms if isn't empty. Default is empty.

Outputs:

cflag       Compatibility flag set to 1 if all uncertainties are consistent, set to 0 if an uncertainty definition(s) is consistent and set to -1 if common uncertainties in different blocks have different Uncertainty value.

allupaths   Path names of USS System blocks in the model (cell).

allunames   Uncertainties names in Simulink model (cell).

upaths      Path names associated with each allunames entry (cell).

unames      Uncertainty names associated with each allupaths entry (cell).

csumchar    Character array with description of uncertainties and their associated block path names. Empty if there is a conflict with unames.

See Also
usample     Generate random samples of uncertain object

usimfill    Fills in the Uncertainty Variable Name field or sets the Uncertainty Selection pull down menu in USS Simulink blocks

usimsamp    Generate random instance of all USS System blocks in a Simulink model

usubs       Substitutes values for uncertain atoms

usimsamp

Purpose

Generate random instance of all uncertain atoms present in all USS System blocks of Simulink® model

Syntax

Description

The command usimsamp samples a Simulink model. Note that if the model contains any USS System blocks, then the model can be interpreted as an uncertain Simulink model. The sample generated by usimsamp is a scalar structure, with fieldnames corresponding to the uncertain atoms within all of the USS System blocks, and the values are specific random samples of the atoms.

For ultidyn atoms, the magnitude of the sampled poles can be limited using an optional second bandwidth argument, BW. See usample for more information on this parameter.

Example

See the Robust Control Toolbox™ demo called "Uncertain Simulink Blocks" for a more detailed example of how to use usimsamp.

Open the model file associated with the demonstration,

This has 3 USS System blocks. They are plant with a ureal atom named unc_pole; input_unc which is a ultidyn object, and sensor_gain which is a ureal atom.

Run usimsamp on the model, yielding a structure as described above.

See Also
usample     Generate random samples of uncertain object

usimfill    Fills in the Uncertainty Variable Name field or sets the Uncertainty Selection pull down menu in USS Simulink blocks

usiminfo    Find USS System blocks within Simulink® model

usubs       Substitutes values for uncertain atoms


 Provide feedback about this page 

Previous page ureal uss Next page

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