summaryrefslogtreecommitdiff
path: root/1151/CH9/EX9.2/example2.sce
diff options
context:
space:
mode:
Diffstat (limited to '1151/CH9/EX9.2/example2.sce')
-rwxr-xr-x1151/CH9/EX9.2/example2.sce30
1 files changed, 30 insertions, 0 deletions
diff --git a/1151/CH9/EX9.2/example2.sce b/1151/CH9/EX9.2/example2.sce
new file mode 100755
index 000000000..8ae8a0b9b
--- /dev/null
+++ b/1151/CH9/EX9.2/example2.sce
@@ -0,0 +1,30 @@
+s=%s;
+ K=20;//K=20sec^-1
+g = K/(s*(s+2)*(s+20));
+ G= syslin ('c',g)
+fmin =0.01;
+fmax =100;
+bode (G,fmin , fmax )
+show_margins (G)
+xtitle (" uncompensated sys t em")
+[gm , freqGM ]= g_margin (G)
+[pm , freqPM ]= p_margin (G)
+disp(gm ," gain margin=")
+disp(( freqGM *2* %pi)," g a in margin f r e q=");
+disp(pm ," phase margin=")
+disp(( freqPM *2* %pi)," phas e margin f r e q=");
+disp("since the phase margin is greater than desired phase margin system need lag compensator ")
+gc =(5*s +1) /(1+50*s);
+ Gc= syslin ('c',gc);
+disp (Gc ," transfer function of lag compensator=");
+G1=G*Gc
+disp (G1 ," overall transfer function=");
+fmin =0.01;
+ fmax =100;
+bode (G1 ,fmin , fmax );
+show_margins (G1)
+xtitle (" compensated sys t em")
+[gm , freqGM ]= g_margin (G1);
+[pm , freqPM ]= p_margin (G1);
+disp (pm ," phase margin of compensated system=")
+disp (( freqPM *2* %pi)," gain crossover frequency=")