{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "277f97c9",
            "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": "953ffd48",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.optimize import rosen\nX = 0.1 * np.arange(10)\nrosen(X)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "76.56"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d7061fe5",
            "cell_type": "markdown",
            "source": "For higher-dimensional input ``rosen`` broadcasts.\nIn the following example, we use this to plot a 2D landscape.\nNote that ``rosen_hess`` does not broadcast in this manner.\n",
            "metadata": {}
        },
        {
            "id": "20f798fd",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nx = np.linspace(-1, 1, 50)\nX, Y = np.meshgrid(x, x)\nax = plt.subplot(111, projection='3d')\nax.plot_surface(X, Y, rosen([X, Y]))\nplt.show()",
            "outputs": []
        }
    ]
}