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.23 | |
parent | 52a477ec613900885e29c4a0b02806a415b4f83a (diff) | |
download | Xcos_block_examples-master.tar.gz Xcos_block_examples-master.tar.bz2 Xcos_block_examples-master.zip |
Diffstat (limited to 'Working_Examples/3432/CH3/EX3.23')
-rwxr-xr-x | Working_Examples/3432/CH3/EX3.23/DEPENDENCIES/fig_settings.sci | 9 | ||||
-rwxr-xr-x | Working_Examples/3432/CH3/EX3.23/Ex3_23.sce | 49 | ||||
-rwxr-xr-x | Working_Examples/3432/CH3/EX3.23/Ex3_23_f0.pdf | bin | 0 -> 31974 bytes |
3 files changed, 58 insertions, 0 deletions
diff --git a/Working_Examples/3432/CH3/EX3.23/DEPENDENCIES/fig_settings.sci b/Working_Examples/3432/CH3/EX3.23/DEPENDENCIES/fig_settings.sci new file mode 100755 index 0000000..5d5e7d4 --- /dev/null +++ b/Working_Examples/3432/CH3/EX3.23/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.23/Ex3_23.sce b/Working_Examples/3432/CH3/EX3.23/Ex3_23.sce new file mode 100755 index 0000000..613d47c --- /dev/null +++ b/Working_Examples/3432/CH3/EX3.23/Ex3_23.sce @@ -0,0 +1,49 @@ +//Example 3.23 Oscillatory Time Response
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+//Transfer function of second order underdamped system
+numH=[1 2];
+denH=[5 2 1];
+Ns=poly(numH,'s','coeff');
+Ds=poly(denH,'s','coeff');
+sysH=syslin('c',Ns/Ds);
+
+//damping factor (xi) and natural frequency (wn)
+[wn xi]=damp(sysH);
+wn=wn(1);
+xi=xi(1);
+sigma=xi*wn;
+wd=wn*sqrt(1-xi^2);
+
+//denominator in sigma-wn form H(s)=H1(s)+H2(s)
+s=%s;
+p=(s+sigma)^2+wd^2
+temp=polfact(Ns);
+k=temp(1),zr=temp(2);
+h1=(s+sigma)/p;
+h2=-((s+sigma)-temp(2))*wd/p;
+H1s=syslin('c',k*h1);
+H2s=syslin('c',k*h2/wd);
+
+// responses with exponential envelope
+Env=syslin('c',k/(s+sigma));
+t=0:0.02:10;
+//impulse response
+ht=csim('impuls',t,sysH);
+envt=csim('impuls',t,Env);
+envt_neg=csim('impuls',t,-Env);
+
+plot(t,ht)
+plot(t,envt,'r--')
+plot(t,envt_neg,'r--')
+exec .\fig_settings.sci; //custom script for setting figure properties
+title('Impulse response of the underdamped system','fontsize',3)
+xlabel('Time t (sec.)','fontsize',2)
+ylabel('h(t)','fontsize',2)
+xset("font",1,2)
+xstring(1,0.75,"$e^{-\sigma t}$",0,0)
+xstring(1,-0.85,"$-e^{-\sigma t}$",0,0)
+//------------------------------------------------------------------
diff --git a/Working_Examples/3432/CH3/EX3.23/Ex3_23_f0.pdf b/Working_Examples/3432/CH3/EX3.23/Ex3_23_f0.pdf Binary files differnew file mode 100755 index 0000000..a3886b8 --- /dev/null +++ b/Working_Examples/3432/CH3/EX3.23/Ex3_23_f0.pdf |