Problem: Compute the gain and phase margins of the open-loop discrete linear time system from its continuos time S transfer function defined by
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.
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.
Nasser M. Abbasi