# NIntegrate::slwcon error in Rolf Winter’s problem

**URL:** <https://community.wolfram.com/t/nintegrate-slwcon-error-in-rolf-winter-s-problem/23326>\
**Category:** Questions\
**Tags:** calculus, numerical-computation\
**Created:** [December 29, 2023, 2:24am UTC](https://community.wolfram.com/t/nintegrate-slwcon-error-in-rolf-winter-s-problem/23326 "2023-12-29T02:24:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hongyizhao](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@hongyizhao](https://community.wolfram.com/u/hongyizhao)\
**Post date:** [December 29, 2023, 2:24am UTC](https://community.wolfram.com/t/nintegrate-slwcon-error-in-rolf-winter-s-problem/23326/1 "2023-12-29T02:24:49Z")

</div>

The notebook comes from Jim Napolitano [tuf43817@temple.edu](mailto:tuf43817@temple.edu), and it throws the message **NIntegrate::slwcon** , as shown below:

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/a00bcf46-9750-4f25-8f78-54fbf1090e7a)

How to fix this problem?

Regards,  
Zhao

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [December 29, 2023, 11:11am UTC](https://community.wolfram.com/t/nintegrate-slwcon-error-in-rolf-winter-s-problem/23326/2 "2023-12-29T11:11:15Z")

</div>

Update code for this:

```
Ts = Rationalize[{0, 0.01, 0.025, 0.05, 0.075, 0.1, 0.2, 0.3, 0.4, 0.5,
      1, 2, 4, 6, 8, 8.25, 8.5, 8.75, 9, 9.125, 9.25, 9.375, 9.5, 9.625,
       9.75, 9.875,
      10, 10.25, 10.5, 10.75}, 0];

NIntegrate[(qJac intg) /. q -> qu /. vals /. f -> 0 /. T -> Ts,
  {u, 0, 1}, {l, -1, 0}, Method -> "LocalAdaptive"]

```

but time computation is more exstensive.

Regards M.I.

---

<div class="post-metadata">

**Author:** ![hongyizhao](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@hongyizhao](https://community.wolfram.com/u/hongyizhao)\
**Post date:** [December 29, 2023, 11:33am UTC](https://community.wolfram.com/t/nintegrate-slwcon-error-in-rolf-winter-s-problem/23326/3 "2023-12-29T11:33:13Z")

</div>

I try to use **ParallelEvaluate** as follows:

```
\[Psi] = 
  NIntegrate[(qJac intg) /. q -> qu /. vals /. f -> 0 /. T -> Ts,
    {u, 0, 1}, {l, -1, 0}, PrecisionGoal -> 4] // ParallelEvaluate;

```

However, no effect was observed either.

Regards,  
Zhao

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [December 29, 2023, 3:30pm UTC](https://community.wolfram.com/t/nintegrate-slwcon-error-in-rolf-winter-s-problem/23326/4 "2023-12-29T15:30:42Z")

</div>

We can speed up computation:

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/811a512c-a52c-48f1-8c4a-a3e605197eac)

for more info see [here](https://reference.wolfram.com/language/tutorial/NIntegrateIntegrationRules.html#381359375)

---

<div class="post-metadata">

**Author:** ![hongyizhao](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@hongyizhao](https://community.wolfram.com/u/hongyizhao)\
**Post date:** [December 29, 2023, 11:50pm UTC](https://community.wolfram.com/t/nintegrate-slwcon-error-in-rolf-winter-s-problem/23326/5 "2023-12-29T23:50:20Z")

</div>

I give the following comments about these two methods, aka, the original one and the Gauss-Kronrod Quadrature:

The results derived from both methods provide a visualization of the time-dependent probability distribution that a particle will be found inside a given well. Both graphs generated by these methods outline the decaying trend in this probability as time progresses, which adheres logically to the expected physical behavior of a particle in a bound state over time.

Also, it’s essential to note that both methods are grappling with intricate mathematical modeling likely involving highly oscillatory integrands, potential singularities, and finite precision, all of which present considerable numerical challenges. Due to these built-in complexities, some discrepancies between the two methods are expected and generally acceptable within limits.

The first method appears to undergo some convergence issues, as indicated by the error message, likely due to the complexity of the integrand and the approximations used within NIntegrate.

The second method, which employs Gauss-Kronrod quadrature, seems to handle this complexity better. By increasing working precision, representing the function to be integrated in compiled code, and using a different numerical integration technique, the computation appears to be more stable and less prone to potential sources of numerical instability.

In summary, while both methods indicate a physically intuitive result – a decay of state with time, the second method seems to offer a more numerically stable implementation, which might be more robust in this particular context. However, the most suitable method would generally rely on the specific requirements and constraints of the underlying problem.

Regards,  
Zhao
