{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "9bd5e7b4",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "3c650933",
            "cell_type": "markdown",
            "source": "Evaluate the function for one parameter set.\n",
            "metadata": {}
        },
        {
            "id": "fd81a380",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy.special import besselpoly\nbesselpoly(1, 1, 1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.24449718372863877"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "56e18b44",
            "cell_type": "markdown",
            "source": "Evaluate the function for different scale factors.\n",
            "metadata": {}
        },
        {
            "id": "8343613b",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfactors = np.array([0., 3., 6.])\nbesselpoly(factors, 1, 1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 0.        , -0.00549029,  0.00140174])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "60789968",
            "cell_type": "markdown",
            "source": "Plot the function for varying powers, orders and scales.\n",
            "metadata": {}
        },
        {
            "id": "fa6c6ff0",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import matplotlib.pyplot as plt\nfig, ax = plt.subplots()\npowers = np.linspace(0, 10, 100)\norders = [1, 2, 3]\nscales = [1, 2]\nall_combinations = [(order, scale) for order in orders\n                    for scale in scales]\nfor order, scale in all_combinations:\n    ax.plot(powers, besselpoly(scale, powers, order),\n            label=rf\"$\\nu={order}, a={scale}$\")\nax.legend()\nax.set_xlabel(r\"$\\lambda$\")\nax.set_ylabel(r\"$\\int_0^1 x^{\\lambda} J_{\\nu}(2ax)\\,dx$\")\nplt.show()",
            "outputs": []
        }
    ]
}