summaryrefslogtreecommitdiff
path: root/Working_Examples/154/DEPENDENCIES/ch9_7.sce
diff options
context:
space:
mode:
Diffstat (limited to 'Working_Examples/154/DEPENDENCIES/ch9_7.sce')
-rwxr-xr-xWorking_Examples/154/DEPENDENCIES/ch9_7.sce31
1 files changed, 31 insertions, 0 deletions
diff --git a/Working_Examples/154/DEPENDENCIES/ch9_7.sce b/Working_Examples/154/DEPENDENCIES/ch9_7.sce
new file mode 100755
index 0000000..fe7c0cf
--- /dev/null
+++ b/Working_Examples/154/DEPENDENCIES/ch9_7.sce
@@ -0,0 +1,31 @@
+clc
+disp("Example 9.7")
+printf("\n")
+
+printf("Given")
+disp("Resistance is 10ohm and Capacitance is 0.2F")
+disp("Applied voltage is 10*exp(-2*t)*cos(10*t+30)")
+s=%s;
+//For a RC circuit
+//Applying KVL equation
+//v=i*R+(1/C)*integrate(i*dt) (1)
+//As v=10(30 deg) (2)
+//Equating (1) and (2)
+// Let i=I*exp(s*t) (3)
+// 10(30 deg)*exp(s*t)=10*I*exp(s*t)+(5/s)*I*exp(s*t)")
+//Solving for I
+disp("I=10(30 deg)/10+(5/s)")
+s=-2+%i*10
+a=10+(5/s)
+x=10*cos((30*%pi)/180);
+y=10*sin((30*%pi)/180);
+z=complex(x,y)
+I=z/a
+b=real(I);
+c=imag(I);
+magn=sqrt(b^2+c^2)
+ph=(atan(c/b)*180)/%pi
+//From (3)
+printf("\ni=%0.2f*exp(-2*t)*cos(10t+%3.1f deg) (A)\n",magn,ph);
+
+