{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d9b87334-514c-41fa-aab5-ecef29c4c94d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sympy import *"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6b45c0a5-2069-4b11-b208-e2fa3dcc1820",
   "metadata": {},
   "source": [
    "**Dane Sabo**\n",
    "\n",
    "*September 18th, 2024*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0f1d7205-998f-4cbc-b3b3-df3afda5804c",
   "metadata": {},
   "source": [
    "# Instructions\n",
    "\n",
    "Please do a written solution for problems 1 and 2. We will review them on Monday, Sept 16 in class prior to the assignment being due.\n",
    "\n",
    "Please upload a Jupyter Notebook for problems 3 and 4.\n",
    "\n",
    "Problems 1 and 2 are worth 10 points each, problems 3 and 4 are worth 15 points each.\n",
    "\n",
    "# Written Problems\n",
    "**I assumed for both of these written problems that $t>0$.**\n",
    "\n",
    "## Problem 1\n",
    "Please find the general solution of \n",
    "$$\n",
    "\\bf{\\dot{X}} = \n",
    "\\begin{bmatrix}   \n",
    "-1 & 5 & 2\\\\   \n",
    "4 & -1 & -2\\\\\n",
    "0 & 0 & 6\n",
    "\\end{bmatrix}\n",
    "\\bf{X}\n",
    "$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fc73f387-de90-4c25-b24c-ec91ea774ce8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}\\frac{d}{d t} x_{1}{\\left(t \\right)}\\\\\\frac{d}{d t} x_{2}{\\left(t \\right)}\\\\\\frac{d}{d t} x_{3}{\\left(t \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}- x_{1}{\\left(t \\right)} + 5 x_{2}{\\left(t \\right)} + 2 x_{3}{\\left(t \\right)}\\\\4 x_{1}{\\left(t \\right)} - x_{2}{\\left(t \\right)} - 2 x_{3}{\\left(t \\right)}\\\\6 x_{3}{\\left(t \\right)}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Eq(Matrix([\n",
       "[Derivative(x1(t), t)],\n",
       "[Derivative(x2(t), t)],\n",
       "[Derivative(x3(t), t)]]), Matrix([\n",
       "[-x1(t) + 5*x2(t) + 2*x3(t)],\n",
       "[ 4*x1(t) - x2(t) - 2*x3(t)],\n",
       "[                   6*x3(t)]]))"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t = symbols('t', positive=True)\n",
    "s = symbols('s')\n",
    "\n",
    "x = Matrix([Function('x1')(t), Function('x2')(t), Function('x3')(t)])\n",
    "x_dot = x.diff(t) \n",
    "A = Matrix([[-1, 5, 2],[4, -1, -2], [0, 0, 6]])\n",
    "\n",
    "eq = Eq(x_dot,A*x)\n",
    "eq"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9203ea18-e9e6-424b-bb2e-c12ef880f40b",
   "metadata": {},
   "source": [
    "First we have to find the fundamental matrix $\\bf{\\Psi}(t) = e^{\\bf{A}t}$:\n",
    "$$e^{\\bf{A}t} = \\mathcal{L}^{-1} \\{ (sI-\\bf{A})^{-1} \\} $$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "bcfcdd55-34a5-4fb5-a91c-f1b540cef71f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)} & \\frac{\\sqrt{5} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{2} & \\frac{4 e^{6 t}}{29} + \\frac{3 \\sqrt{5} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{29} - \\frac{4 e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)}}{29}\\\\\\frac{2 \\sqrt{5} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{5} & e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)} & - \\frac{6 e^{6 t}}{29} - \\frac{8 \\sqrt{5} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{145} + \\frac{6 e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)}}{29}\\\\0 & 0 & e^{6 t}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[            exp(-t)*cosh(2*sqrt(5)*t), sqrt(5)*exp(-t)*sinh(2*sqrt(5)*t)/2,   4*exp(6*t)/29 + 3*sqrt(5)*exp(-t)*sinh(2*sqrt(5)*t)/29 - 4*exp(-t)*cosh(2*sqrt(5)*t)/29],\n",
       "[2*sqrt(5)*exp(-t)*sinh(2*sqrt(5)*t)/5,           exp(-t)*cosh(2*sqrt(5)*t), -6*exp(6*t)/29 - 8*sqrt(5)*exp(-t)*sinh(2*sqrt(5)*t)/145 + 6*exp(-t)*cosh(2*sqrt(5)*t)/29],\n",
       "[                                    0,                                   0,                                                                                  exp(6*t)]])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "psi_t = ((s*eye(3) - A).inv()).applyfunc(lambda i: inverse_laplace_transform(i,s,t))\n",
    "psi_t"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "36a38aad-7fee-4d94-924c-75afc0cffd1e",
   "metadata": {},
   "source": [
    "Now that we have our fundamental matrix, we know the following is true for an autonomous system:\n",
    "$$ {\\bf{x}}(t) = {\\bf{\\Psi}}(t) {\\bf{C}}$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "26b31bac-00b4-429e-aabc-26757b8f4702",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}c_{1} e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)} + \\frac{\\sqrt{5} c_{2} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{2} + c_{3} \\left(\\frac{4 e^{6 t}}{29} + \\frac{3 \\sqrt{5} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{29} - \\frac{4 e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)}}{29}\\right)\\\\\\frac{2 \\sqrt{5} c_{1} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{5} + c_{2} e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)} + c_{3} \\left(- \\frac{6 e^{6 t}}{29} - \\frac{8 \\sqrt{5} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{145} + \\frac{6 e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)}}{29}\\right)\\\\c_{3} e^{6 t}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[    c1*exp(-t)*cosh(2*sqrt(5)*t) + sqrt(5)*c2*exp(-t)*sinh(2*sqrt(5)*t)/2 + c3*(4*exp(6*t)/29 + 3*sqrt(5)*exp(-t)*sinh(2*sqrt(5)*t)/29 - 4*exp(-t)*cosh(2*sqrt(5)*t)/29)],\n",
       "[2*sqrt(5)*c1*exp(-t)*sinh(2*sqrt(5)*t)/5 + c2*exp(-t)*cosh(2*sqrt(5)*t) + c3*(-6*exp(6*t)/29 - 8*sqrt(5)*exp(-t)*sinh(2*sqrt(5)*t)/145 + 6*exp(-t)*cosh(2*sqrt(5)*t)/29)],\n",
       "[                                                                                                                                                             c3*exp(6*t)]])"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = Matrix([symbols('c1:4')])\n",
    "psi_t*c.transpose()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "f75fc677-968c-4076-b4d8-06634896a70f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}x_{1}{\\left(t \\right)}\\\\x_{2}{\\left(t \\right)}\\\\x_{3}{\\left(t \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}c_{1} e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)} + \\frac{\\sqrt{5} c_{2} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{2} + c_{3} \\left(\\frac{4 e^{6 t}}{29} + \\frac{3 \\sqrt{5} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{29} - \\frac{4 e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)}}{29}\\right)\\\\\\frac{2 \\sqrt{5} c_{1} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{5} + c_{2} e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)} + c_{3} \\left(- \\frac{6 e^{6 t}}{29} - \\frac{8 \\sqrt{5} e^{- t} \\sinh{\\left(2 \\sqrt{5} t \\right)}}{145} + \\frac{6 e^{- t} \\cosh{\\left(2 \\sqrt{5} t \\right)}}{29}\\right)\\\\c_{3} e^{6 t}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Eq(Matrix([\n",
       "[x1(t)],\n",
       "[x2(t)],\n",
       "[x3(t)]]), Matrix([\n",
       "[    c1*exp(-t)*cosh(2*sqrt(5)*t) + sqrt(5)*c2*exp(-t)*sinh(2*sqrt(5)*t)/2 + c3*(4*exp(6*t)/29 + 3*sqrt(5)*exp(-t)*sinh(2*sqrt(5)*t)/29 - 4*exp(-t)*cosh(2*sqrt(5)*t)/29)],\n",
       "[2*sqrt(5)*c1*exp(-t)*sinh(2*sqrt(5)*t)/5 + c2*exp(-t)*cosh(2*sqrt(5)*t) + c3*(-6*exp(6*t)/29 - 8*sqrt(5)*exp(-t)*sinh(2*sqrt(5)*t)/145 + 6*exp(-t)*cosh(2*sqrt(5)*t)/29)],\n",
       "[                                                                                                                                                             c3*exp(6*t)]]))"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eq2 = Eq(x,psi_t*c.transpose())\n",
    "eq2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "14643f79-07ea-4d87-b81e-39244b1a3fa7",
   "metadata": {},
   "source": [
    "## Problem 2\n",
    "Please find the general solution of \n",
    "$$\n",
    "\\bf{\\dot{X}} = \n",
    "\\begin{bmatrix}   \n",
    "-6 & 5 \\\\   \n",
    "-5 & 4 \\\\\n",
    "\\end{bmatrix}\n",
    "\\bf{X}\n",
    "$$\n",
    "\n",
    "Following the same process as problem 1:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "390b5ac8-c156-4606-8d69-1b86b80fcefd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "⎡d        ⎤                       \n",
      "⎢──(x₁(t))⎥                       \n",
      "⎢dt       ⎥   ⎡-6⋅x₁(t) + 5⋅x₂(t)⎤\n",
      "⎢         ⎥ = ⎢                  ⎥\n",
      "⎢d        ⎥   ⎣-5⋅x₁(t) + 4⋅x₂(t)⎦\n",
      "⎢──(x₂(t))⎥                       \n",
      "⎣dt       ⎦                       \n"
     ]
    }
   ],
   "source": [
    "t = symbols('t', positive=True)\n",
    "s = symbols('s')\n",
    "\n",
    "x = Matrix([Function('x1')(t), Function('x2')(t)])\n",
    "x_dot = x.diff(t) \n",
    "A = Matrix([[-6, 5],[-5, 4]])\n",
    "\n",
    "eq = Eq(x_dot,A*x)\n",
    "eq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "d1cb0d2f-0618-4ef5-b0fe-d7d47dc7f3d6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}- 5 t e^{- t} + e^{- t} & 5 t e^{- t}\\\\- 5 t e^{- t} & 5 t e^{- t} + e^{- t}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[-5*t*exp(-t) + exp(-t),           5*t*exp(-t)],\n",
       "[          -5*t*exp(-t), 5*t*exp(-t) + exp(-t)]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "psi_t = ((s*eye(2) - A).inv()).applyfunc(lambda i: inverse_laplace_transform(i,s,t))\n",
    "psi_t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "1f829f42-f36b-41af-80f7-71885cfe9193",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}c_{1} \\left(- 5 t e^{- t} + e^{- t}\\right) + 5 c_{2} t e^{- t}\\\\- 5 c_{1} t e^{- t} + c_{2} \\left(5 t e^{- t} + e^{- t}\\right)\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[c1*(-5*t*exp(-t) + exp(-t)) + 5*c2*t*exp(-t)],\n",
       "[-5*c1*t*exp(-t) + c2*(5*t*exp(-t) + exp(-t))]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = Matrix([symbols('c1:3')])\n",
    "psi_t*c.transpose()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "4bde70fb-c015-4a0b-b4e4-dadd5b88333d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}x_{1}{\\left(t \\right)}\\\\x_{2}{\\left(t \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}c_{1} \\left(- 5 t e^{- t} + e^{- t}\\right) + 5 c_{2} t e^{- t}\\\\- 5 c_{1} t e^{- t} + c_{2} \\left(5 t e^{- t} + e^{- t}\\right)\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Eq(Matrix([\n",
       "[x1(t)],\n",
       "[x2(t)]]), Matrix([\n",
       "[c1*(-5*t*exp(-t) + exp(-t)) + 5*c2*t*exp(-t)],\n",
       "[-5*c1*t*exp(-t) + c2*(5*t*exp(-t) + exp(-t))]]))"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eq2 = Eq(x,psi_t*c.transpose())\n",
    "eq2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c0f6f7a-d495-4f06-8d7c-a81f0f9ac2fc",
   "metadata": {},
   "source": [
    "# Python Problems\n",
    "## Problem 3\n",
    "The Archimedes Spiral can be plotted by taking all the positive whole numbers (e.g.j = 0, 1, 2, 3, 4, 5, ...) and putting them into the format $n = (j,j)$ , and plotting them in polar coordinates where the first term, $n_1$, is the radius, and the second term, $n_2$, is the angle in radians.\n",
    "### Part A\n",
    "You need to plot the first 1000 terms in a scatter plot. In addition, we would like to only look at the top right quadrant! What you're going for is shown in Figure 1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "5e4b28fb-f18f-44ae-887e-9088446f2e5d",
   "metadata": {},
   "outputs": [],
   "source": [
    "archimedes_nos = np.array(range(1000))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "7bcd76ea-9df5-40a5-a19b-382afcecee98",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, 'Archimedes Spiral, 1st Quadrant')"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 31996 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = archimedes_nos*np.cos(archimedes_nos)\n",
    "y = archimedes_nos*np.sin(archimedes_nos)\n",
    "plt.figure()\n",
    "plt.plot(x,y,'.b')\n",
    "plt.xlim(0,1000)\n",
    "plt.ylim(0,1000)\n",
    "plt.grid()\n",
    "plt.title(\"Archimedes Spiral, 1st Quadrant\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fde7a33e-6eb1-47b0-8867-85792164a17c",
   "metadata": {},
   "source": [
    "### Part B\n",
    "You need to plot the first 25 terms, looking at the entire polar plot (all quadrants, and then, put a *smooth* line through it. What you're going for is shown in Figure 2.)\n",
    "Hint: [This will be a useful reference](https://matplotlib.org/stable/gallery/pie_and_polar_charts/index.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d03285bf-09a6-4b79-b6e2-aaf35c56f96f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, 'Polar Plot of First 25 Archimedes Spiral Terms')"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 100032 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure()\n",
    "plt.polar(archimedes_nos[:25],archimedes_nos[:25],'.b')\n",
    "plt.polar(np.linspace(0,25,1000),np.linspace(0,25,1000),'-r')\n",
    "\n",
    "plt.title(\"Polar Plot of First 25 Archimedes Spiral Terms\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "607410b5-74aa-44fd-ad88-4ed702dad2bc",
   "metadata": {},
   "source": [
    "## Problem 4\n",
    "Consider the following system:\n",
    "$$\n",
    "\\bf{\\dot{X}} = \n",
    "\\begin{bmatrix}   \n",
    "1 & 2 & 1\\\\   \n",
    "3 & 1+x & 1\\\\\n",
    "1 & 0 & 0\n",
    "\\end{bmatrix}\n",
    "\\bf{X}\n",
    "$$\n",
    "This linear differential equation system’s behavior is governed by its eigenvalues. In particular, the eigenvalues relate to stability and we may wish to see where they cross the 0 line (in terms of their real value). The constant x varies over the interval [−5, 5]. Using a Jupyter Notebook (local, or on Google Colab), Python, NumPy, and Matplotlib’s PyPlot, you should evaluate the eigenvalues for 50 evenly spaced values of x between −5 and 5, and produce a plot that visualizes the variation in the three eigenvalues as x varies. An example plot is shown in Figure 3 (for a different matrix!)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "4e31260e-2d13-4709-91d9-be043a733cd0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 29072 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#A cursed line of code.\n",
    "import matplotlib.pyplot as plt; import numpy as np; eig = lambda x: np.linalg.eig([[1, 2, 1], [3, 1+x, 1], [1, 0, 0]])[0]; x_vals = np.linspace(-5, 5, 50); [plt.plot(x, eig(x)@[0,0,1], '.b', x, eig(x)@[0,1,0], '.r', x, eig(x)@[1,0,0], '.g') for x in x_vals]; plt.title(\"Eigenvalues of A for Range of X Values\"); plt.xlabel(\"X Values\"); plt.ylabel(\"Eigenvalue-value\"); plt.grid(); plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "f813a4d9-2da4-4e28-a244-f8aa5fc37bf8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 27892 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Human Readable Code\n",
    "#Create Eigenvalue Function\n",
    "eig = lambda x: np.linalg.eig([[1, 2, 1],[3, 1+x, 1],[1,0,0]]).eigenvalues\n",
    "\n",
    "#Allocate memory to x and eigenvalue storage\n",
    "x = np.linspace(-5,5,50)\n",
    "eigs = np.zeros((3,50))\n",
    "\n",
    "#Calculate eigenvalues\n",
    "for i in range(50):\n",
    "    eigs[:,i] = eig(x[i])\n",
    "\n",
    "#Plotting\n",
    "plt.figure()\n",
    "plt.title(\"Eigenvalues for Range of X Values\")\n",
    "plt.plot(x,eigs[0,:],'.r',x,eigs[1,:],'.b',x,eigs[2,:],'.g')\n",
    "plt.xlabel(\"X Values\")\n",
    "plt.ylabel(\"Eigenvalue-value\")\n",
    "plt.grid()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
