{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "34f943c2",
            "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": "7d394b67",
            "cell_type": "markdown",
            "source": "Calculate the Struve function of order 1 at 2.\n",
            "metadata": {}
        },
        {
            "id": "e6346883",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.special import struve\nimport matplotlib.pyplot as plt\nstruve(1, 2.)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.6467637282835622"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "576c4952",
            "cell_type": "markdown",
            "source": "Calculate the Struve function at 2 for orders 1, 2 and 3 by providing\na list for the order parameter `v`.\n",
            "metadata": {}
        },
        {
            "id": "76b07732",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "struve([1, 2, 3], 2.)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.64676373, 0.28031806, 0.08363767])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "db510a6b",
            "cell_type": "markdown",
            "source": "Calculate the Struve function of order 1 for several points by providing\nan array for `x`.\n",
            "metadata": {}
        },
        {
            "id": "7ef013ff",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "points = np.array([2., 5., 8.])\nstruve(1, points)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.64676373, 0.80781195, 0.48811605])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "8e264022",
            "cell_type": "markdown",
            "source": "Compute the Struve function for several orders at several points by\nproviding arrays for `v` and `z`. The arrays have to be broadcastable\nto the correct shapes.\n",
            "metadata": {}
        },
        {
            "id": "2512a4c5",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "orders = np.array([[1], [2], [3]])\npoints.shape, orders.shape",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "((3,), (3, 1))"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "aac69aaf",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "struve(orders, points)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[0.64676373, 0.80781195, 0.48811605],\n       [0.28031806, 1.56937455, 1.51769363],\n       [0.08363767, 1.50872065, 2.98697513]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "b358d478",
            "cell_type": "markdown",
            "source": "Plot the Struve functions of order 0 to 3 from -10 to 10.\n",
            "metadata": {}
        },
        {
            "id": "bc49a892",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "fig, ax = plt.subplots()\nx = np.linspace(-10., 10., 1000)\nfor i in range(4):\n    ax.plot(x, struve(i, x), label=f'$H_{i!r}$')\nax.legend(ncol=2)\nax.set_xlim(-10, 10)\nax.set_title(r\"Struve functions $H_{\\nu}$\")\nplt.show()",
            "outputs": []
        }
    ]
}