Created
September 26, 2012 13:45
-
-
Save KitWallace/3788136 to your computer and use it in GitHub Desktop.
Potential due to a current source and sink -
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def distance(x=0,y=0,z=0) : | |
return math.sqrt(x*x + y*y + z*z) | |
def monopole_potential(Io,sigma,r) : | |
""" compute the potential in volts at a distance r from a monopole current source | |
Io current in amp | |
sigma - conductivity in ohm-1 m-1 | |
r distance in m | |
dimensionally of the equation is amp / (ohm-1 m-1 m) = amp ohm = volt | |
""" | |
return Io / (4 * math.pi * sigma * r ) | |
# problem from Bioelectricity course Lecture 1 section 11 | |
# 2 mA source and sink 1 mm apart in x direction | |
# resistivity is 100.5 ohm-cm | |
# what is potential at distance 10 mm from one source in the z direction (y= 0) | |
# using the MKS system | |
Io = 2E-3 | |
r-source = 10E-3 | |
d = 1E-3 | |
r-sink = distance(d,0,r-source) | |
rho = 100.5 * 1.0E-2 # ohm-m | |
sigma = 1.0 / rho | |
phi-source = monopole_potential(Io,sigma,r-source) | |
phi-sink = monopole_potential(-Io,sigma,r-sink) | |
phi = phi-source + phi-sink | |
print r-source,r-sink,rho,phi-source,phi-sink,phi,"Volts" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See Lecture 1 section 11 on the Coursera Bioelectricity course https://www.coursera.org/course/bioelectricity