summaryrefslogtreecommitdiff
path: root/Working_Examples/154/DEPENDENCIES/ch2_3.sce
diff options
context:
space:
mode:
Diffstat (limited to 'Working_Examples/154/DEPENDENCIES/ch2_3.sce')
-rwxr-xr-xWorking_Examples/154/DEPENDENCIES/ch2_3.sce35
1 files changed, 35 insertions, 0 deletions
diff --git a/Working_Examples/154/DEPENDENCIES/ch2_3.sce b/Working_Examples/154/DEPENDENCIES/ch2_3.sce
new file mode 100755
index 0000000..cb92e89
--- /dev/null
+++ b/Working_Examples/154/DEPENDENCIES/ch2_3.sce
@@ -0,0 +1,35 @@
+clc
+disp("Example 2.3")
+printf("\n")
+printf("Given")
+disp("Capacitance used is 20uF")
+disp("Voltage is v=50*sin(200*t)")
+C=20*10^-6;
+v=50*sin(200*t);
+vamp=50;
+t=0:0.001:0.015;
+//q=C*v
+qamp=vamp*C
+q=qamp*sin(200*t)
+//i=C*d/dt(v)
+//d/dt(sin 200t)=200*cos t
+iamp=C*vamp*200;
+i=iamp*cos(200*t)
+
+//sinA*cosB=(sin(A+B)+sin(A-B))/2
+
+pamp=vamp*iamp/2;
+p=pamp*sin(400*t)
+
+//On integrating 'p' w.r.t t
+
+wC=12.5*(1-cos(400*t));
+
+figure
+a= gca ();
+plot(t,wC)
+xtitle ('wC vs wt','wt','wC (mJ)');
+a. thickness = 2;
+
+
+