9 How to compute the gain and phase margins of the open-loop discrete linear time system from its Z transfer function?

Problem: Compute the gain and phase margins of the open-loop discrete linear time system from its continuos time S transfer function defined by

$\displaystyle H(s)=\frac{1+s}{s^{2}+s+1}%
$

.

comment: Mathematica step plot result does not show the staircase effect as shown in MATLAB plot as a result of the zero hold method, In addition, in Mathematica I found it harder to extract result of the call to the function that calculates the phase and gain margins. I was not able to find documentation on what the function GainPhaseMargins in Mathematica actually returns. By inspection it seems to return 2 lists, the first list contains the gain and phase, and the second list the corresponding frequencies. This needs to be better documented by Mathematica.

Also, the gain and phase margin result by Mathematica does not match that of MATLAB except for the frequency for the phase margin. I found the MATLAB function margin better documented than the Mathematica GainPhaseMargin function.

Image mma_e9
Mathematica solution

Image matlab_e9
Matlab solution

The following shows how to solve this problem in Mathematica to show the staircase effect in the plot of the response without the need to use the ControlSystems package.

Image mma_e9NotUsingControlsystem
Mathematica solution showing the stair effect.

Nasser M. Abbasi
http://12000.org