# wcgainplot

Graphical worst-case gain analysis

## Syntax

wcgainplot(sys)wcgainplot(sys,w)wcgainplot(sys,...,options)

## Description

wcgainplot(sys) plots the nominal and worst-case gains of the uncertain system sys as a function of frequency. For multi-input, multi-output (MIMO) systems, gain refers to the largest singular value of the frequency response matrix. (See sigma for more information about singular values.) The plot includes:

• Nominal — nominal gain of sys

• Worst — the response falling within the uncertainty of sys that has the highest peak gain

• Worst-case gain (lower bound) — the lowest worst-case gain at each frequency

• Worst-case gain (upper bound) — the highest gain within the uncertainty at each frequency

• Sampled Uncertainty — 20 responses randomly sampled from sys

wcgainplot(sys,w) focuses the plot on the frequencies specified by w.

• If w is a cell array {wmin,wmax}, wcgainplot plots the worst-case gains in the range {wmin,wmax}.

• If w is an array of frequencies, wcgainplot plots the worst-case gains at each frequency in the array.

wcgainplot(sys,...,options) uses the options set options to specify additional options for the computation of the worst-case gains. Use wcgainOptions to create the options set.

## Input Arguments

 sys Uncertain dynamic system. w Frequencies of worst-case gain plots. Specify frequencies in radians/TimeUnit, where TimeUnit is the time unit of sys. If w is a cell array {wmin,wmax}, wcgainplot plots the worst-case gains in the range {wmin,wmax}.If w is an array of frequencies, wcgainplot plots the worst-case gains at each frequency in the array. options Options set specifying additional options for the computation of the worst-case gains. Use wcgainOptions to create the options set.

## Examples

collapse all

### Plot Worst-Case Gain of Uncertain System

Plot the worst-case gain of the following system:

 

The uncertain parameter a = 2 +/- 1. Plot the worst-case gain between 0.1 and 100 rad/s.

a = ureal('a',2); sys = tf([1 3 0],[1 2 a]); wcgainplot(sys,{.1 100}) 

The Worst curve identifies the single response within the uncertainty that yields the highest gain at any frequency. The Worst-case gain (upper bound) curve is the envelope produced by finding the highest gain within the uncertainty at each frequency.

collapse all

### Algorithms

wcgainplot uses wcgain to compute the worst-case gains. Use the options argument to wcgainplot to set options for the wcgain algorithm.

wcgainplot uses usample to compute the Sampled Uncertainty curves.