summaryrefslogtreecommitdiff
path: root/1430/CH9/EX9.9/exa9_9.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1430/CH9/EX9.9/exa9_9.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '1430/CH9/EX9.9/exa9_9.sce')
-rw-r--r--1430/CH9/EX9.9/exa9_9.sce42
1 files changed, 42 insertions, 0 deletions
diff --git a/1430/CH9/EX9.9/exa9_9.sce b/1430/CH9/EX9.9/exa9_9.sce
new file mode 100644
index 000000000..8c62d3e37
--- /dev/null
+++ b/1430/CH9/EX9.9/exa9_9.sce
@@ -0,0 +1,42 @@
+//Example 9.9
+// Natural response of a Phase-Shift Oscillator
+// Continued from textbook example 9.7
+C=2*10^-6;
+R=100;
+L=10*10^-3;
+K=poly(0,'K'); // Variable gain K
+alpha=(R/(2*L))*(L/(R^2*C)+1-K);
+omega_0=sqrt(2/(L*C));
+K=roots(alpha);
+alpha=horner(alpha,K)
+// Since this is the case of underdamped response
+//Assume value for A_1 for illustration
+A1=complex(0,1.974)
+A1_m=abs(A1);
+phase_A1=atan(imag(A1),real(A1));
+t=0:0.01:1
+t1=0:0.0001:0.02
+v_out1=2*A1_m*cos(omega_0*t+phase_A1) // Underdamped response case1
+K1=1; // New value of gain
+alpha1=(R/(2*L))*(L/(R^2*C)+1-K1);
+omega_d1=sqrt(omega_0^2-alpha1^2);
+v_out2=2*A1_m*%e^(-alpha1*t1).*cos(omega_d1*t1+phase_A1);
+K2=2;
+alpha2=(R/(2*L))*(L/(R^2*C)+1-K2);
+omega_d2=sqrt(omega_0^2-alpha2^2)
+v_out3=2*A1_m*%e^(-alpha2*t1).*cos(omega_d2*t1+phase_A1)
+subplot(3,1,1)
+plot(t,v_out1)
+xlabel('t')
+ylabel('v_out1(t)')
+title('Underdamped case 1')
+subplot(3,1,2)
+plot(t1,v_out2)
+xlabel('t')
+ylabel('v_out1(t)')
+title('Underdamped case 2')
+subplot(3,1,3)
+plot(t1,v_out3)
+xlabel('t')
+ylabel('v_out1(t)')
+title('Underdamped case 3')