From 8ac15bc5efafa2afc053c293152605b0e6ae60ff Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Tue, 3 Sep 2019 18:27:40 +0530 Subject: Xcos examples from textbooks and for blocks --- .../3432/CH9/EX9.5/DEPENDENCIES/fig_settings.sci | 9 ++++ Working_Examples/3432/CH9/EX9.5/Ex9_5.sce | 50 +++++++++++++++++++++ Working_Examples/3432/CH9/EX9.5/Ex9_5_f0.pdf | Bin 0 -> 36398 bytes Working_Examples/3432/CH9/EX9.5/Ex9_5_f1.pdf | Bin 0 -> 32641 bytes Working_Examples/3432/CH9/EX9.5/Ex9_5_model.xcos | 1 + 5 files changed, 60 insertions(+) create mode 100755 Working_Examples/3432/CH9/EX9.5/DEPENDENCIES/fig_settings.sci create mode 100755 Working_Examples/3432/CH9/EX9.5/Ex9_5.sce create mode 100755 Working_Examples/3432/CH9/EX9.5/Ex9_5_f0.pdf create mode 100755 Working_Examples/3432/CH9/EX9.5/Ex9_5_f1.pdf create mode 100755 Working_Examples/3432/CH9/EX9.5/Ex9_5_model.xcos (limited to 'Working_Examples/3432/CH9/EX9.5') diff --git a/Working_Examples/3432/CH9/EX9.5/DEPENDENCIES/fig_settings.sci b/Working_Examples/3432/CH9/EX9.5/DEPENDENCIES/fig_settings.sci new file mode 100755 index 0000000..5d5e7d4 --- /dev/null +++ b/Working_Examples/3432/CH9/EX9.5/DEPENDENCIES/fig_settings.sci @@ -0,0 +1,9 @@ +//------------------------------------------------------------------ +//figure handel settings +f=get("current_figure"); //Current figure handle +f.background=8; //make the figure window background white +l=f.children(1); +l.background=8 ;//make the text background white +id=color('grey'); +xgrid(id); +//------------------------------------------------------------------ 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$"); +//------------------------------------------------------------------ diff --git a/Working_Examples/3432/CH9/EX9.5/Ex9_5_f0.pdf b/Working_Examples/3432/CH9/EX9.5/Ex9_5_f0.pdf new file mode 100755 index 0000000..c385950 Binary files /dev/null and b/Working_Examples/3432/CH9/EX9.5/Ex9_5_f0.pdf differ diff --git a/Working_Examples/3432/CH9/EX9.5/Ex9_5_f1.pdf b/Working_Examples/3432/CH9/EX9.5/Ex9_5_f1.pdf new file mode 100755 index 0000000..4bf4aea Binary files /dev/null and b/Working_Examples/3432/CH9/EX9.5/Ex9_5_f1.pdf differ diff --git a/Working_Examples/3432/CH9/EX9.5/Ex9_5_model.xcos b/Working_Examples/3432/CH9/EX9.5/Ex9_5_model.xcos new file mode 100755 index 0000000..3306e45 --- /dev/null +++ b/Working_Examples/3432/CH9/EX9.5/Ex9_5_model.xcos @@ -0,0 +1 @@ + \ No newline at end of file -- cgit