summaryrefslogtreecommitdiff
path: root/Working_Examples/3432/CH9/EX9.5/Ex9_5.sce
diff options
context:
space:
mode:
Diffstat (limited to 'Working_Examples/3432/CH9/EX9.5/Ex9_5.sce')
-rwxr-xr-xWorking_Examples/3432/CH9/EX9.5/Ex9_5.sce50
1 files changed, 50 insertions, 0 deletions
diff --git a/Working_Examples/3432/CH9/EX9.5/Ex9_5.sce b/Working_Examples/3432/CH9/EX9.5/Ex9_5.sce
new file mode 100755
index 0000000..327b8ce
--- /dev/null
+++ b/Working_Examples/3432/CH9/EX9.5/Ex9_5.sce
@@ -0,0 +1,50 @@
+//Example 9.5
+//Changing Overshoot and Saturation nonlinearity.
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+//System transfer function and its root locus
+
+s=poly(0,'s');
+num=(s+1)
+den=(s^2);
+Gs=syslin('c',num/den)
+
+//Root locus
+evans(Gs,5)
+title(["Root locus of", "$(s+1)/(s^2)$","with saturation removed"],...
+'fontsize',3);
+f=gca();
+f.x_location = "origin"
+f.y_location = "origin"
+h=legend('');
+h.visible = "off"
+exec .\fig_settings.sci; //custom script for setting figure properties
+//------------------------------------------------------------------
+// Step response
+K=1;
+i=[2 4 6 8 10 12];
+figure(1);
+importXcosDiagram(".\Ex9_5_model.xcos")
+
+for r=i
+xcos_simulate(scs_m,4);
+scs_m.props.context
+plot(yt.time,yt.values)
+end
+
+xlabel('time');
+ylabel('y');
+title("Step response of the system for various input sizes",'fontsize',3);
+exec .\fig_settings.sci; //custom script for setting figure properties
+
+xset('font size',3);
+xstring(4,2.5,"$r=2$");
+xstring(6,5.5,"$4$");
+xstring(8,8.7,"$6$");
+xstring(10,12.2,"$8$");
+xstring(12,15.4,"$10$");
+xstring(14,18.4,"$12$");
+//------------------------------------------------------------------