summaryrefslogtreecommitdiff
path: root/2276/CH2/EX2.10/chapter2_ex10.sce
blob: fb60805dce0534c417df95d0bc4b7a4c504820e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
clc
clear

//input
c1=2*(10^-6);// capacitance of first capacitor in farad which is connected in series with second
c2=6*(10^-6);// capacitance of second capacitor in farad which is connected in series with first
v=240;//d.c. voltage supply in volts

//calculations
ct=(c1*c2)/(c1+c2);//effective capacitance in farad
q=ct*v;//total charge in coloumbs
e1=(q^2)/(2*c1);// energy stored in first capacitor in joules
e2=(q^2)/(2*c2);// energy stored in second capacitor in joules

//output
mprintf('the energy stored in first capacitor is %3.10f J \n the energy stored in second capacitor is %3.10f J',e1,e2)