summaryrefslogtreecommitdiff
path: root/Working_Examples/293/CH5/EX5.2/eg5_2.sce
diff options
context:
space:
mode:
Diffstat (limited to 'Working_Examples/293/CH5/EX5.2/eg5_2.sce')
-rwxr-xr-xWorking_Examples/293/CH5/EX5.2/eg5_2.sce9
1 files changed, 9 insertions, 0 deletions
diff --git a/Working_Examples/293/CH5/EX5.2/eg5_2.sce b/Working_Examples/293/CH5/EX5.2/eg5_2.sce
new file mode 100755
index 0000000..1010bcd
--- /dev/null
+++ b/Working_Examples/293/CH5/EX5.2/eg5_2.sce
@@ -0,0 +1,9 @@
+C = 10*10^-6 ; //capacitance(in farads)
+R = 0.2*10^6; //resistance (in ohms)
+Vi = 40; //initial voltage of the capacitor (in volts)
+Wc = (1/2)*C*Vi^2; //energy stored in the capacitor
+//current flowing in circuit as a function of time i(t) = 2*10^-4*exp(-t/2)
+//power dissipated in the resistor = R*i^2
+Wr = integrate('R*4*10^-8*exp(-t)','t',0,100)
+disp(Wc,"energy stored in the capacitor(in Joules) = ")
+disp(Wr,"energy dissipated in the resistor(in Joules) = ") \ No newline at end of file