You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/sympy.ipynb
+131Lines changed: 131 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -399,6 +399,137 @@
399
399
")"
400
400
]
401
401
},
402
+
{
403
+
"cell_type": "markdown",
404
+
"metadata": {},
405
+
"source": [
406
+
"Note that the choice of {attr}`.NumericalIntegral.algorithm` is important. For vectorized integrals with large input arrays, it is better to use [JAX](https://docs.jax.dev) as a numerical backend and any of the [`quadax`](http://quadax.readthedocs.io) algorithms as the integration method.\n",
407
+
"\n",
408
+
"Below, we see a comparison between the {func}`quadax.romberg` and {func}`quadax.quadgk` algorithms for a contour integral in the complex plane. The {func}`quadax.quadgk` algorithm is much faster than the {func}`quadax.romberg` algorithm, but is less accurate when $a$ is close to the contour."
"fig.suptitle(\"Integral $I_a$ computed with quadax.romberg\", y=0.95)\n",
512
+
"ax_real, ax_imag = axes\n",
513
+
"ax_real.set_title(\"Real part\")\n",
514
+
"ax_imag.set_title(\"Imaginary part\")\n",
515
+
"ax_real.set_xlabel(\"Re $a$\")\n",
516
+
"ax_real.set_ylabel(\"Im $a$\")\n",
517
+
"ax_imag.set_xlabel(\"Re $a$\")\n",
518
+
"for ax, z in zip(axes, [Z.real, Z.imag], strict=True):\n",
519
+
" ax.pcolormesh(X, Y, z, cmap=\"RdBu_r\", rasterized=True, vmin=-z_max, vmax=+z_max)\n",
520
+
"fig.tight_layout()\n",
521
+
"plt.show()"
522
+
]
523
+
},
524
+
{
525
+
"cell_type": "markdown",
526
+
"metadata": {},
527
+
"source": [
528
+
":::{seealso}\n",
529
+
"The performance of different integration algorithms for computing the dispersion integral in different scenarios is investigated in [this notebook](./dynamics/integration-algorithms.ipynb).\n",
0 commit comments