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.29/Ex3_29.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.29/Ex3_29.sce')
-rw-r--r-- | 3432/CH3/EX3.29/Ex3_29.sce | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/3432/CH3/EX3.29/Ex3_29.sce b/3432/CH3/EX3.29/Ex3_29.sce new file mode 100644 index 000000000..2f1871052 --- /dev/null +++ b/3432/CH3/EX3.29/Ex3_29.sce @@ -0,0 +1,40 @@ +//Example 3.29
+//Stability versus parameter range
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+//Stability versus parameter range
+
+numT=[-1];//zeros
+denT=[1 0 -6];//poles
+Ns=poly(numT,'s','roots');
+Ds=poly(denT,'s','roots');
+Gfs=syslin('c',Ns/Ds); //forward transfer function block
+
+num=[1];
+den=[1 0];
+Ns=poly(num,'s','coeff');
+Ds=poly(den,'s','coeff');
+Hs=syslin('c',Ns/Ds); //feedback transfer function block
+
+//check the step responses with the forward path gain K=7.5, 13, 25
+t=0:0.02:12;
+i=1;
+
+for K=[7.5, 13, 25]
+ sysT= (K * Gfs) /. Hs;
+ yt(i,:)=csim('step',t,sysT);
+ i=i+1;
+end
+//Step response
+plot(t',yt')
+exec .\fig_settings.sci; //custom script for setting figure properties
+title("Transient response for different values of K",'fontsize',3);
+xlabel('Time t (sec.)','fontsize',2)
+ylabel('y(t)','fontsize',2)
+h=legend('K=7.5','K=13', 'K=25')
+h.legend_location = "in_upper_right"
+h.fill_mode='off'
+//------------------------------------------------------------------
|