Main Content

ufrd

Uncertain frequency response data model

Description

An uncertain frequency response data (ufrd) model consists of a set of fixed frequency-response data points and one or more dependent uncertain elements. You can use ufrd for robust stability and worst-case performance analysis.

Creation

There are several ways to construct a ufrd model, including:

  1. Combine a numeric frd model with uncertain state-space (uss) models or uncertain elements such as ureal, ultidyn, or umargin using model arithmetic. For example:

    fsys = frd(rand(100,1),logspace(-2,2,100));
    k = ureal('k',1);
    D = ultidyn('Delta',[1 1]);
    ufrd_sys = k*fsys*(1+0.1*D)
    Uncertain continuous-time FRD model with 1 outputs, 1 inputs, 100 frequency points.
      Delta: Uncertain 1x1 LTI, peak gain = 1, 1 occurrences
      k: Uncertain real, nominal = 1, variability = [-1,1], 1 occurrences
    Model Properties

    ufrd_sys is a ufrd model with uncertain elements k and D.

  2. Convert a uss model to ufrd by computing the response at a set of frequencies. For example:

    a = ureal('a',1,'range',[0.5 1.8]);
    usys = tf(a,[1 a]);
    freqs = logspace(-2,2,100);
    ufrd_sys = ufrd(usys,freqs)
    Uncertain continuous-time FRD model with 1 outputs, 1 inputs, 100 frequency points.
      a: Uncertain real, nominal = 1, range = [0.5,1.8], 1 occurrences
    Model Properties
    
    Type "ufrd_sys.NominalValue" to see the nominal value and "usys.Uncertainty" to interact with the uncertain elements.
    

    The resulting ufrd model has the same uncertain elements as the original uss model.

    To specify the frequency units of the frequencies in freqs, use

    ufrd_sys = ufrd(M,freqs,frequnits)

    The argument frequnits can take the same values as the FrequencyUnit property.

  3. More generally, convert any dynamic system model or static model M to ufrd as follows:

    ufrd_sys = ufrd(M,freqs)

    If M contains blocks that do not represent uncertainty (such as tunable parameters), those blocks are replaced by their current value. (To obtain a frequency-response model that preserves both tunable and uncertain blocks, use genfrd instead.)

    To specify the frequency units of the frequencies in freqs, use ufrd_sys = ufrd(M,freqs,frequnits). To further specify the time units when M is a static model, use ufrd_sys = ufrd(M,freqs,frequnits,timeunits). The arguments frequnits and timeunitscan take the same values as the FrequencyUnit and TimeUnit properties, respectively.

  4. Use frd to construct a ufrd model from an uncertain matrix (umat) representing uncertain frequency response data. For example:

    a = ureal('delta',1,'percent',50);
    freq = logspace(-2,2,100);
    RespData = rand(1,1,100) * a;
    ufrd_sys = frd(RespData,freq,0.1)

Properties

expand all

Frequency values at which the system response is sampled, specified as a vector of values with units given by FrequencyUnit.

Units of the frequency vector in the Frequency property, specified as one of the following values:

  • 'rad/TimeUnit'

  • 'cycles/TimeUnit'

  • 'rad/s'

  • 'Hz'

  • 'kHz'

  • 'MHz'

  • 'GHz'

  • 'rpm'

The units 'rad/TimeUnit' and 'cycles/TimeUnit' are relative to the time units specified in the TimeUnit property.

Changing this property does not resample or convert the data. Modifying the property changes only the interpretation of the existing data. Use chgFreqUnit to convert the data to different frequency units.

Frequency response of fixed portion of model, specified as a multidimensional array of complex numbers.

  • For SISO systems, ResponseData is a 1-by-1-by-Nf array of frequency response values at the Nf frequency points specified in the Frequency property.

  • For MIMO systems with Nu inputs and Ny outputs, ResponseData is an Ny-by-Nu-by-Nf array, where Nf is the number of frequency points.

    For instance, ResponseData(ky,ku,kf) represents the frequency response from the input ku to the output ky at the frequency Frequency(kf).

  • For an S1-...-by-Sn array of models with Nu inputs and Ny outputs, ResponseData is a multidimensional array of size [Ny Nu Nf S1Sn].

    For instance, a ResponseData of size [Ny,Nu,Nf,3,4] represents the response data for a 3-by-4 array of models. Each model has Ny outputs, Nu inputs, and Nf frequency points.

Nominal value of the uncertain model, specified as frequency response data (frd) model object. This frequency response data model is obtained by setting all the uncertain control design blocks of the uncertain model to their nominal values.

Uncertain elements of the model, specified as a structure whose fields are the names of the uncertain blocks, and whose values are the control design blocks themselves. Thus, the values stored in the structure can be ureal, umat, ultidyn, or other uncertain control design blocks.

You can access or examine each uncertain parameter individually. For example, suppose that ufrd_sys is a ufrd model having uncertain real parameters p1 and p2. Access You can access p1 using dot notation.

get(usys.Uncertainty.p1)
    NominalValue: 1
            Mode: 'PlusMinus'
           Range: [0 2]
       PlusMinus: [-1 1]
      Percentage: [-100 100]
    AutoSimplify: 'basic'
            Name: 'p1'

