diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3432/CH3/EX3.4 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3432/CH3/EX3.4')
-rw-r--r-- | 3432/CH3/EX3.4/Ex3_4.sce | 65 | ||||
-rw-r--r-- | 3432/CH3/EX3.4/Ex3_4_f0.pdf | bin | 0 -> 23237 bytes | |||
-rw-r--r-- | 3432/CH3/EX3.4/Ex3_4_f1.pdf | bin | 0 -> 20300 bytes |
3 files changed, 65 insertions, 0 deletions
diff --git a/3432/CH3/EX3.4/Ex3_4.sce b/3432/CH3/EX3.4/Ex3_4.sce new file mode 100644 index 000000000..dacf05a5f --- /dev/null +++ b/3432/CH3/EX3.4/Ex3_4.sce @@ -0,0 +1,65 @@ +//Example 3.4
+//Frequency response
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+//(a) Frequency response of 1/(s+k)
+k=1;
+fmin=1e-2;
+fmax=1e2;
+// Transfer function
+s=poly(0,'s');
+sysH=syslin('c',1/(s+k))
+
+//Frequency response for k=1
+//Note that - magnitude plot semilog plot unlike log-log plot in the book.
+bode(sysH,fmin,fmax)
+title('Frequency response for k=1','fontsize',3)
+
+//------------------------------------------------------------------
+//(b) Response to u=sin(10*t);
+t=0:0.02:10;
+u=sin(10*t);
+y=csim(u,t,sysH);
+figure, plot(t,y)
+
+//Title, labels and grid to the figure
+exec .\fig_settings.sci; // custom script for setting figure properties
+title('Complete transient response','fontsize',3)
+xlabel('Time (sec.)','fontsize',2)
+ylabel('Output','fontsize',2)
+
+//phase lag
+figure, plot(t,y)
+plot(t,u,'r')
+zoom_rect([9 -1 10 1])
+exec .\fig_settings.sci; // custom script for setting figure properties
+title('Phase lag between output and input','fontsize',3)
+xlabel('Time (sec.)','fontsize',2)
+ylabel('Output, Input','fontsize',2)
+h=legend('y(t)','u(t)')
+h.legend_location = "in_upper_right"
+h.fill_mode='off'
+
+// time lag
+w=find(t>=9.4 & t<=10);
+T=t(w);
+Y=y(w);
+U=u(w);
+wu=find(U==max(U))
+wy=find(Y==max(Y))
+
+//Responses
+plot2d3(T(wy),Y(wy))
+plot2d3(T(wu),U(wu))
+delta_t=T(wu)-T(wy); //time lag sec.
+xstring(9.64,-0.1,"$\delta t$",0,0)
+xarrows([9.58;9.72], [0;0], 0.7, 1)
+xarrows([9.72;9.58], [0;0], 0.7, 1)
+t=get("hdl")
+disp(abs(delta_t), "Time lag of output in sec. is")
+disp(abs(delta_t)*10, "Phase lag of output in radians is")
+
+//------------------------------------------------------------------
diff --git a/3432/CH3/EX3.4/Ex3_4_f0.pdf b/3432/CH3/EX3.4/Ex3_4_f0.pdf Binary files differnew file mode 100644 index 000000000..8910b81c6 --- /dev/null +++ b/3432/CH3/EX3.4/Ex3_4_f0.pdf diff --git a/3432/CH3/EX3.4/Ex3_4_f1.pdf b/3432/CH3/EX3.4/Ex3_4_f1.pdf Binary files differnew file mode 100644 index 000000000..1a5b20a54 --- /dev/null +++ b/3432/CH3/EX3.4/Ex3_4_f1.pdf |