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.23/Ex3_23.sce | |
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.23/Ex3_23.sce')
-rw-r--r-- | 3432/CH3/EX3.23/Ex3_23.sce | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/3432/CH3/EX3.23/Ex3_23.sce b/3432/CH3/EX3.23/Ex3_23.sce new file mode 100644 index 000000000..613d47c19 --- /dev/null +++ b/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)
+//------------------------------------------------------------------
|