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/CH6/EX6.2.b/DEPENDENCIES/fig_settings.sci | 9 +++++++ Working_Examples/3432/CH6/EX6.2.b/Ex6_2.sce | 28 +++++++++++++++++++++ Working_Examples/3432/CH6/EX6.2.b/Ex6_2_f0.pdf | Bin 0 -> 29204 bytes 3 files changed, 37 insertions(+) create mode 100755 Working_Examples/3432/CH6/EX6.2.b/DEPENDENCIES/fig_settings.sci create mode 100755 Working_Examples/3432/CH6/EX6.2.b/Ex6_2.sce create mode 100755 Working_Examples/3432/CH6/EX6.2.b/Ex6_2_f0.pdf (limited to 'Working_Examples/3432/CH6/EX6.2.b') diff --git a/Working_Examples/3432/CH6/EX6.2.b/DEPENDENCIES/fig_settings.sci b/Working_Examples/3432/CH6/EX6.2.b/DEPENDENCIES/fig_settings.sci new file mode 100755 index 0000000..5d5e7d4 --- /dev/null +++ b/Working_Examples/3432/CH6/EX6.2.b/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/CH6/EX6.2.b/Ex6_2.sce b/Working_Examples/3432/CH6/EX6.2.b/Ex6_2.sce new file mode 100755 index 0000000..03eae0b --- /dev/null +++ b/Working_Examples/3432/CH6/EX6.2.b/Ex6_2.sce @@ -0,0 +1,28 @@ +//Example 6.2 +//Frequency response characteristics of Lead compensator. + +xdel(winsid())//close all graphics Windows +clear; +clc; +//------------------------------------------------------------------ +//System transfer function and its bode plot +K=1, T=1, alpha=0.1 +s=poly(0,'s'); +sysD=syslin('c',K*(T*s+1)/(alpha*T*s+1)); + +//The bode plot of the system + +fmin=0.1/2/%pi; //mininmum frq. in Hz for response (0.1 rad/sec) +fmax=100/2/%pi; //maximum frq. in Hz for response (100 read/sec) +//------------------------------------------------------------------ +//Bode plot for frequency in Hz (scilab ver. 5.4.1) +//bode(g,fmin,fmax); +//OR +//Bode plot for frequency in rad/sec (scilab ver. 5.5.1) +bode(sysD,fmin,fmax,"rad") + +//------------------------------------------------------------------ +title('(a) Magnitude and (b) phase for the lead compensator',... +'fontsize',3) +exec .\fig_settings.sci; //custom script for setting figure properties +//------------------------------------------------------------------ diff --git a/Working_Examples/3432/CH6/EX6.2.b/Ex6_2_f0.pdf b/Working_Examples/3432/CH6/EX6.2.b/Ex6_2_f0.pdf new file mode 100755 index 0000000..827a43a Binary files /dev/null and b/Working_Examples/3432/CH6/EX6.2.b/Ex6_2_f0.pdf differ -- cgit