Delay at each input, specified as a scalar or a vector. For a system with Nu inputs, set InputDelay to an Nu-by-1 vector. Each entry of this vector is a numerical value that represents the input delay for the corresponding input channel. For continuous-time models, specify input delays in the time unit stored in the TimeUnit property of the model object. For discrete-time models, specify input delays in integer multiples of the sample time Ts. For example, InputDelay = 3 means a delay of three sample times.

Set InputDelay to a scalar value to apply the same delay to all channels.

Delay at each output, specified as a scalar or a vector. For a system with Ny outputs, set OutputDelay to an Ny-by-1 vector. Each entry of this vector is a numerical value that represents the output delay for the corresponding output channel. For continuous-time models, specify output delays in the time unit stored in the TimeUnit property of the model object. For discrete-time models, specify output delays in integer multiples of the sample time Ts. For example, OutputDelay = 3 means a delay of three sample times.

Set OutputDelay to a scalar value to apply the same delay to all channels.

Names of input channels, specified as:

  • A character vector or string — For single-input models

  • A cell array of character vectors or a string array — For models with two or more inputs

  • '' — For inputs without specified names

You can use automatic vector expansion to assign input names for multi-input models. For example, if sys is a two-input model, you can specify InputName as follows.

sys.InputName = 'controls';

The input names automatically expand to {'controls(1)';'controls(2)'}.

You can use the shorthand notation u to refer to the InputName property. For example, sys.u is equivalent to sys.InputName.

Input channel names have several uses, including:

  • Identifying channels on model display and plots

  • Extracting subsystems of MIMO systems

  • Specifying connection points when interconnecting models

If you specify InputName using a string or string array, such as "voltage", the input name is stored as a character vector, 'voltage'.

Units of input signals, specified as:

  • A character vector or string — For single-input models

  • A cell array of character vectors or string array — For models with two or more inputs

  • '' — For inputs without specified units

Use InputUnit to keep track of the units each input signal is expressed in. InputUnit has no effect on system behavior.

If you specify InputUnit using a string, such as "voltage", the input units are stored as a character vector, 'voltage'.

Example: 'voltage'

Example: {'voltage','rpm'}

Input channel groups, specified as a structure where the fields are the group names and the values are the indices of the input channels belonging to the corresponding group. When you use InputGroup to assign the input channels of MIMO systems to groups, you can refer to each group by name when you need to access it. For example, suppose you have a five-input model sys, where the first three inputs are control inputs and the remaining two inputs represent noise. Assign the control and noise inputs of sys to separate groups.

sys.InputGroup.controls = [1:3];
sys.InputGroup.noise = [4 5];

Use the group name to extract the subsystem from the control inputs to all outputs.

sys(:,'controls')

Example: struct('controls',[1:3],'noise',[4 5])

Names of output channels, specified as:

  • A character vector or string— For single-output models

  • A cell array of character vectors or string array — For models with two or more outputs

  • '' — For outputs without specified names

You can use automatic vector expansion to assign output names for multi-output models. For example, if sys is a two-output model, you can specify OutputName as follows.

sys.OutputName = 'measurements';

The output names automatically expand to {'measurements(1)';'measurements(2)'}.

You can use the shorthand notation y to refer to the OutputName property. For example, sys.y is equivalent to sys.OutputName.

Output channel names have several uses, including:

  • Identifying channels on model display and plots

  • Extracting subsystems of MIMO systems

  • Specifying connection points when interconnecting models

If you specify OutputName using a string, such as "rpm", the output name is stored as a character vector, 'rpm'.

Units of output signals, specified as:

  • A character vector or string — For single-output models

  • A cell array of character vectors or string array — For models with two or more outputs

  • '' — For outputs without specified units

Use OutputUnit to keep track of the units each output signal is expressed in. OutputUnit has no effect on system behavior.

If you specify OutputUnit using a string, such as "voltage", the output units are stored as a character vector, 'voltage'.

Example: 'voltage'

Example: {'voltage','rpm'}

Output channel groups, specified as a structure where the fields are the group names and the values are the indices of the output channels belonging to the corresponding group. When you use OutputGroup to assign the output channels of MIMO systems to groups, you can refer to each group by name when you need to access it. For example, suppose you have a four-output model sys, where the second output is a temperature, and the rest are state measurements. Assign these outputs to separate groups.

sys.OutputGroup.temperature = [2];
sys.OutputGroup.measurements = [1 3 4];

Use the group name to extract the subsystem from all inputs to the measurement outputs.

sys('measurements',:)

Example: struct('temperature',[2],'measurement',[1 3 4])

Text notes about the model, specified as a string or character vector. The property stores whichever of these two data types you provide. For instance, suppose that sys1 and sys2 are dynamic system models. You can set their Notes properties to a string and a character vector, respectively.

sys1.Notes = "sys1 has a string.";
sys2.Notes = 'sys2 has a character vector.';
sys1.Notes
sys2.Notes
ans = 

    "sys1 has a string."


ans =

    'sys2 has a character vector.'

You can also specify Notes as string array or a cell array of character vectors or strings.

