summaryrefslogtreecommitdiff
path: root/Working_Examples/3432/CH3/EX3.25
diff options
context:
space:
mode:
authorSiddharth Agarwal2019-09-03 18:27:40 +0530
committerSiddharth Agarwal2019-09-03 18:27:40 +0530
commit8ac15bc5efafa2afc053c293152605b0e6ae60ff (patch)
treee1bc17aae137922b1ee990f17aae4a6cb15b7d87 /Working_Examples/3432/CH3/EX3.25
parent52a477ec613900885e29c4a0b02806a415b4f83a (diff)
downloadXcos_block_examples-master.tar.gz
Xcos_block_examples-master.tar.bz2
Xcos_block_examples-master.zip
Xcos examples from textbooks and for blocksHEADmaster
Diffstat (limited to 'Working_Examples/3432/CH3/EX3.25')
-rwxr-xr-xWorking_Examples/3432/CH3/EX3.25/DEPENDENCIES/fig_settings.sci9
-rwxr-xr-xWorking_Examples/3432/CH3/EX3.25/Ex3_25.sce52
-rwxr-xr-xWorking_Examples/3432/CH3/EX3.25/Ex3_25_f0.pdfbin0 -> 23307 bytes
3 files changed, 61 insertions, 0 deletions
diff --git a/Working_Examples/3432/CH3/EX3.25/DEPENDENCIES/fig_settings.sci b/Working_Examples/3432/CH3/EX3.25/DEPENDENCIES/fig_settings.sci
new file mode 100755
index 0000000..5d5e7d4
--- /dev/null
+++ b/Working_Examples/3432/CH3/EX3.25/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.25/Ex3_25.sce b/Working_Examples/3432/CH3/EX3.25/Ex3_25.sce
new file mode 100755
index 0000000..3377471
--- /dev/null
+++ b/Working_Examples/3432/CH3/EX3.25/Ex3_25.sce
@@ -0,0 +1,52 @@
+//Example 3.25 Aircraft Response
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+//(a)impulse response of aircraft
+
+//Transfer function of aircraft
+numG=[-6 1];
+denG=[0 13 4 1];
+Ns=30*poly(numG,'s','coeff');
+Ds=poly(denG,'s','coeff');
+u=-1 //impulsive elevator input of 1 degree
+sysG=syslin('c',u*Ns/Ds);
+
+//impulse response
+t=0:0.02:10;
+gt=csim('impuls',t,sysG);
+plot(t,gt)
+exec .\fig_settings.sci; //custom script for setting figure properties
+title('Response of an airplanes altitude to an impulsive elevator input','fontsize',3)
+xlabel('Time (sec.)','fontsize',2)
+ylabel('Altitude (ft)','fontsize',2)
+
+//final value theorem, lim s-->0 in s*G(s)
+s=%s;
+gt_final=horner(s*sysG,0)
+disp(gt_final,"The final value of the output altitude is:")
+//------------------------------------------------------------------
+//(b)response specifications
+
+//damping factor (xi) and natural frequency (wn)
+[wn xi]=damp(sysG);
+wn=wn(2);//natural frequency (wn)
+xi=xi(2);//damping factor
+disp(wn,xi,"Damping factor and natural frequency (rad)...
+ of the response are:")
+
+tr=1.8/wn; //rise time
+disp(tr,"Rise time (sec) of the response is:")
+
+sigma=xi*wn
+ts=4.6/sigma; //settling time
+disp(ts,"Settling time (sec) of the response is:")
+
+Mp=exp(-xi*%pi/sqrt(1-xi^2))
+wd=wn*sqrt(1-xi^2);
+tp=%pi/wd;
+disp(tp, Mp,"Overshoot and time of overshoot (sec)...
+ in the response are:")
+
+//------------------------------------------------------------------
diff --git a/Working_Examples/3432/CH3/EX3.25/Ex3_25_f0.pdf b/Working_Examples/3432/CH3/EX3.25/Ex3_25_f0.pdf
new file mode 100755
index 0000000..0ea8ea8
--- /dev/null
+++ b/Working_Examples/3432/CH3/EX3.25/Ex3_25_f0.pdf
Binary files differ