summaryrefslogtreecommitdiff
path: root/3432/CH3/EX3.22/Ex3_22.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3432/CH3/EX3.22/Ex3_22.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-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.22/Ex3_22.sce')
-rw-r--r--3432/CH3/EX3.22/Ex3_22.sce47
1 files changed, 47 insertions, 0 deletions
diff --git a/3432/CH3/EX3.22/Ex3_22.sce b/3432/CH3/EX3.22/Ex3_22.sce
new file mode 100644
index 000000000..b49701f23
--- /dev/null
+++ b/3432/CH3/EX3.22/Ex3_22.sce
@@ -0,0 +1,47 @@
+//Example 3.22 Response Versus Pole Locations, Real Roots
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+//Transfer function
+numH=[1 2];
+denH=[2 3 1];
+Ns=poly(numH,'s','coeff');
+Ds=poly(denH,'s','coeff');
+sysH=syslin('c',Ns/Ds);
+
+//Pole-zero locations
+//Partial fraction method to see the effect of sperated poles
+temp=polfact(Ds);
+p1s=temp(2);
+p2s=temp(3);
+
+//residues at poles
+r1=residu(Ns,p1s,p2s);
+r2=residu(Ns,p2s,p1s);
+
+//Note that - H1(s)+H2(s)=H(s)
+H1s=syslin('c',r1/p1s);
+H2s=syslin('c',r2/p2s);
+
+//impulse response of the H1(s), H2(s) and H(s)
+t=0:0.02:10;
+h1=csim('impuls',t,H1s);
+h2=csim('impuls',t,H2s);
+h=csim('impuls',t,sysH);
+figure,
+plot(t,h1,'r--',t,h2,'m-.', t, h, 'b')
+plot(t,h2,'m-.')
+plot(t,h)
+
+exec .\fig_settings.sci; //custom script for setting figure properties
+title(['impulse response of the system and subsystems with...
+ independent poles.';'(h1(t) is faster than h2(t))'],'fontsize',3)
+xlabel('Time t (sec.)','fontsize',2)
+ylabel('h(t), h1(t), h2(t)','fontsize',2)
+h=legend('h1(t) with pole at -2','h2(t) with pole at -1'...
+,'h(t)=h1(t)+h2(t)')
+h.legend_location = "in_upper_right"
+h.fill_mode='off'
+//------------------------------------------------------------------