mirror of
https://github.com/ArthurDanjou/ArtStudies.git
synced 2026-03-18 12:49:41 +01:00
Refactor code in numerical methods notebooks
- Updated import order in Point_Fixe.ipynb for consistency. - Changed lambda functions to regular function definitions for clarity in Point_Fixe.ipynb. - Added numpy import in TP1_EDO_EulerExp.ipynb, TP2_Lokta_Volterra.ipynb, and TP3_Convergence.ipynb for better readability. - Modified for loops in TP1_EDO_EulerExp.ipynb and TP2_Lokta_Volterra.ipynb to include strict=False for compatibility with future Python versions.
This commit is contained in:
@@ -92,14 +92,14 @@
|
||||
],
|
||||
"source": [
|
||||
"%matplotlib inline\n",
|
||||
"import numpy as np\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"import numpy as np\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# Fonction F définissant l'EDO\n",
|
||||
"def F(Y):\n",
|
||||
" x = Y[0]\n",
|
||||
" y = Y[1]\n",
|
||||
" Y[0]\n",
|
||||
" Y[1]\n",
|
||||
" A = np.array([[0, 1], [-2, -3]])\n",
|
||||
" return np.dot(A, Y)\n",
|
||||
"\n",
|
||||
@@ -132,7 +132,7 @@
|
||||
"## Représentation des solutions pour chaque valeur de la donnée initiale\n",
|
||||
"tt = np.linspace(-10, 10, 100)\n",
|
||||
"t0 = tt[0]\n",
|
||||
"for x, y in zip([1, -2, 0, 1, 3], [2, -2, -4, -2, 4]):\n",
|
||||
"for x, y in zip([1, -2, 0, 1, 3], [2, -2, -4, -2, 4], strict=False):\n",
|
||||
" sol = uex(tt, t0, [x, y])\n",
|
||||
" plt.plot(sol[0], sol[1], label=f\"$((x0, y0) = ({x}, {y})$\")\n",
|
||||
" plt.scatter(x, y)\n",
|
||||
|
||||
Reference in New Issue
Block a user