0
$\begingroup$

I want to calculate this integral -

$I = \int\limits_1^\infty\int\limits_0^\infty \left(\frac{1}{1 + e^{q(x+y+0.2+v)/(k*T)}}\right) \left(\frac{1}{e^{q(-x-y-0.2)/(k*T)}+1}\right) \left(\frac{1}{\sqrt{y}}\right) dy dx - \int\limits_1^\infty\int\limits_0^\infty \left(\frac{1}{1 + e^{q(-x-y-0.2-v)/(k*T)}}\right) \left(\frac{1}{e^{q(x+y+0.2)/(k*T)}+1}\right) \left(\frac{1}{\sqrt{y}}\right) dy\ dx$

Where k = 1.38*10^-23

T = 300

q = 1.6*10^-19

I used the following code :

q := 1.6*10^-19 ;

k := 1.38*10^-23;

T = 300;

f[v_?NumericQ] := (NIntegrate[(1/(1 + Exp[(q*(x + y + 0.2 + v))/(kT)]))(1/(Exp[( q*(-x - y - 0.2))/(kT)] + 1))(1/Sqrt[y]), {y, 0, Infinity}, {x, 1, Infinity}] - NIntegrate[(1/(1 + Exp[(q*(-x - y - 0.2 - v))/( kT)]))(1/(Exp[((x + y + 0.2)q)/(kT)] + 1))*(1/ Sqrt[y]), {y, 0, Infinity}, {x, 1, Infinity}]);

LogPlot[-f[v], {v, 0, 1}]

The order of magnitude of f which I get is 10^(-23), which I suspect is wrong. Is there a way to verify that the numerical integration done by NIntegrate is right?

$\endgroup$
  • 1
    $\begingroup$ Use exact inputs (e.g., 1/2 instead of .5) and then increase the WorkingPrecision used in NIntegrate. If the results converge, you can really on the NIntegrate output. $\endgroup$ – Carl Woll Mar 8 '18 at 17:31
  • $\begingroup$ I am sorry I don't quite understand what exact inputs mean in my equation. Also, can you tell me how to include WorkPrecision in here? $\endgroup$ – Indeterminate Mar 8 '18 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.