Different Results of allmargin() and margin()
31 views (last 30 days)
Show older comments
Hello,
I am currently analyzing the stabiity margins of my MIMO open-loop with 2 inputs (find ol_sys attached) . Therefore I tried both, the margin() and the allmargin() commands.
- allmargin(-ol_sys, Focus=[0.001 Inf]) delivers a low Gain Margin at 0.0414 rad/s, however, the bodeplots of the system do not have a phase transition of -180° at this freqeuncy

- margin(-ol_sys(1,1)) and margin(-ol_sys(2,2)) deliver similar Phase margins, but different GM, which are in line with the corresponding Bode Plots

I am wondering if there is a error in the allmargin() calculation or why there is a different resut. Would be awesome if someone can help me.
Cheers,
Florian
0 Comments
Accepted Answer
Paul
on 22 Apr 2025
Hi Florian,
For a MIMO system, allmargin computes the margins of each loop with all other loops are closed. However, the command margin(-ol_sys(1,1)) doesn't know about any other loops.
Consider
load ol_sys
s = allmargin(-ol_sys,Focus=[0.001,inf]);
These are the margins at the first input with the loop closed on the second input (don't know why they are slightly different than your result)
s(1)
Manually close the second loop
L = feedback(-ol_sys,diag([0 1]));
and compute the margins on the first loop
allmargin(L(1,1),Focus=[0.001,inf])
which yields the same result as above.
margin(L(1,1))
0 Comments
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!