EngWiPy
- 1,361
- 61
OK, thanks. I'm trying to do the mathematical derivations all over again. But I suspect it's just a technical issue with Mathematica.
The discussion revolves around troubleshooting an error encountered in Mathematica while using the NIntegrate function. Participants explore the causes of the NIntegrate::ncvb error, which indicates a failure to converge to the desired accuracy. The focus includes the mathematical formulation of the integral, the behavior of the loop in the code, and comparisons with Monte-Carlo simulations.
Participants do not reach a consensus on the cause of the error or the best approach to resolve it. Multiple competing views remain regarding the handling of precision, the formulation of the integral, and the interpretation of constants in the code.
Limitations include potential undefined cases in the expressions, the dependence on the choice of limits for the integral, and the unresolved nature of the mathematical formulation versus the code implementation.
For[yQdB = -10, yQdB <= 15, yQdB++;
yQ = 10^(yQdB/10);
INTEGRAND =
Simplify[1/x^2*Exp[(GSS*(x + GSS*yQ))/(x*yp) - x]*
Exp[-(GSS*(x + GSS*yQ))/(x*yp) T]/T];
A1 = 0.5*((GSS^2)*yQ)/yp*
NIntegrate[INTEGRAND, {T, 1, \[Infinity]}, {x, Cons, Infinity},
PrecisionGoal -> 5, MaxRecursion -> 12, WorkingPrecision -> 20];
Print["A1 = ", 0.5*((GSS^2)*yQ)/yp,
"\[Times] NIntegrate[ 1/x^2\[Times]Exp[ ( ", GSS, "\[Times](x +",
GSS*yQ, "))/(x\[Times]", yp, ") - x]\[Times] ExpIntegralE[1, (",
GSS, "\[Times](x + ", GSS*yQ, "))/(x\[Times]", yp, ")]"]]
yp = 10^(5/10);
GSS = 100;
Cons = 10^-7;
results = {};
For[yQdB = -10, yQdB <= 15, yQdB++;
yQ = 10^(yQdB/10);
INTEGRAND =
Simplify[1/x^2*Exp[(GSS*(x + GSS*yQ))/(x*yp) - x]*
Exp[-(GSS*(x + GSS*yQ))/(x*yp) T]/T];
A1 = 0.5*((GSS^2)*yQ)/yp*
NIntegrate[INTEGRAND, {T, 1, \[Infinity]}, {x, Cons, Infinity},
PrecisionGoal -> 5, MaxRecursion -> 12, WorkingPrecision -> 20];
results = Join[results, {yQdB, A1}];
Print[{yQdB, A1}];]