# To calculate the energy stored in the condenser and polarizing the dielectric
#import module
import math
from __future__ import division
#Variable decleration
C=2; #capacitance in micro farad
C=C*10**-6; #capacitance in farad
V=1000; #voltage in Volts
epsilon_r=100;
#Calculation
W=(C*(V**2))/2;
C0=C/epsilon_r;
W0=(C0*(V**2))/2;
W_0=1-W0;
#Result
print("energy stored in the condenser in Joule is",W);
print("energy stored in the dielectric in Joule is",W_0);
# To calculate the ratio between electronic and ionic polarizability
#import module
import math
from __future__ import division
#Variable decleration
epsilon_r=4.94;
N=2.69; #let n**2 be N
#Calculaion
#(epsilon_r-1)/(epsilon_r+2) = (N*alpha)/(3*epsilon_0)
#alpha = alpha_e+alpha_i
#therefore (epsilon_r-1)/(epsilon_r+2) = (N*(alpha_e+alpha_i))/(3*epsilon_0)
#let (N*(alpha_e+alpha_i))/(3*epsilon_0) be X
X=(epsilon_r-1)/(epsilon_r+2);
#Ez=n^2
#therefore (N-1)/(N+2) = (N*alpha_e)/(3*epsilon_0)
#let (N*alpha_e)/(3*epsilon_0) be Y
Y=(N-1)/(N+2);
#dividing X/Y = (N*(alpha_e+alpha_i))/(N*alpha_e)
#therefore X/Y = 1+(alpha_i/alpha_e)
#let alpha_i/alpha_e be A
R=(X/Y)-1;
R=math.ceil(R*10**4)/10**4; #rounding off to 4 decimals
#Result
print("ratio between electronic and ionic polarizability is",R);
#answer given in the book is wrong in the second part
# To calculate the dielectric constant of the material
#import module
import math
from __future__ import division
#Variable decleration
N=3*10**28; #atoms per m^3
alpha_e=10**-40; #farad m^2
epsilon_0=8.854*10**-12; #f/m
#Calculation
epsilon_r=1+(N*alpha_e/epsilon_0);
epsilon_r=math.ceil(epsilon_r*10**3)/10**3; #rounding off to 3 decimals
#Result
print("dielectric constant of the material is",epsilon_r);
# To calculate the electronic polarizability of He atoms
#import module
import math
from __future__ import division
#Variable decleration
epsilon_0=8.854*10**-12; #f/m
epsilon_r=1.0000684;
#Calculation
N=2.7*10**25; #atoms per m^3
alpha_e=(epsilon_0*(epsilon_r-1))/N;
#Result
print("electronic polarizability of He atoms in Fm^2 is",alpha_e);
# To calculate the capacitance and charge
#import module
import math
from __future__ import division
#Variable decleration
epsilon_0=8.854*10**-12; #f/m
A=100; #area in cm^2
A=A*10**-4; #area in m^2
V=100; #potential in V
d=1; #plate seperation in cm
#Calculation
d=d*10**-2; #plate seperation in m
C=(epsilon_0*A)/d;
Q=C*V;
#Result
print("charge on the plates in F is",C);
print("charge on the capacitor in coulomb is",Q);
# To calculate the resultant voltage across the capacitors
#import module
import math
from __future__ import division
#Variable decleration
Q=2*10**-10; #charge in coulomb
d=4; #plate seperation in mm
d=d*10**-3; #plate seperation in m
epsilon_r=3.5;
epsilon_0=8.85*10**-12; #f/m
A=650; #area in mm^2
#Calculation
A=A*10**-6; #area in m^2
V=(Q*d)/(epsilon_0*epsilon_r*A);
V=math.ceil(V*10**3)/10**3; #rounding off to 3 decimals
#Result
print("voltage across the capacitor in Volts is",V);
# To calculate the dielectric displacement
#import module
import math
from __future__ import division
#Variable decleration
V=10; #potential in volts
d=2*10**-3; #plate seperation in m
epsilon_r=6; #dielectric constant
epsilon_0=8.85*10**-12; #f/m
#Calculation
E=V/d;
D=epsilon_0*epsilon_r*E;
#Result
print("dielectric displacement in cm^-2 is",D);
#answer given in the book is wrong in the 7th decimal point
# To calculate the polarizability and relative permittivity of He
#import module
import math
from __future__ import division
#Variable decleration
R=0.55; #radius of He atom in angstrom
R=R*10**-10; #radius of He atom in m
epsilon_0=8.84*10**-12; #f/m
N=2.7*10**25;
#Calculation
alpha_e=4*math.pi*epsilon_0*R**3;
epsilon_r=(N*alpha_e/epsilon_0)+1;
epsilon_r=math.ceil(epsilon_r*10**6)/10**6; #rounding off to 6 decimals
#Result
print("polarizability in farad m^2 is",alpha_e);
print("relative permitivity is",epsilon_r);
# To calculate the field strength and total dipole moment
#import module
import math
from __future__ import division
#Variable decleration
V=15; #potential difference in volts
C=6; #capacity in micro farad
C=C*10**-6; #capacity in farad
epsilon_0=8.84*10**-12; #f/m
epsilon_r=8;
A=360; #surface area in cm^2
#Calculation
A=A*10**-4; #surface area in m^2
E=(V*C)/(epsilon_0*epsilon_r*A);
d=epsilon_0*(epsilon_r-1)*V*A;
#Result
print("field strength in V/m is",E);
print("total dipole moment in cm is",d);
#answer for field strength E given in the book is wrong
# To calculate the complex polarisability of material
#import module
import math
from __future__ import division
#Variable decleration
epsilonr=4.36; #dielectric constant
t=2.8*10**-2; #loss tangent(t)
N=4*10**28; #number of electrons
epsilon0=8.84*10**-12;
#Calculation
epsilon_r = epsilonr*t;
epsilonstar = (complex(epsilonr,-epsilon_r));
alphastar = (epsilonstar-1)/(epsilonstar+2);
alpha_star = 3*epsilon0*alphastar/N; #complex polarizability(Fm**2)
#Result
print("the complex polarizability in F-m^2 is"'alphastar',alpha_star);
#disp('j',I,R);
#by taking 10^-40 common we get alphastar = (3.5-j0.06)*10^-40 F-m^2