How can I calculate the phase margin and/or the gain margin in a Matlab m-script?


% Phase and gain margin can be read from the bode plot.
%
%% For demonstration purpose we first define an arbitrary open loop proces
s=tf('s');
Hopen=2/((s+1)*(s+2)*(s+3));
% create a figure handle that is not likely to be used already
% and plot the bode diagram
figure(100);
bode(Hopen);
grid on;
%
%% Compute the margins with the margin function as follows:
[Gm,Pm,Wgm,Wpm] = margin(Hopen);
% display the results
disp(['Gain margin is : ', num2str(Gm), ' at ', num2str(Wgm), ' rad/s']);
disp(['Phase margin is : ', num2str(Pm), ' degrees at ', num2str(Wpm), ' rad/s']);
Laatst bijgewerkt:
2018-03-05 16:56
Auteur:
Harry van der Pol
Revisie:
1.0
Gemiddelde beoordeling:0 (0 Stemmen)

U kunt commentaar op deze vraag geven

Chuck Norris has counted to infinity. Twice.