blob: 84b38f59a9387d171a31a5fe5877dbccf003692c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
clear
//Given
C1=16*10**-6 // F
C2=4 //micro F
V1=100 //V
Cp=20*10**-6 //f
//Calculation
q=C1*V1
U1=0.5*C1*V1**2
V=q/Cp
U2=0.5*Cp*V**2
//Result
printf("\n (i) Potential difference across the capacitor is %0.3f Volts", V)
printf("\n (ii) The electrostatic energies before and after the capacitors are connected %0.3f J",U2)
|