summaryrefslogtreecommitdiff
path: root/1319/CH1/EX1.38/1_38.sce
diff options
context:
space:
mode:
Diffstat (limited to '1319/CH1/EX1.38/1_38.sce')
-rw-r--r--1319/CH1/EX1.38/1_38.sce56
1 files changed, 56 insertions, 0 deletions
diff --git a/1319/CH1/EX1.38/1_38.sce b/1319/CH1/EX1.38/1_38.sce
new file mode 100644
index 000000000..63b7979bb
--- /dev/null
+++ b/1319/CH1/EX1.38/1_38.sce
@@ -0,0 +1,56 @@
+// Determine the instantaneous energy stored in the capacitor and inductor
+
+clc;
+clear;
+
+Vc=20*sqrt(2);
+C=2; // Capacitor
+L=1; // Inductor
+w=poly(0,'w');
+
+// Impedances in order from let to right (as a function of w)
+R1=%i*w;
+R2=1/(2*%i*w); // Top
+R3=1;// Bottom
+
+Rp=R2*R3/(R2+R3); // Effective resistance of the parallel path
+
+Reff=R1+Rp; // Effective resistance
+
+Reff(2)=Reff(2)*conj(Reff(3));
+Reff(3)=Reff(3)*conj(Reff(3));
+
+R=imag(Reff(2))/Reff(3); // Imaginary part of the above equation
+
+//From the above equation we get five roots, three are zero and we take the positive value
+w=roots(R(2));
+w=abs(w(2)); // Numerical Value
+
+// Impedances in order from let to right (Numerical Value)
+R1=%i*w;
+R2=1/(2*%i*w); // Top
+R3=1;// Bottom
+
+Vcrms=Vc/sqrt(2);
+
+// Taking Vc as reference
+
+Ic=Vcrms/R2; // Current through Capacitor
+Ir=Vcrms/R3; // Current through Resistor
+
+Il=Ic+Ir; // Rms value of Current through Inductor
+tl=atand(imag(Il)/real(Il)); // Phase angle of Inductor Current
+
+Ilmax=abs(Il)*sqrt(2); // Maximum Current
+
+Eins=C*(Vc^2)/2; // Magnitude of Instaneous energy stored
+
+Ein=L*(abs(Ilmax)^2)/2; // Energy through the inductor
+Er=(Ir^2)*R3; // Loss in the resistor
+
+Q0= w*Ein*(1+(1/sqrt(2)))/Er; // Q of the circuit
+
+printf('a) Instaneous Energy Stored in Capacitor = %g (sin(%gt)^2) \n',Eins,w)
+printf(' Instaneous Energy Stored in Inductor = %g (sin( %gt + %g)^2) \n',Ein,w,tl)
+printf('b) Q of the circuit = %g \n',Q0)
+