I am a physicist who is trying to model the current-voltage characteristics of a superconductor-superconductor junction.
The equation for this model is:
\begin{align} I(V) = \frac{1}{eR_{\mathrm{n-n}}}\int_{-\infty}^{\infty}\frac{|E|}{[E^{2} - \Delta_{1}^{2}]^{1/2}}\frac{|E + eV|}{[(E + eV)^{2} - \Delta_{2}^{2}]^{1/2}}[f(E) - f(E + eV)]\,\mathrm{d}E \end{align}
Current ($I$ or I
in the code) values are calculated by evaluating this integral for given voltages ($V$, or v
in the code).
I have attempted this in Python. The code is shown below.
from scipy import integrate
from numpy import *
import pylab as pl
import math
ec = 1.6021764*10**(-19)
r = 2500
gap = 200*10**(-6)*ec
g = (gap)**2
t = 0.04
k = 1.3806503*10**(-23)
kt = k*t
v_values = arange(0,0.001,0.00001)
I=[]
for v in v_values:
result, error = integrate.quad (lambda E:(abs(E)/sqrt((E**2-g)))*(abs(E+ec*v)/(sqrt(((E+ec*v)**2-g))))*(math.exp(-E/kt)*(math.exp(-ec*v/kt)-1)),(-inf),(-gap*0.9-ec*v))
I.append(result)
I = array(I)
I2=[]
for v in v_values:
result2 = integrate.quad(lambda E:(abs(E)/sqrt((E**2-g)))*(abs(E+ec*v)/(sqrt(((E+ec*v)**2-g))))*(math.exp(-E/kt)*(math.exp(-ec*v/kt)-1)),(gap*0.9),(inf))
I2.append(result2)
I2 = array(I2)
pl.plot(v_values,I,'-b',v_values,I2,'-r')
pl.xlabel(r'Voltage ($V$)')
pl.ylabel(r'Current ($A$)')
pl.title('Theoretical I(V) curve')
pl.grid(True)
pl.savefig('IVcurve.png')
pl.show()
However, I receive OverflowError: math range error
. Does anybody have any ideas how this can be overcome? Apologies for the 10**n
and long integrals. The code runs when the exponentials are removed (returns 0), and herein lies the problem.
Any ideas how this can be modelled in Python, or any other language?