diff options
Diffstat (limited to '842/CH11/EX11.9/Example11_9.sce')
-rwxr-xr-x | 842/CH11/EX11.9/Example11_9.sce | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/842/CH11/EX11.9/Example11_9.sce b/842/CH11/EX11.9/Example11_9.sce new file mode 100755 index 000000000..af628cd35 --- /dev/null +++ b/842/CH11/EX11.9/Example11_9.sce @@ -0,0 +1,22 @@ +//clear//
+//Example 11.9:Gain and Phase Margins and their
+//associated cross over frequencies
+s =poly(0,'s'); // Define ss as polynomial variable
+//Create s transfer function in forward path
+F = syslin('c',[(4*(1+0.5*s))/(s*(1+2*s)*(1+0.05*s+(0.125*s)^2))])
+B = syslin('c',(1+0*s)/(1+0*s))
+OL = F*B;
+fmin = 0.01; // Min freq in Hz
+fmax = 10; // Max freq in Hz
+scf(1);
+//clf;
+// Plot frequency response of open loop transfer function
+bode(OL,0.01,10);
+// display gain and phase margin and cross over frequencies
+show_margins(OL);
+[gm,fr1] = g_margin(OL)
+[phm,fr2] = p_margin(OL)
+disp(gm,'gain margin in dB')
+disp(fr1,'gain cross over frequency in Hz')
+disp(phm,'phase margin in dB')
+disp(fr2,'phase cross over frequency in Hz')
|