from sympy import Symbol,solve
# Let C1 and C2 be unknown capacities
#C1+C2 = 0.16
#(C1*C2)/(C1 + C2) = 0.03
# from the above 2 equations we get the following polynomial
s = Symbol("s");
p = s**2 -0.16*s +0.0048
# Calculations
c1 = solve(p)[0]
c2 = 0.16-c1
# Results
print 'Thus the capacitance of condensers is %3.2f microF '%(c1)
# Variables
n = 9;
Ko = 8.854*10**-12;
K = 5.;
A = 12.*10**-4;
d = 2.*10**-4;
# Calculations
C = (n-1)*Ko*K*A/d
# Results
print 'Thus the capacitance is %e F'%(C);
#The Answer in the Textbook has a calculation error, hence it doesn't match the answer here.
# Variables
C = 10**-6
V = 10000.
# Calculations
#here C is capacitance and V voltage
E = 1./2*C*V**2
#E is the energy stored in the capacitor
# when the capacitor is discharged all this energy is dissipated as heat in the wire
H = E/4.2
# Results
#H is heat produced in calories math.since 4.2 Joules = 1 calorie
print 'Thus the heat produced is %3.4f calories'%(H)
# Variables
A = 0.02; #surface area of plates in meter square
d = 0.001; #dismath.tance between the plates in meter
C = 4.5*10**-10; #capacitance of the capacitor in farad
#for paralel plate condenser C = KoKA/d
Ko = 8.854*10**-12;
# Calculations
#dielectric consmath.tant K is given by
K = (C*d)/(Ko*A)
V = 15000.; #volatage in volts
Q = C*V # charge on condenser in columb
D = Q/A # electric flux density in columb per meter square
# Results
print 'Thus the electric flux density is %e C/m**2)'%(D)
# Variables
#before inserting the second sheet
d = 0.003; #distacne between plates in m**2
K1 = 6.; # relative permittivity of air
Ko = 8.854*10**-12;
# capacitance C1 = Ko*K1*A/d in Farad
#after inserting the second sheet
d1 = 0.003; #thickness of first sheet in meter
d2 = 0.005; #thickness of second sheet in meter
# Calculations
#K2 is unknown
#C2 = Ko*A/(d1/K1 + d2/K2)
# but given that C2 = (1/3)*C1
#from equations 1,2,3
K2 = (d2*K1)/(3*d-d1)
# math.since Ko*A/(d1/K1 + d2/K2) = Ko*K1*A/3*d
# Results
print 'Thus K2 is %3.4f'%(K2)
# Variables
q1 = 1.; # in coulomb
q2 = 1.; # in coulomb
Eo = 8.854*10**-12; # in Farad per meter
Er = 1.;
d = 1. # in meter
pi = 3.14;
# Calculations
# F is the force between 2 charges in NEWTONS
F = (q1*q2)/(4*pi*Eo*Er*d**2)
# Results
print 'Thus the force between 2 charges is %e'%(F)
import math
# Variables
#q1 = q2 = q
pi = 3.14;
d = 0.2; # in meters
K = 9*10**9; # here K = 1/4*pi*Eo*Er consmath.tant
F = 9.81*10**-1; # in newtons or 10**-1 kgm
# Calculations
q = math.sqrt((F*(d**2))/K)
# Results
print 'Thus charge is %e in coulomb'%(q)