diff options
author | Siddharth Agarwal | 2019-09-03 18:27:40 +0530 |
---|---|---|
committer | Siddharth Agarwal | 2019-09-03 18:27:40 +0530 |
commit | 8ac15bc5efafa2afc053c293152605b0e6ae60ff (patch) | |
tree | e1bc17aae137922b1ee990f17aae4a6cb15b7d87 /Working_Examples/3432/CH3/EX3.22 | |
parent | 52a477ec613900885e29c4a0b02806a415b4f83a (diff) | |
download | Xcos_block_examples-8ac15bc5efafa2afc053c293152605b0e6ae60ff.tar.gz Xcos_block_examples-8ac15bc5efafa2afc053c293152605b0e6ae60ff.tar.bz2 Xcos_block_examples-8ac15bc5efafa2afc053c293152605b0e6ae60ff.zip |
Diffstat (limited to 'Working_Examples/3432/CH3/EX3.22')
-rwxr-xr-x | Working_Examples/3432/CH3/EX3.22/DEPENDENCIES/fig_settings.sci | 9 | ||||
-rwxr-xr-x | Working_Examples/3432/CH3/EX3.22/Ex3_22.sce | 47 | ||||
-rwxr-xr-x | Working_Examples/3432/CH3/EX3.22/Ex3_22_f0.pdf | bin | 0 -> 43956 bytes |
3 files changed, 56 insertions, 0 deletions
diff --git a/Working_Examples/3432/CH3/EX3.22/DEPENDENCIES/fig_settings.sci b/Working_Examples/3432/CH3/EX3.22/DEPENDENCIES/fig_settings.sci new file mode 100755 index 0000000..5d5e7d4 --- /dev/null +++ b/Working_Examples/3432/CH3/EX3.22/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/CH3/EX3.22/Ex3_22.sce b/Working_Examples/3432/CH3/EX3.22/Ex3_22.sce new file mode 100755 index 0000000..b49701f --- /dev/null +++ b/Working_Examples/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'
+//------------------------------------------------------------------
diff --git a/Working_Examples/3432/CH3/EX3.22/Ex3_22_f0.pdf b/Working_Examples/3432/CH3/EX3.22/Ex3_22_f0.pdf Binary files differnew file mode 100755 index 0000000..52d43ff --- /dev/null +++ b/Working_Examples/3432/CH3/EX3.22/Ex3_22_f0.pdf |