Data of any kind that you want to associate and store with the model, specified as any MATLAB® data type.

Model name, stored as a character vector or string. If you specify Name using a string, such as "DCmotor", the string is stored as a character vector, 'DCmotor'.

Example: 'system_1'

Sample time, specified as:

  • 0 — For continuous-time models.

  • Positive scalar value — For discrete-time models. Specify the sample time in the units given in the TimeUnit property of the model.

  • –1 — For discrete-time models with unspecified sample time.

Changing this property does not discretize or resample the model.

Model time units, specified as:

  • 'nanoseconds'

  • 'microseconds'

  • 'milliseconds'

  • 'seconds'

  • 'minutes'

  • 'hours'

  • 'days'

  • 'weeks'

  • 'months'

  • 'years'

If you specify TimeUnit using a string, such as "hours", the time units are stored as a character vector, 'hours'.

Model properties such as sample time Ts, InputDelay, OutputDelay, and other time delays are expressed in the units specified by TimeUnit. Changing this property has no effect on other properties, and therefore changes the overall system behavior. Use to convert between time units without modifying system behavior.

Sampling grid for model arrays, specified as a structure. For model arrays that are derived by sampling one or more independent variables, this property tracks the variable values associated with each model in the array. This information appears when you display or plot the model array. Use this information to trace results back to the independent variables.

Set the field names of the data structure to the names of the sampling variables. Set the field values to the sampled variable values associated with each model in the array. All sampling variables should be numeric and scalar valued, and all arrays of sampled values should match the dimensions of the model array.

For example, suppose you create a 11-by-1 array of linear models, sysarr, by taking snapshots of a linear time-varying system at times t = 0:10. The following code stores the time samples with the linear models.

 sysarr.SamplingGrid = struct('time',0:10)

Similarly, suppose you create a 6-by-9 model array, M, by independently sampling two variables, zeta and w. The following code attaches the (zeta,w) values to M.

[zeta,w] = ndgrid(<6 values of zeta>,<9 values of w>)
M.SamplingGrid = struct('zeta',zeta,'w',w)

When you display M, each entry in the array includes the corresponding zeta and w values.

M
M(:,:,1,1) [zeta=0.3, w=5] =
 
        25
  --------------
  s^2 + 3 s + 25
 

M(:,:,2,1) [zeta=0.35, w=5] =
 
         25
  ----------------
  s^2 + 3.5 s + 25
 
...

For model arrays generated by linearizing a Simulink® model at multiple parameter values or operating points, the software populates SamplingGrid automatically with the variable values that correspond to each entry in the array. For example, the Simulink Control Design™ commands linearize (Simulink Control Design) and slLinearizer (Simulink Control Design) populate SamplingGrid in this way.

Object Functions

Most functions that work on numeric frd models also work on ufrd models. These include model interconnection functions such as connect and feedback, and frequency-domain linear analysis functions such as bode. Some functions that generate plots, such as bodeplot, plot random samples of the uncertain model to give you a sense of the distribution of uncertain dynamics. Analysis functions that return data, however, typically operate on the nominal value of the system only. ufrd models do not work with any time-domain analysis functions.

In addition, you can use functions such as robstab and wcgain to perform robustness and worst-case analysis of uncertain systems represented by ufrd models. You can also use tuning functions such as systune for robust controller tuning.

The following lists contain a representative subset of the functions you can use with ufrd models.

expand all

feedbackFeedback connection of multiple models
connectBlock diagram interconnections of dynamic systems
seriesSeries connection of two models
parallelParallel connection of two models
bodeBode frequency response of dynamic system
bodeplotPlot Bode frequency response of dynamic system
sigmaSingular values of frequency response of dynamic system
sigmaplotPlot singular values for frequency response of dynamic system
marginGain margin, phase margin, and crossover frequencies
diskmarginDisk-based stability margins of feedback loops
usampleGenerate random samples of uncertain model or element
robstabRobust stability of uncertain system
robgainRobust performance of uncertain system
wcgainWorst-case gain of uncertain system
wcsigmaplotPlot worst-case gain of uncertain system
pidtunePID tuning algorithm for linear plant model
musynRobust controller design using mu synthesis
systuneTune fixed-structure control systems modeled in MATLAB

Examples

collapse all

Compute the uncertain frequency response of an uncertain system with both parametric uncertainty (ureal) and uncertain gain and phase (umargin). Create the uncertain frequency response by building a uss model using uncertain dynamics, and then extracting its response at a specified set of frequencies.

p1 = ureal('p1',5,'Range',[2 6]); 
p2 = ureal('p2',3,'Plusminus',0.4); 
F = umargin('F',1.2); 
A = [-p1 0;p2 -p1]; 
B = [0;p2]; 
C = [1 1]; 
usys = uss(A,B,C,0)*F; 

freqs = logspace(-2,2,60);
usysfrd = ufrd(usys,freqs); 

Plot random samples and the nominal value of the uncertain frequency response.

rng(0);    % for reproducibility
bode(usysfrd,'r',usysfrd.NominalValue,'b+') 

MATLAB figure

Version History

Introduced before R2006a