Different margins using Bode and allmargin

10 views (last 30 days)
Patrick Snitjer
Patrick Snitjer on 19 Dec 2022
Answered: Paul on 19 Dec 2022
I have this weird problem that I cannot wrap my head around.
I have a transfer function of which I would like to know the stability margins.
Using the bode plot, the minnimum gain margin is 21 dB at a frequency of 6.9e3 rad/s. Using the allmargin function (and the standard margin function), the smallest gain margin is given as 11 dB at 6.9e3 rad/s.
Looking further, all of the frequencies of the margins are the same between the bode and margin functions, but the margins themselves differ. Except the phase margin, which is similar.
Which one can I trust the most?

Answers (1)

Paul on 19 Dec 2022
allmargin returns the gain margin in absolute units, not dB. Converting the allmargin result to dB yields:
ans = 20.9583
margin also returns the output argument Gm in absolute units, though it displays in dB if using the no-output form to show the Bode plot.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by