v_bminusv_a=-12
d=0.3*10**-2#in m
E=-(v_bminusv_a)/d
print "The value of E = %0.2f v/m"%E
from math import sqrt
print "solution a"
E=8*10**4#in V/m
d=0.5#in m
delta_V=-E*d
print "Electric potential from A to B = %0.2f V"%delta_V
print "solution b"
q=1.6*10**-19#in C
delta_PE=q*delta_V
print "Change in electric potential = %0.2f joules"%delta_PE
m_p=1.67*10**-27#in kg
vf=sqrt((2*-delta_PE)/m_p)
print "velocity = %0.2f m/s"%vf
k_e=8.99*10**9 #N.m**2/c**2
q1=5*10**-6# in C
q2=-2*10**-6#in C
r1=0.4
r2=0.5
V1=(k_e*q1)/(r1)
V2=(k_e*q2)/(r2)
print "Solution a"
print "Magnitude of V1 = %0.2f v"%V1
print "Magnitude of V2 = %0.2f v"%V2
print "solution b"
vp=V1+V2
print "Magnitude of Vp = %0.2f v"%vp
q3=4*10**-6#in C
w=vp*q3
print "work done = %0.2f Joule"%w
e0=8.85*10**-12#in c2/N.m2
A=2*10**-4#in m2
d=1*10**-3#in m
c=(e0*A)/d
print "Capacitance = %0.2e farad"%c
c1=3*10**-6
c2=6*10**-6
c3=12*10**-6
c4=24*10**-6
delta_v=18
c_eq=c1+c2+c3+c4
print "capacitance = %0.2e farad"%c_eq
q=delta_v*c3
print "voltage between battery = %0.2e c"%q
c1=3*10**-6
c2=6*10**-6
c3=12*10**-6
c4=24*10**-6
delta_v=18
print "solution a"
c_eq=1/((1/c1)+(1/c2)+(1/c3)+(1/c4))
print "capacitance = %0.2e farad"%c_eq
q=delta_v*c_eq
print "solution b"
print "voltage between battery = %0.2e c"%q
c1=4*10**-6
c2=4*10**-6
print "solution a"
c_eq=1/((1/c1)+(1/c2))
print "capacitance = %0.2e farad"%c_eq
Energy=1.2*10**3#in J
c=1.1*10**-4#in f
delta_v=sqrt((2*Energy)/c)
print "solution a"
print "Energy stored = %0.f volt"%delta_v
print "solution b"
Energy_deliverd=600#in j
delta_t=2.5*10**-3#in s
p=(Energy_deliverd)/delta_t
print "power = %0.f watt"%p
k=3.7
e0=8.85*10**-12#in c2/N.m2
A=6*10**-4#in m2
d=1*10**-3#in m
c=(k*e0*A)/d
print "solution a"
print "Capacitance = %0.2e farad"%c
print "solution b"
E_max=16*10**6#in v/m
delta_v_max=E_max*d
print "Voltage = %0.1f volt"%delta_v_max
Q_max=delta_v_max*c
print "Maximum charge = %0.2e columb"%Q_max