%% Disk Model of Gain and Phase Variation
% The uncertainty disk F is parameterized by two values: α, which sets the size of the disk, and E, which biases the gain variation toward gain increase or decrease. This parameterization is given by:
% F=\frac{1+\alpha \left\lbrack \left(1-E\right)/2\right\rbrack \delta }{1-\alpha \left\lbrack \left(1+E\right)/2\right\rbrack \delta },
% where δ is a normalized uncertainty. (For details, see Stability Analysis Using Disk Margins.) For a given range of gain variation, you can use gm2dm to convert the disk-based gain margin DGM to the α and E values that describe the corresponding disk. diskmarginplot can plot the F disk for a given α,E pair.

DGM = [0.8,2]
[alpha,E] = gm2dm(DGM);
diskmarginplot(alpha,E,'disk')

%
% In this case, E is greater than zero because the disk-based gain range DGM = [0.8,2] includes more gain increase than decrease. E = 0 represents a gain that can increase as much as it can decrease. E < 0 represents a range with more decrease than increase. Plot the F disk for different values of E to see how the gain range (the diameter of the disk) varies with E.

E = [-3,0,3];
diskmarginplot(alpha,E,'disk')

%
% For a fixed E, α controls the size of the disk, and hence the amount of modeled uncertainty. Plot the disk for several values of α at E = 0.

E = 0;
alpha = [0.1,0.333,0.5];
diskmarginplot(alpha,E,'disk')

%
% Copyright 2019 The MathWorks, Inc.