# getDGM

Convert gain and phase variation into disk-based gain variation

## Description

In disk margin analysis, gain and phase variations are modeled as a factor
*F*(*s*) multiplying the open loop response
*L*(*s*). This factor takes values in a disk
*D* centered on the real axis with real-axis intercepts
`gmin`

and `gmax`

. The disk margin determines the largest
disk size `[gmin,gmax]`

for which the feedback loop remains stable. This
provides a gain margin of at least `DGM = [gmin,gmax]`

and also some phase
margin `DPM`

determined by the disk geometry.

Conversely, `getDGM`

takes desired gain and phase margins
`GM`

and `PM`

and computes the smallest disk
*D* that delivers both. This disk is characterized by its real-axis
intercepts `gmin`

, `gmax`

and the corresponding disk-based
gain margin `DGM = [gmin,gmax]`

and phase margin `DPM`

meet
or exceed `GM`

and `PM`

.

For more information about the disk model of gain and phase variation, see Algorithms.

computes the smallest disk that captures the target gain and phase variations specified by
`DGM`

= getDGM(`GM`

,`PM`

,'tight')`GM`

and `PM`

.

If

`GM`

and`PM`

are scalars, then the disk captures gain that can increase or decrease by a factor of`GM`

, and phase that can increase or decrease by`PM`

.If

`GM`

and`PM`

are vectors of the form`[glo,ghi]`

and`[pmin,pmax]`

then the disk captures relative gain and phase variations in these ranges.If either

`GM`

or`PM`

is`[]`

, that removes the corresponding constraint on the disk size.

The output is of the form `DGM`

= `[gmin,gmax]`

, and
describes a disk that represents absolute gain variations within that range. For instance,
`DGM = [0.8,1.8]`

models gain that can vary from 0.8 times the nominal
value to 1.8 times the nominal value, and phase variations determined by the disk geometry.
This disk might have non-zero skew (see Algorithms). Use
`DGM`

to create a `umargin`

block that models these gain
and phase variations.

computes the smallest disk that represents a symmetric gain variation, that is,
`DGM`

= getDGM(`GM`

,`PM`

,'balanced')`DGM`

= `[gmin,gmax]`

where `gmin`

=
`1/gmax`

. This disk has zero skew (see Algorithms).

## Examples

## Input Arguments

## Output Arguments

## Algorithms

`umargin`

and
`diskmargin`

model
gain and phase variations in an individual feedback channel as a frequency-dependent
multiplicative factor *F*(*s*) multiplying the nominal
open-loop response *L*(*s*), such that the perturbed
response is
*L*(*s*)*F*(*s*). The
factor *F*(*s*) is parameterized by:

$$F\left(s\right)=\frac{1+\alpha \left[\left(1-\sigma \right)/2\right]\delta \left(s\right)}{1-\alpha \left[\left(1+\sigma \right)/2\right]\delta \left(s\right)}.$$

In this model,

*δ*(*s*) is a gain-bounded dynamic uncertainty, normalized so that it always varies within the unit disk (||*δ*||_{∞}< 1).*ɑ*sets the amount of gain and phase variation modeled by*F*. For fixed*σ*, the parameter*ɑ*controls the size of the disk. For*ɑ*= 0, the multiplicative factor is 1, corresponding to the nominal*L*.*σ*, called the*skew*, biases the modeled uncertainty toward gain increase or gain decrease.

The factor *F* takes values in a disk centered on the real axis and
containing the nominal value *F* = 1. The disk is characterized by its
intercept `DGM = [gmin,gmax]`

with the real axis. `gmin`

< 1 and `gmin`

> 1 are the minimum and maximum relative changes in gain
modeled by *F*, at nominal phase. The phase uncertainty modeled by
*F* is the range `DPM = [-pm,pm]`

of phase values at the
nominal gain (|*F*| = 1). For instance, in the following plot, the right side
shows the disk *F* that intersects the real axis in the interval [0.71,1.4].
The left side shows that this disk models a gain variation of ±3 dB and a phase variation of
±19°.

```
DGM = [0.71,1.4]
F = umargin('F',DGM)
plot(F)
```

`getDGM`

converts the target gain and phase variations that you want to
model into the disk-based gain-variation range `DGM`

. This range fully
characterizes the disk *F*. The corresponding phase range
`DPM`

is thus determined by `DGM`

and the disk model.

For further details about the uncertainty model for gain and phase variations, see Stability Analysis Using Disk Margins.

## Version History

**Introduced in R2020a**