summaryrefslogtreecommitdiff
path: root/Working_Examples/3432/CH5/EX5.7
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/CH5/EX5.7
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/CH5/EX5.7')
-rwxr-xr-xWorking_Examples/3432/CH5/EX5.7/DEPENDENCIES/fig_settings.sci9
-rwxr-xr-xWorking_Examples/3432/CH5/EX5.7/Ex5_7.sce116
-rwxr-xr-xWorking_Examples/3432/CH5/EX5.7/Ex5_7_f0.pdfbin0 -> 26278 bytes
-rwxr-xr-xWorking_Examples/3432/CH5/EX5.7/Ex5_7_f1.pdfbin0 -> 30674 bytes
4 files changed, 125 insertions, 0 deletions
diff --git a/Working_Examples/3432/CH5/EX5.7/DEPENDENCIES/fig_settings.sci b/Working_Examples/3432/CH5/EX5.7/DEPENDENCIES/fig_settings.sci
new file mode 100755
index 0000000..5d5e7d4
--- /dev/null
+++ b/Working_Examples/3432/CH5/EX5.7/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/CH5/EX5.7/Ex5_7.sce b/Working_Examples/3432/CH5/EX5.7/Ex5_7.sce
new file mode 100755
index 0000000..756952f
--- /dev/null
+++ b/Working_Examples/3432/CH5/EX5.7/Ex5_7.sce
@@ -0,0 +1,116 @@
+//Example 5.7
+//Root locus for satellite control with a Collocated Flexibility.
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+
+//------------------------------------------------------------------
+//System transfer function with controller.
+
+s=poly(0,'s');
+NumD=(s+1);
+DenD=(s+12);
+D=NumD/DenD;
+
+NumG=(s+0.1)^2+36
+DenG=s^2*((s+0.1)^2+(6.6)^2)
+
+G=NumG/DenG;
+
+NumL=NumD*NumG;
+DenL=DenD*DenG;
+
+L=NumL/DenL;
+
+zr=roots(NumL);
+pl=roots(DenL);
+
+//------------------------------------------------------------------
+//Angle of departure.
+//Find angle of departure from pole at phi1= - 0.1 + 6.6i
+//(real poles don't have angle of departure,
+//they move along real axis only)
+//psi1=angle[(Departing pole)- (zero at - 0.1 + 6.6i)]
+[Mpsi1, psi1] = polar(pl(2)-zr(1))
+psi1=real(psi1)*180/%pi; //angle in degree
+
+//psi2=angle[(Departing pole)- (zero at - 0.1 - 6.6i)]
+[Mpsi2, psi2] = polar(pl(2)-zr(2))
+psi2=real(psi2)*180/%pi; //angle in degree
+
+//psi3=angle[(Departing pole)- (zero at - 1)]
+[Mpsi3, psi3] = polar(pl(2)-zr(3))
+psi3=real(psi3)*180/%pi; //angle in degree
+
+//phi2=angle[(Departing pole)- (pole at 0)]
+[Mphi2, phi2] = polar(pl(2)-pl(4))
+phi2=real(phi2)*180/%pi; //angle in degree
+
+//phi3 is same as phi2, as pole is repeated at 0.
+phi3=phi2;
+
+//phi4=angle[(Departing pole)-(pole at - 0.1 - 6.6i )]
+[Mphi4, phi4] = polar(pl(2)-pl(3))
+phi4=real(phi4)*180/%pi; //angle in degree
+
+//phi5=angle[(Departing pole)- (pole at - 12 )]
+[Mphi5, phi5] = polar(pl(2)-pl(1))
+phi5=real(phi5)*180/%pi; //angle in degree
+
+//Therefore angle of departure phi1 at - 0.1 + 6.6i is
+//phi1 = 180 + sum(angle to zeros) - sum(angle to poles)
+
+phi1 = 180 + sum(psi1+psi2+psi3) - sum(phi2+phi3+phi4+phi5)
+
+//angle contributions in figure
+figure(0)
+plzr(L)
+xset('font size',1.5)
+xarrows([real(pl(1));real(pl(2))],[imag(pl(1));imag(pl(2))],0,2)
+xarc(-13,1,2,2,0,phi5*64)
+xstring(-11,0.05,"$\phi_5$")
+
+
+xarrows([real(zr(3));real(pl(2))],[imag(zr(3));imag(pl(2))],0,4)
+xarc(-2,1,2,2,0,psi3*64)
+xstring(-0.7,1,"$\psi_3$")
+
+xarrows([real(pl(4));real(pl(2))],[imag(pl(4));imag(pl(2))],0,5)
+xarc(-1,1,2,2,0,phi2*64)
+xstring(0.8,0.5,"$\phi_2,\,\phi_3$")
+
+
+xarrows([real(pl(3));real(pl(2))],[imag(pl(3));imag(pl(2))],0,3)
+xarc(-1,-6.6,2,2,0,phi4*64)
+xstring(0.8,-7,"$\phi_4$")
+
+xarrows([real(zr(2));real(pl(2))],[imag(zr(2));imag(pl(2))],0,6)
+xarc(-1,-5,2,2,0,psi2*64)
+xstring(0.8,-5.5,"$\psi_2$")
+
+xarrows([real(zr(1));real(pl(2))],[imag(zr(1));imag(pl(2))],0,24)
+xstring(0.3,5.5,"$\psi_1$")
+xstring(0.3,6.5,"$\phi_1$")
+
+exec .\fig_settings.sci; //custom script for setting figure properties
+title(['Figure for computing a departure angle for',...
+'$L(s)=\frac{s+1}{s+12}\frac{(s+0.1)^2+6^2}{s^2[(s+0.1)^2+6.6^2]}$'],...
+'fontsize',3)
+zoom_rect([-15 -8 5 8])
+h=legend('');
+h.visible = "off"
+
+//------------------------------------------------------------------
+//Root locus system transfer function with controller.
+figure(1)
+evans(L)
+//Title, labels and grid to the figure
+exec .\fig_settings.sci; //custom script for setting figure properties
+title(['Root locus for','$L(s)=\frac{s+1}{s+12}\frac{(s+0.1)^2+6^2}...
+{s^2[(s+0.1)^2+6.6^2]}$'],'fontsize',3)
+zoom_rect([-15 -8 5 8])
+h=legend('');
+h.visible = "off"
+
+//------------------------------------------------------------------
diff --git a/Working_Examples/3432/CH5/EX5.7/Ex5_7_f0.pdf b/Working_Examples/3432/CH5/EX5.7/Ex5_7_f0.pdf
new file mode 100755
index 0000000..a336a69
--- /dev/null
+++ b/Working_Examples/3432/CH5/EX5.7/Ex5_7_f0.pdf
Binary files differ
diff --git a/Working_Examples/3432/CH5/EX5.7/Ex5_7_f1.pdf b/Working_Examples/3432/CH5/EX5.7/Ex5_7_f1.pdf
new file mode 100755
index 0000000..9bbc5ea
--- /dev/null
+++ b/Working_Examples/3432/CH5/EX5.7/Ex5_7_f1.pdf
Binary files differ