{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "96f768cb",
            "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": "0da7df28",
            "cell_type": "markdown",
            "source": "Calculate the modified Struve function of order 1 at 2.\n",
            "metadata": {}
        },
        {
            "id": "0bd5aeda",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.special import modstruve\nimport matplotlib.pyplot as plt\nmodstruve(1, 2.)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.102759787367716"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "7fae8c4b",
            "cell_type": "markdown",
            "source": "Calculate the modified Struve function at 2 for orders 1, 2 and 3 by\nproviding a list for the order parameter `v`.\n",
            "metadata": {}
        },
        {
            "id": "fbcc8d0c",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "modstruve([1, 2, 3], 2.)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([1.10275979, 0.41026079, 0.11247294])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "58e6f6aa",
            "cell_type": "markdown",
            "source": "Calculate the modified Struve function of order 1 for several points\nby providing an array for `x`.\n",
            "metadata": {}
        },
        {
            "id": "55979e81",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "points = np.array([2., 5., 8.])\nmodstruve(1, points)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([  1.10275979,  23.72821578, 399.24709139])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "3da0e3d5",
            "cell_type": "markdown",
            "source": "Compute the modified Struve function for several orders at several\npoints by providing arrays for `v` and `z`. The arrays have to be\nbroadcastable to the correct shapes.\n",
            "metadata": {}
        },
        {
            "id": "2dda97e3",
            "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": "9bd51b62",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "modstruve(orders, points)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[1.10275979e+00, 2.37282158e+01, 3.99247091e+02],\n       [4.10260789e-01, 1.65535979e+01, 3.25973609e+02],\n       [1.12472937e-01, 9.42430454e+00, 2.33544042e+02]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "bc05621c",
            "cell_type": "markdown",
            "source": "Plot the modified Struve functions of order 0 to 3 from -5 to 5.\n",
            "metadata": {}
        },
        {
            "id": "045e45fa",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "fig, ax = plt.subplots()\nx = np.linspace(-5., 5., 1000)\nfor i in range(4):\n    ax.plot(x, modstruve(i, x), label=f'$L_{i!r}$')\nax.legend(ncol=2)\nax.set_xlim(-5, 5)\nax.set_title(r\"Modified Struve functions $L_{\\nu}$\")\nplt.show()",
            "outputs": []
        }
    ]
}