from __future__ import division
from math import log10
t=20
C=8*10**-10
E=200
e=150
a=log10(E/e)
R=(0.4343*t)/(C*a)*10**-6
print "Insulation resistance = %.2f mega-ohm"%(R)
t=600
C=2.5*10**-12
E=500
e=300
a=log10(E/e)
R=(0.4343*t)/(C*a)
print "Insulation resistance=%.2f mega-ohm"%(R/1e6)
from math import log
#V=Eexp(-t/tc) where tc= RC=Time constant
t=30
V=125
E=200
tc=-30/log(V/E)
R=(7/15)*tc-7
print "Insulation resistance=%.2f mega-ohm"%(R)
Q=3000
S=0.1
M=2000
X=Q*S/M
print "The value of X=%.2f ohm"%(X)
lx=55
ly=100-lx
Y=100
X=Y*(lx/ly)
print "Resistance of the field coil=%.2f ohm"%(X)
p=200.7
q=400
S=200.05*10**-6
P=200.5
Q=400
r=1400*10**-6
X=((P*S/Q)+((q*r)/(p+q))*((P/Q)-(p/q)))*10**6
print "Unknown resistance=%.2f micro-ohm"%(X)
E=230
V1=60
V2=40
Rv=50000
R1=((E-(V1+V2))/V2)*Rv*10**-3
print "Resistance between positive and earth=%.2f Kohm"%(R1)
R2=((E-(V1+V2))/V1)*Rv*10**-3
print "\nResistance between -ve and earth=%.2f Kohm"%(R2)
Q=100.5
M=300
q=100.6
m=300.25
r=0.1
S=0.0045
X=((M*S/Q)+((r)/(r+m*q))*((M*q/Q)-(m)))*10**6
print "Unknown resistance=%.2f micro-ohm"%(X)