# 4: Capacitors¶

## Example number 4.1, Page number 91¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
#let x=4*pi*epsilon0
x=1/(9*10**9);

#Calculation
C=x*r;    #capacitance(F)
C=C*10**6;    #capacitance(micro F)

#Result
print "capacitance is",C,"micro F"

capacitance is 750.0 micro F


## Example number 4.2, Page number 91¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
C1=20*10**-6;    #capacitance(F)
V1=500;    #potential(V)
C2=10*10**-6;   #capacitance(F)
V2=200;    #potential(V)

#Calculation
q1=C1*V1;   #charge on 1st capacitor(C)
q2=C2*V2;   #charge on 2nd capacitor(C)
C=C1+C2;   #resultant capacitance(C)
V=(q1+q2)/C;   #combined potential(V)

#Result
print "combined potential is",V,"V"

combined potential is 400.0 V


## Example number 4.3, Page number 92¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
Cp=5;   #resultant capacitance in parallel(micro F)
Cs=1.2;   #resultant capacitance in series(micro F)

#Calculation
C1C2=Cp*Cs;    #product of capacitance(micro F)
C1_C2=math.sqrt((Cp**2)-(4*C1C2));    #difference of capacitance(micro F)
twoC1=Cp+C1_C2;
C1=twoC1/2;
twoC2=Cp-C1_C2;
C2=twoC2/2;

#Result
print "values of capacitors are",C1,"micro F and",C2,"micro F"

values of capacitors are 3.0 micro F and 2.0 micro F


## Example number 4.4, Page number 93¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
C=0.2*10**-6;   #capacitance(F)
V=2;   #potential(V)

#Calculation
U=(1/2)*C*(V**2);    #energy stored(J)

#Result
print "energy stored is",U,"J"

energy stored is 4e-07 J


## Example number 4.5, Page number 93¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
A=1;   #area of plates(m**2)
k=7;   #dielectric constant
d=0.01*10**-2;   #distance between plates(m)
V=300;    #potential(V)
epsilon0=8.85*10**-12;   #dielectric permittivity of free space

#Calculation
C=k*epsilon0*A/d;    #capacitance(F)
E=(1/2)*C*(V**2);    #energy stored in capacitor(J)

#Result
print "energy stored in capacitor is",round(E*10**3,3),"*10**-3 J"

energy stored in capacitor is 27.877 *10**-3 J


## Example number 4.6, Page number 93¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
A=2;    #area(m**2)
d=1*10**-2;   #distance(m)
V0=6000;   #potential(V)
V=2000;    #potential(V)
epsilon0=8.85*10**-12;   #dielectric permittivity of free space

#Calculation
C0=epsilon0*A/d;    #capacitance when there is no dielectric(F)
Q=C0*V0;    #charge on each plate(C)
C=Q/V;      #capacitance when there is dielectric(F)
k=C/C0;   #dielectric constant
E0=V0/d;   #electric field intensity with air medium(V/m)
E=V/d;    #electric field intensity with dielectric(V/m)

#Result
print "capacitance when there is no dielectric is",C0*10**9,"nF"
print "charge on each plate is",Q,"C"
print "capacitance when there is dielectric is",C*10**9,"nF"
print "dielectric constant is",k
print "electric field intensity with air medium is",E0/10**5,"*10**5 V/m"
print "electric field intensity with dielectric is",E/10**5,"*10**5 V/m"

capacitance when there is no dielectric is 1.77 nF
charge on each plate is 1.062e-05 C
capacitance when there is dielectric is 5.31 nF
dielectric constant is 3.0
electric field intensity with air medium is 6.0 *10**5 V/m
electric field intensity with dielectric is 2.0 *10**5 V/m


## Example number 4.7, Page number 95¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
k=5.4;   #dielectric constant
E=10**6;   #electric field intensity(V/m)
A=50*10**-4;   #area(m**2)
epsilon0=8.85*10**-12;   #dielectric permittivity of free space
d=5*10**-3;   #distance(m)

#Calculation
u=(1/2)*k*epsilon0*(E**2);    #energy density(J/m**3)

#Result
print "energy density is",u,"J/m**3"

energy density is 23.895 J/m**3