import math
q1=q2=0.1
r=1
e=8.84*(10**-12)
E=(q1*q2)/float(4*3.14*e*(r**2))
print "E=",format(E,'.2f'),"N"
import math
#given
q1=2*(10**-9)
q2=3*(10**-9)
#q1 and q2 are 6m apart in air
#on substituting the values in the formula for calculating force between q and q1 and q and q2 we get 9[(3/(6-x**2)-(2/(x**2)))]
import sympy as sp
x=sp.Symbol('x')
sp.integrate(((3/(6-x)**2)-(2/x**2)),x)
from scipy.integrate import quad
import scipy.integrate
def f(x):
return -(x+12)/(x**2 - 6*x)
i=quad(f,1,4)
print (i[0]),"J"
print "Vab=-vba=5.4V"
#the value obtained is directly given with print
import math
charge=1.6*(10**-19)
iav=1.6*(10**-19)*(10**19) #total charge movement per second
print "iav=",format(iav,'.1f'),"A"
import math
p=30
i=10
v=p/i
dt=1
dq=i*dt
dw=v*dq
energy=dw/i
print "energy of each coulomb of charge=",format(energy,'.1f'),"J"
import math
#given
p=15000
n=1500
t=(60*p)/float(1500*2*3.14)
print "torque=",format(t,'.2f'),"Nm"
import math
res=1.72*(10**-8)
l=200
a=25*(10**-6)
R=(res*l)/float(a)
print "R=",format(R,'.4f'),"ohm"
import math
#given and derived
meanrad=0.08
meanlen=3.14*meanrad
a=0.04*0.04
res=1.72*(10**-8)
R=(res*meanlen)/float(a)
print "R=",format(R,'.8f'),"ohm"
import math
res=0.02*(10**-6)
l=4000*80*(10**-2)
a=0.8*(10**-6)
R=(res*l)/float(a)
print "R=",format(R,'.4f'),"ohm"
power=(230*230)/float(80)
print "power=",format(power,'.2f'),"W"
import math
lal=7.5
lcu=6
rcu=0.017*(10**-6)
ral=0.028*(10**-6)
d=(10**-6)
a=((3.14*d))/float(4)
Ral=(lal*ral)/float(a)
print "R=",format(Ral,'.4f'),"ohm"
ial=3
pv=Ral*ial
Rcu=pv/float(2)
print Rcu
a=(rcu*lcu)/float(Rcu)
dcu=(((a*4)/3.14)**0.5)
print "dcu=",format(dcu,'.6f'),"nm"
import math
#given and derived
a=100/0.32 #area required to dissipate 100W power
d=5
#length of cyclinder L,length of wire if l,diameter of the wire is d
L=a/float(3.14*d)
r=100/1**2
#spacing is d cm
#distance along the axis of the cylinder is 2d cm
#no of turns is 10/d
#length of one turn of the wire is 3.14*5 cm
#length of the wire is 50*3.14/d
res=10**-4
#d=(((2*10**-4))**(0.6))
d=0.058
l=(50*3.14)/d
print "l=",format(l,'.6f'),"cm"
import math
#given
v=250
i=5
i1=3.91
t0=0.00426 #temperature coefficient
r15=v/i #at 15 degrees
rt=v/i1 #at t degrees
l=(rt*(1+t0*15))/50 #left hand side
t=(l-1)/t0
print "t=",format(t,'.2f'),"centigrade"
import math
#this is a derivation by substitution problem
#al1=al0/(1+al0*t1)
#al2=al0/(1+al0*t2)
#where t1 and t2 are different temperatures al0,al1 and al2 are temperature coefficients
#substitute al0 in al2
#on deriving and solving for al2 we get,
print "al2=al1/(1+al1*(t1-t2))"
import math
#values are obtained from the graph
i=10 #10t A for 0 to 1 second
d=10 #where di/dt is 10
L=2
# at one second
v=L*d
print "v=",format(v,'.1f'),"v"
#for 1 to 5 seconds
d=-5
#at t=3 seconds voltage across the inductor is
v=L*d
print "v=",format(v,'.1f'),"v"
import math
#given
dv=20 #dv/dt
c=25*(10**-6)
#case a
i=c*dv
print "i=",format(i,'.4f'),"A"
#case b
q=c*dv
print "q=",format(q,'.4f'),"C"
#case c
p=dv*i
print "p=",format(p,'.4f'),"W"
#case d
v=dv**2
wc=(c*v)/2
print "wc=",format(wc,'.4f'),"J"
import math
l=1
b=1.5
i=50
u=5
#case a
f=b*i*l
print "f=",format(f,'.1f'),"N"
#case b
p=f*u
print "p=",format(p,'.1f'),"W"
#case c
e=b*l*u
print "e=",format(e,'.1f'),"V"
import math
#e=b*l*u*sin(angle)
b=0.5
l=40
u=1.5
#when angle=90 sin(90)=1=s
s=1
e=b*l*u*s
print "e=",format(e,'.1f'),"V"
#when angle=30 sin(angle)=s=0.5
s=0.5
e=b*l*u*s
print "e=",format(e,'.1f'),"V"
import math
#applying kcl to circuit at node b i3+i4=6-4=2
i3=i4=1 #potential of node b with respect to node c
vb=8
vba=2 #voltage drop across nodes b and a
va=6 #potential of node a w.r.t note c
i2=3
#applying kcl to node a
isa=1
vs=va+2*isa
print "vse=",format(vs,'.1f'),"V"