{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "École Polytechnique de Montréal\n", "
\n", "Cours MTH2210 : Calcul scientifique pour ingénieurs\n", "
\n", "Session d'automne 2020\n", "\n", "

TP 0 : Gabarit des TPs du cours MTH2210 et transciption Python de fonctions Matlab

\n", "\n", "| N'DRI Donatien | BOUCHET Pierre-Yves |\n", "|-------------------|---------------------|\n", "| Matricule 9999999 | Matricule 0000000 |" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting git+https://github.com/amontoison/MTH2210.py.git\n", " Cloning https://github.com/amontoison/MTH2210.py.git to /tmp/pip-req-build-0fbwfp3f\n", "Requirement already satisfied, skipping upgrade: numpy in /home/pierre-yves/anaconda3/lib/python3.7/site-packages (from MTH2210==0.1) (1.19.1)\n", "Building wheels for collected packages: MTH2210\n", " Building wheel for MTH2210 (setup.py) ... \u001b[?25ldone\n", "\u001b[?25h Created wheel for MTH2210: filename=MTH2210-0.1-py3-none-any.whl size=28994 sha256=26c234e8cb2d1c2d16fb25345eb90c494886700a8cb8a9ec3c251a4b6366bc52\n", " Stored in directory: /tmp/pip-ephem-wheel-cache-_4e20o3a/wheels/c3/ea/aa/bddbf725a58733c37d46c22cb8ca052fab49e521e26067863e\n", "Successfully built MTH2210\n", "Installing collected packages: MTH2210\n", " Attempting uninstall: MTH2210\n", " Found existing installation: MTH2210 0.1\n", " Uninstalling MTH2210-0.1:\n", " Successfully uninstalled MTH2210-0.1\n", "Successfully installed MTH2210-0.1\n", "Note: you may need to restart the kernel to use updated packages.\n" ] }, { "data": { "text/html": [ "\n", "Pour cacher/révéler le code brut (et donc n'avoir sur le notebook que les résultats), cliquer ici." ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#############################\n", "# INITIALISATION DU GABARIT #\n", "#############################\n", "\n", "\n", "\n", "# La ligne suivante n'est à lancer que pour installer / mettre à jour la bibliothèque numérique du cours.\n", "# Le reste du temps, elle peut rester commentée.\n", "%pip install --upgrade git+https://github.com/amontoison/MTH2210.py.git\n", "\n", "\n", "\n", "# Réinitialisation complète de l'environnement\n", "%reset -f\n", "\n", "# Import des bibliothèques nécessaires intégrées à Python\n", "import sys\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from IPython.display import HTML\n", "\n", "# Import de la bibliothèque numérique du cours\n", "import MTH2210\n", "\n", "# Définition d'un code permettant d'alléger le visuel du notebook; issu de\n", "# https://stackoverflow.com/questions/27934885/how-to-hide-code-from-cells-in-ipython-notebook-visualized-with-nbviewer\n", "HTML('''\n", "Pour cacher/révéler le code brut (et donc n'avoir sur le notebook que les résultats), cliquer ici.''')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# EXERCICE 1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Le polynôme de Taylor de degré 4 de l'exponentielle $e^x$ au voisinage de 0 est\n", " $$ p_4(x) = 1+x+\\frac{x^2}{2}+\\frac{x^3}{6}+\\frac{x^4}{24}. $$\n", "Une autre approximation de l'exponentielle au voisinage de 0 est donnée par\n", " $$ r(x) = \\frac{x^2+6x+12}{x^2-6x+12}. $$\n", "\n", "a) Définir les fonction $x \\mapsto p_4(x)$ et $x \\mapsto r(x)$ en Python, dont l'utilisation est cohérente avec le format Numpy.\n", "\n", "b) Tracer, sur un même graphique, les courbes des fonctions $x \\mapsto e^x$, $x \\mapsto p_4(x)$ et $x \\mapsto r(x)$, sur l'intervalle $\\left[\\frac{-\\ln{2}}{2},\\frac{\\ln{2}}{2}\\right]$.\n", "\n", "c) Tracer, sur un même graphique, les fonctions erreurs $x \\mapsto e^x-p_4(x)$ et $x \\mapsto e^x-r(x)$, sur l'intervalle $\\left[\\frac{-\\ln{2}}{2},\\frac{\\ln{2}}{2}\\right]$.\n", "\n", "d) Commenter." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def p4(x):\n", " return(1 + x + x**2/2 + x**3/6 + x**4/24)\n", "\n", "def r(x):\n", " return( (x**2+6*x+12) / (x**2-6*x+12) )" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/d3fzzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAq8UlEQVR4nO3deVyVZf7/8ddHhdDU3LBUNLOsNLeSLCu3zDK1jFzC3KFFp35NTvtqNTUzLVOOWZkp7lu5ZWVZpn7NTBNX3FNzwRW13FGB6/cHp8YxEEhubuC8n48Hj+Gc+5bzhpjz5rru5TLnHCIiEryK+B1ARET8pSIQEQlyKgIRkSCnIhARCXIqAhGRIFfM7wA5VaFCBVe9enW/Y4iIFChLlizZ55wLz2hbgSuC6tWrEx8f73cMEZECxcy2ZrZNU0MiIkFORSAiEuRUBCIiQa7AHSPIyKlTp0hMTCQ5OdnvKHkmLCyMiIgIQkJC/I4iIgVcoSiCxMRESpUqRfXq1TEzv+N4zjnH/v37SUxM5JJLLvE7jogUcIViaig5OZny5csHRQkAmBnly5cPqhGQiHinUBQBEDQl8Jtg+35FxDuFpghERAqrtNQ0brl5OJPivvHk66sIRETyseNHjnNl/Sl8O6c3bw3b6clreFYEZhZnZnvNbFUW+11rZqlm1tGrLCIiBdHexD1cXOd7flrdkSbNhrNgXndPXsfLEcEIoPXZdjCzosDrwEwPc/gqKSmJ3r17k5iYSExMDKdOnfI7kogUAGuWrKdG5HaStrWga+ehzJvbmyJFvXnL9qwInHPzgANZ7Pb/gMnAXq9y+C08PJxq1arx2GOPMXDgQJ33LyJZmvPZDzS4pQhH99fm2UfHMWbifZ6+nm/HCMysChAFDM7Gvg+YWbyZxSclJXkf7k/6+eefad++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/ns3Mgb+DolSV83+lHn3KHcyJbJ6+RKXp9kZwnWnCzT6rX8lCU7sp3XzFqQXgR+zrlnK69zbirp7wNNgb8Dt3gdLCdUBBlwzmX6H8nM9phZJefcrsBwf28WX+tXM5sLtAY8KYLcyGtmIaSXwFjn3BQvcv4mN3++PsjOEqw5WabVa/kpS3ZkK6+Z1QOGArc75/bnUbaM5Ojn65ybZ2aXmlkF51y+uSGdpoZybjrQM/B5TzJYYtPMwgMjAcysOOntvy6vAp4hO3kNGAasdc69nYfZMpJlXp9lZwnW6UCPwNlD1wMHf5vu8kG2lozNR7LMa2bVgClAd+fcBh8yni47eS8L/H+MwBlkoYCf5fVHfh+tLmgfQHngW+CnwP+WCzxfGZjh/ntmwDJgJemjgBfzed6bSB/OrgSWBz7a5Ne8gcfjgV2kH+BMBGLzMGMb0s+s2gQ8F3iuD9An8LkB7wW2JwCRPv/OZpX3osDP8BDwa+Dz0vk471Dgl9N+V+Pz+c/3KWB1IOsPwE1+5s3oQ7eYEBEJcpoaEhEJcioCEZEgpyIQEQlyKgIRkSCnIhARCXIqAhGRIKciEBEJcioCkXNkZtcG7jcfZmbnB9Z0qON3LpHs0gVlIrnAzF4FwoDiQKJz7p8+RxLJNhWBSC4I3GdmMZAM3ODS7z4rUiBoakgkd5QjfSWqUqSPDEQKDI0IRHKBmU0nfXWqS4BKzrmHfY4kkm1aj0DkHJlZDyDFOTfOzIoCC8zsZufcbL+ziWSHRgQiIkFOxwhERIKcikBEJMipCEREgpyKQEQkyKkIRESCnIpARCTIqQhERILc/wcxPRtLVR0q6gAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "x = np.linspace(-np.log(2)/2, np.log(2)/2, 1000)\n", "\n", "plt.plot(x, np.exp(x), color=\"r\", label=\"$e^x$\")\n", "plt.plot(x, p4(x), color=\"g\", label=\"$p_4(x)$\")\n", "plt.plot(x, r(x), color=\"b\", label=\"$r(x)$\")\n", "plt.xlabel(\"x\")\n", "plt.ylabel(\"f(x)\")\n", "plt.legend()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAERCAYAAABy/XBZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/d3fzzAAAACXBIWXMAAAsTAAALEwEAmpwYAAApNUlEQVR4nO3deXwU9f3H8dc3FwmHECSAEJFT7kuD4AFKQUU8QJBDEVC0VKn+VKptrbeVom2l6I+fUA9UKIgIHngiKKB4UEAIEO7bYDDcEMid7++P2UAICbl2d3az7+fjMd3d2dmZt1vy/cx857szxlqLiIiEnjC3A4iIiDtUAEREQpQKgIhIiFIBEBEJUSoAIiIhSgVARCREBV0BMMZMNcakGmPWeWl9ucaY1Z5pnjfWKSISDEyw/Q7AGNMDSAOmWWvbeWF9adba6hVPJiISXILuCMBa+w1wsOA8Y0wzY8wXxpiVxphvjTGtXIonIhI0gq4AFONV4H5r7cXAw8ArZfhstDFmhTHmR2NMf5+kExEJQBFuB6goY0x14DLgPWNM/uwqnvcGAM8W8bE91tprPc8bWWt/McY0Bb42xqy11m7zdW4REbcFfQHAOYo5bK3tVPgNa+37wPtn+7C19hfP43ZjzGKgM6ACICKVXtB3AVlrjwI7jDGDAIyjY2k+a4yJNcbkHy3UAS4H1vssrIhIAAm6AmCMeQf4AWhpjEk2xtwFDAPuMsYkAklAv1KurjWwwvO5RcDz1loVABEJCUE3DFRERLwj6I4ARETEO4LqJHCdOnVs48aN3Y4hIhJUVq5cud9aG1d4flAVgMaNG7NixQq3Y4iIBBVjzK6i5qsLSEQkRKkAiIiEKBUAEZEQFVTnAIqSnZ1NcnIyGRkZbkepFKKjo4mPjycyMtLtKCLiY0FfAJKTk6lRowaNGzemwLWAp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D8FEKsgY8xwQDcQAydba8S5HEikVFQCRCvJcB2Y5kAFcZp2rwYoEPHUBiVRcbZw7P9XAORIQCQo6AhCpIGPMPJy7QTUBzrPW3udyJJFS0f0ARCrAGDMCyLHWzjTGhAPfG2N+Y6392u1sIiXREYCISIjSOQARkRClAiAiEqJUAEREQpQKgIhIiFIBEBEJUSoAIiIhSgVARCRE/T/Yd7b9cH47iAAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "x = np.linspace(-np.log(2)/2, np.log(2)/2, 1000)\n", "\n", "plt.plot(x, np.exp(x)-p4(x), color=\"g\", label=\"$e^x-p_4(x)$\")\n", "plt.plot(x, np.exp(x)-r(x), color=\"b\", label=\"$e^x-r(x)$\")\n", "plt.xlabel(\"x\")\n", "plt.ylabel(\"f(x)\")\n", "plt.legend()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "La fonction $x \\mapsto r(x)$ semble mieux approximer $x \\mapsto e^x$ que le polynôme de Taylor $x \\mapsto p_4(x)$. En effet, l'erreur commise par $r$ est constamment plus faible (plus proche de $0$) que celle commise par $p_4$. On notera cependant que pour les deux approximations, l'erreur est très faible au voisinage de l'origine." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# EXERCICE 2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Implémenter une fonction Python prenant en paramètres trois réels $a \\neq 0$, $b$ et $c$, et renvoyant les deux racines du polynôme $ax^2 + bx + c$ dans un vecteur Numpy. S'il n'y a pas de racines réelles, renvoyer un vecteur de NaN. S'il y a une racine double, la placer deux fois dans le vecteur." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "def roots(a,b,c):\n", " delta = b**2-4*a*c\n", " if delta < 0:\n", " return(np.array([np.nan, np.nan]))\n", " else:\n", " return(np.array([ (-b+np.sqrt(delta))/(2*a), (-b-np.sqrt(delta))/(2*a) ]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# EXERCICE 3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Une façon possible de calculer la valeur de $\\pi$ est de mesurer le périmètre d'un cercle de rayon $1/2$. On va utiliser cette remarque pour proposer une approximation de $\\pi$ en approximant le périmètre du cercle $C = \\left\\{(x,y) \\mid x^2+y^2 = \\frac{1}{2}\\right\\}$.\n", "\n", "Pour ce faire, on trace $P_n$ le polygône régulier à $2^n$ côtés inscrit dans $C$. Lorsque $n \\rightarrow +\\infty$, le polygône approche $C$ et son périmètre approche donc $\\pi$. Pour $n=2$ par exemple, $P_2$ est le carré de sommets $\\left(\\frac{1}{2},0\\right), \\left(0,\\frac{1}{2}\\right), \\left(\\frac{-1}{2},0\\right), \\left(0,\\frac{-1}{2}\\right)$. Son périmètre est noté $p_2 = 2\\sqrt{2}$.\n", "\n", "De façon générale, on peut montrer qu'en notant $p_n$ le périmètre de $P_n$, on a la formule de récurrence\n", " $$r_3 = \\frac{2}{2+\\sqrt{2}},~ \\forall n \\geq 3,~ \\left\\{\\begin{array}{rcl}\n", " r_{n+1} & = & \\frac{r_n}{2+\\sqrt{4-r_n}},\\\\\n", " p_{n+1} & = & 2^n\\sqrt{r_{n+1}}.\n", " \\end{array}\\right. $$\n", "\n", "a) Tracer, sur une même figure, $C$, $P_2$, $P_3$ et $P_4$.\n", "\n", "b) Calculer $p_n$ pour $n$ allant de $4$ à $515$. Donner les résultats de $n=4$ à $n=30$ puis $n=520$ à $n=540$ dans un tableau formaté, indiquant également les valeurs des erreurs commises.\n", "\n", "c) Donner le nombre de chiffres significatifs de $p_{15}$, $p_{24}$ et $p_{539}$." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zL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/AVAOwNwH3+kpI4mrFwo45lKDTK0gkUgkZQQ5w5dIJJIyglT4EolEUkaQCl8ikUjKCFLhSyQSSRlBKnyJRCIpI0iFL5FIJGUEqfAlEomkjPB/gJqTqfeHZZ8AAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "theta = np.linspace(0, 2*np.pi, 1000)\n", "\n", "plt.plot(np.cos(theta)/2, np.sin(theta)/2, color=\"black\", label=\"$C$\")\n", "\n", "colors = [\"r\",\"g\",\"b\"]\n", "for n in [2,3,4]:\n", " k = 2**n\n", " x = [np.cos(2*np.pi*i/k)/2 for i in range(k+1)]\n", " y = [np.sin(2*np.pi*i/k)/2 for i in range(k+1)]\n", " plt.plot(x, y, color=colors[n-2], label=\"$P_{}$\".format(n))\n", "\n", "plt.legend()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " n || p_n || pi-p_n \n", "----------------------------------\n", " 4 || +3.121445152 || +2.0148e-02\n", " 5 || +3.136548491 || +5.0442e-03\n", " 6 || +3.140331157 || +1.2615e-03\n", " 7 || +3.141277251 || +3.1540e-04\n", " 8 || +3.141513801 || +7.8852e-05\n", " 9 || +3.141572940 || +1.9713e-05\n", " 10 || +3.141587725 || +4.9283e-06\n", " 11 || +3.141591422 || +1.2321e-06\n", " 12 || +3.141592346 || +3.0802e-07\n", " 13 || +3.141592577 || +7.7005e-08\n", " 14 || +3.141592634 || +1.9251e-08\n", " 15 || +3.141592649 || +4.8128e-09\n", " 16 || +3.141592652 || +1.2032e-09\n", " 17 || +3.141592653 || +3.0080e-10\n", " 18 || +3.141592654 || +7.5200e-11\n", " 19 || +3.141592654 || +1.8800e-11\n", " 20 || +3.141592654 || +4.6998e-12\n", " 21 || +3.141592654 || +1.1751e-12\n", " 22 || +3.141592654 || +2.9354e-13\n", " 23 || +3.141592654 || +7.2831e-14\n", " 24 || +3.141592654 || +1.7764e-14\n", " 25 || +3.141592654 || +3.9968e-15\n", " 26 || +3.141592654 || +4.4409e-16\n", " 27 || +3.141592654 || -4.4409e-16\n", " 28 || +3.141592654 || -4.4409e-16\n", " 29 || +3.141592654 || -4.4409e-16\n", " 30 || +3.141592654 || -4.4409e-16\n", "----------------------------------\n", "515 || +3.141592654 || -4.4409e-16\n", "516 || +3.141592654 || -4.4409e-16\n", "517 || +3.141592654 || -9.7700e-15\n", "518 || +3.141592654 || -9.7700e-15\n", "519 || +3.141592654 || -1.5454e-13\n", "520 || +3.141592654 || +4.2455e-13\n", "521 || +3.141592654 || +5.0568e-12\n", "522 || +3.141592654 || +5.0568e-12\n", "523 || +3.141592654 || -3.1999e-11\n", "524 || +3.141592654 || -3.1999e-11\n", "525 || +3.141592655 || -1.2178e-09\n", "526 || +3.141592655 || -1.2178e-09\n", "527 || +3.141592645 || +8.2686e-09\n", "528 || +3.141592607 || +4.6214e-08\n", "529 || +3.141592911 || -2.5735e-07\n", "530 || +3.141591697 || +9.5691e-07\n", "531 || +3.141596554 || -3.9001e-06\n", "532 || +3.141596554 || -3.9001e-06\n", "533 || +3.141518840 || +7.3813e-05\n", "534 || +3.141207968 || +3.8469e-04\n", "535 || +3.142451272 || -8.5862e-04\n", "536 || +3.142451272 || -8.5862e-04\n", "537 || +3.162277660 || -2.0685e-02\n", "538 || +3.162277660 || -2.0685e-02\n", "539 || +2.828427125 || +3.1317e-01\n", "540 || +0.000000000 || +3.1416e+00\n" ] } ], "source": [ "r = [2 / (2+np.sqrt(2))]\n", "p = []\n", "print(\" n || {:^12} || {:^10}\".format(\"p_n\", \"pi-p_n\"))\n", "print(\"----------------------------------\")\n", "for n in range(4,31):\n", " r.append( r[-1] / (2+np.sqrt(4-r[-1])) )\n", " p.append( 2**(n-1)*np.sqrt(r[-1]) )\n", " print(\"{:>3} || {:+10.9f} || {:+5.4e}\".format(n, p[-1], np.pi-p[-1]))\n", "for n in range(31,515):\n", " r.append( r[-1] / (2+np.sqrt(4-r[-1])) )\n", " p.append( 2**(n-1)*np.sqrt(r[-1]) )\n", "print(\"----------------------------------\")\n", "for n in range(515,541):\n", " r.append( r[-1] / (2+np.sqrt(4-r[-1])) )\n", " p.append( 2**(n-1)*np.sqrt(r[-1]) )\n", " print(\"{:>3} || {:+10.9f} || {:+5.4e}\".format(n, p[-1], np.pi-p[-1]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "L'erreur commise à $n=15$ est de $4.8128e-09$, soit directement inférieure à $0.5e-8$. Il y a donc $8$ chiffres significatifs dans les décimales, soit $9$ chiffres significatifs au total.\n", "\n", "De même, à $n=24$ on a $14$ chiffres significatifs dans les décimales, donc $15$ au total.\n", "\n", "Enfin, à $n=539$ il n'y a plus aucun chiffre significatif." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Utilisation de la bibliothèque numérique Python" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function bissection in MTH2210:\n", "\n", "MTH2210.bissection = bissection(f, x0, x1, nb_iter=100, tol_rel=1e-08, tol_abs=1e-08, output='')\n", " Méthode de recherche d'une racine de la fonction f via la méthode de la bissection :\n", " - x_g et x_d donnés, vérifiant f(x_g)*f(x_d) < 0, et x_c = (x_g+x_d)/2 et f(x_c),\n", " - si f(x_c) = 0, on a trouvé la racine,\n", " - si f(x_g)*f(x_c) < 0, alors la méthode est relancée avec x_g inchangé et x_d = x_c,\n", " - si f(x_c)*f(x_d) < 0, alors la méthode est relancée avec x_g = x_c et x_d inchangé,\n", " - à chaque itération k, le point noté x_k est x_c.\n", " \n", " Les arguments attendus sont :\n", " - une fonction f, admettant en entrée un scalaire x et renvoyant un scalaire f(x),\n", " - deux scalaires x0 et x1 (de type int, float ou np.float64), les bornes de l'intervalle de recherche contenant la racine à localiser.\n", " \n", " Les arguments optionnels sont :\n", " - un entier nb_iter défiinissant le nombre maximal d'itérations allouées à la méthode,\n", " - un réel tol_rel définissant la condition d'arrêt abs(x_k-x_km1) / (abs(x_k)+eps) <= tol_rel,\n", " - un réel tol_abs définissant la condition d'arrêt abs(f(x_k)) <= tol_abs,\n", " - une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - les bornes initiales doivent satisfaire f(x0)*f(x1) < 0 pour garantir l'existence d'une racine dans [x0,x1],\n", " - f est définie en x0 et x1, et renvoie en chacun de ces points un scalaire,\n", " - nb_iter, tol_rel et tol_abs sont positifs,\n", " - tous les paramètres reçus ont bien le type attendu.\n", " \n", " Les sorties de la méthode sont :\n", " - list_x, la liste des points centraux de l'intervalle de recherche à chaque itération (donc les approximations x_k de la racine),\n", " - list_f, les valeurs par f des éléments de list_x.\n", " \n", " Exemples d'appel :\n", " - bissection(lambda x : np.sin(x), -0.5, 1/3),\n", " - bissection(lambda x : 10**20*np.sin(x), -0.5, 0.25),\n", " - bissection(f, x0, x1, output=\"dossier_test/Résultats.txt\") où f est définie via def, x0 et x1 sont deux réels.\n", "\n", "\n", "\n", "\n", "\n", "x, f = MTH2210.bissection(lambda x : x, -0.5, 1/3) :\n", "\n", " k || x_g | x_d || f_g | f_d || x_c | f_c\n", "-------------------------------------------------------------------------------------------\n", " 0 || -5.0000e-01 | +3.3333e-01 || -5.0000e-01 | +3.3333e-01 || -8.3333e-02 | -8.3333e-02\n", " 1 || -8.3333e-02 | +3.3333e-01 || -8.3333e-02 | +3.3333e-01 || +1.2500e-01 | +1.2500e-01\n", " 2 || -8.3333e-02 | +1.2500e-01 || -8.3333e-02 | +1.2500e-01 || +2.0833e-02 | +2.0833e-02\n", " 3 || -8.3333e-02 | +2.0833e-02 || -8.3333e-02 | +2.0833e-02 || -3.1250e-02 | -3.1250e-02\n", " 4 || -3.1250e-02 | +2.0833e-02 || -3.1250e-02 | +2.0833e-02 || -5.2083e-03 | -5.2083e-03\n", " 5 || -5.2083e-03 | +2.0833e-02 || -5.2083e-03 | +2.0833e-02 || +7.8125e-03 | +7.8125e-03\n", " 6 || -5.2083e-03 | +7.8125e-03 || -5.2083e-03 | +7.8125e-03 || +1.3021e-03 | +1.3021e-03\n", " 7 || -5.2083e-03 | +1.3021e-03 || -5.2083e-03 | +1.3021e-03 || -1.9531e-03 | -1.9531e-03\n", " 8 || -1.9531e-03 | +1.3021e-03 || -1.9531e-03 | +1.3021e-03 || -3.2552e-04 | -3.2552e-04\n", " 9 || -3.2552e-04 | +1.3021e-03 || -3.2552e-04 | +1.3021e-03 || +4.8828e-04 | +4.8828e-04\n", " 10 || -3.2552e-04 | +4.8828e-04 || -3.2552e-04 | +4.8828e-04 || +8.1380e-05 | +8.1380e-05\n", " 11 || -3.2552e-04 | +8.1380e-05 || -3.2552e-04 | +8.1380e-05 || -1.2207e-04 | -1.2207e-04\n", " 12 || -1.2207e-04 | +8.1380e-05 || -1.2207e-04 | +8.1380e-05 || -2.0345e-05 | -2.0345e-05\n", " 13 || -2.0345e-05 | +8.1380e-05 || -2.0345e-05 | +8.1380e-05 || +3.0518e-05 | +3.0518e-05\n", " 14 || -2.0345e-05 | +3.0518e-05 || -2.0345e-05 | +3.0518e-05 || +5.0863e-06 | +5.0863e-06\n", " 15 || -2.0345e-05 | +5.0863e-06 || -2.0345e-05 | +5.0863e-06 || -7.6294e-06 | -7.6294e-06\n", " 16 || -7.6294e-06 | +5.0863e-06 || -7.6294e-06 | +5.0863e-06 || -1.2716e-06 | -1.2716e-06\n", " 17 || -1.2716e-06 | +5.0863e-06 || -1.2716e-06 | +5.0863e-06 || +1.9073e-06 | +1.9073e-06\n", " 18 || -1.2716e-06 | +1.9073e-06 || -1.2716e-06 | +1.9073e-06 || +3.1789e-07 | +3.1789e-07\n", " 19 || -1.2716e-06 | +3.1789e-07 || -1.2716e-06 | +3.1789e-07 || -4.7684e-07 | -4.7684e-07\n", " 20 || -4.7684e-07 | +3.1789e-07 || -4.7684e-07 | +3.1789e-07 || -7.9473e-08 | -7.9473e-08\n", " 21 || -7.9473e-08 | +3.1789e-07 || -7.9473e-08 | +3.1789e-07 || +1.1921e-07 | +1.1921e-07\n", " 22 || -7.9473e-08 | +1.1921e-07 || -7.9473e-08 | +1.1921e-07 || +1.9868e-08 | +1.9868e-08\n", " 23 || -7.9473e-08 | +1.9868e-08 || -7.9473e-08 | +1.9868e-08 || -2.9802e-08 | -2.9802e-08\n", " 24 || -2.9802e-08 | +1.9868e-08 || -2.9802e-08 | +1.9868e-08 || -4.9671e-09 | -4.9671e-09\n", "Racine localisée à 1.0e-08 près : x = -4.9670537e-09 et f(x) = -4.9670537e-09\n", "\n", "x = [-0.08333333333333334, 0.12499999999999999, 0.020833333333333322, -0.031250000000000014, -0.005208333333333346, 0.007812499999999988, 0.001302083333333321, -0.0019531250000000126, -0.00032552083333334584, 0.00048828124999998753, 8.138020833332085e-05, -0.0001220703125000125, -2.0345052083345824e-05, 3.051757812498751e-05, 5.0862630208208436e-06, -7.62939453126249e-06, -1.2715657552208234e-06, 1.90734863280001e-06, 3.1789143878959334e-07, -4.76837158215615e-07, -7.947285971301085e-08, 1.1920928953829125e-07, 1.98682149126402e-08, -2.980232240018532e-08, -4.967053743772561e-09]\n", "f = [-0.08333333333333334, 0.12499999999999999, 0.020833333333333322, -0.031250000000000014, -0.005208333333333346, 0.007812499999999988, 0.001302083333333321, -0.0019531250000000126, -0.00032552083333334584, 0.00048828124999998753, 8.138020833332085e-05, -0.0001220703125000125, -2.0345052083345824e-05, 3.051757812498751e-05, 5.0862630208208436e-06, -7.62939453126249e-06, -1.2715657552208234e-06, 1.90734863280001e-06, 3.1789143878959334e-07, -4.76837158215615e-07, -7.947285971301085e-08, 1.1920928953829125e-07, 1.98682149126402e-08, -2.980232240018532e-08, -4.967053743772561e-09]\n" ] } ], "source": [ "############################\n", "# Méthode de la bissection #\n", "############################\n", "\n", "help(\"MTH2210.bissection\")\n", "\n", "print(\"\\n\\n\\n\")\n", "print(\"x, f = MTH2210.bissection(lambda x : x, -0.5, 1/3) :\\n\")\n", "x, f = MTH2210.bissection(lambda x : x, -0.5, 1/3)\n", "print(\"x =\", x)\n", "print(\"f =\", f)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function secante in MTH2210:\n", "\n", "MTH2210.secante = secante(f, x0, x1, nb_iter=100, tol_rel=1e-08, tol_abs=1e-08, output='')\n", " Méthode de recherche d'une racine de la fonction scalaire f via la méthode de la sécante :\n", " - x_0 et x_1 donnés,\n", " - d_k = (f(x_k)-f(x_km1)) / (x_k-x_km1),\n", " - x_kp1 = x_k - f(x_k) / d_k.\n", " \n", " Les arguments attendus sont :\n", " - une fonction f, admettant en entrée un scalaire x et renvoyant un scalaire f(x),\n", " - deux scalaires x0 et x1 (de type int, float ou np.float64), points de départ de la méthode itérative.\n", " \n", " Les arguments optionnels sont :\n", " - un entier nb_iter défiinissant le nombre maximal d'itérations allouées à la méthode,\n", " - un réel tol_rel définissant la condition d'arrêt abs(x_k-x_km1) / (abs(x_k)+eps) <= tol_rel,\n", " - un réel tol_abs définissant la condition d'arrêt abs(f(x_k)) <= tol_abs,\n", " - une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - f est définie en x0 et x1, et renvoie un scalaire,\n", " - df est définie en x0 et x1, et renvoie un scalaire,\n", " - tous les paramètres reçus ont bien le type attendu.\n", " \n", " Les sorties de la méthode sont :\n", " - list_x, la liste des points x_k,\n", " - list_f, les valeurs par f des éléments de list_x,\n", " - list_d, la liste des approximations d_k des dérivées de f en les x_k.\n", " \n", " Exemples d'appel :\n", " - secante(lambda x : np.sin(x), 1, 0.5),\n", " - secante(lambda x :x**2, 2, 1).\n", "\n", "\n", "\n", "\n", "\n", "x, f, d = MTH2210.secante(lambda x :x**2, 2, 1) :\n", "\n", " k || x_k | f(x_k) | df(x_k)\n", "----------------------------------------------\n", " 0 || +2.0000e+00 | +4.0000e+00 | - \n", " 1 || +1.0000e+00 | +1.0000e+00 | +3.0000e+00\n", " 2 || +6.6667e-01 | +4.4444e-01 | +3.0000e+00\n", " 3 || +4.0000e-01 | +1.6000e-01 | +1.6667e+00\n", " 4 || +2.5000e-01 | +6.2500e-02 | +1.0667e+00\n", " 5 || +1.5385e-01 | +2.3669e-02 | +6.5000e-01\n", " 6 || +9.5238e-02 | +9.0703e-03 | +4.0385e-01\n", " 7 || +5.8824e-02 | +3.4602e-03 | +2.4908e-01\n", " 8 || +3.6364e-02 | +1.3223e-03 | +1.5406e-01\n", " 9 || +2.2472e-02 | +5.0499e-04 | +9.5187e-02\n", " 10 || +1.3889e-02 | +1.9290e-04 | +5.8836e-02\n", " 11 || +8.5837e-03 | +7.3680e-05 | +3.6361e-02\n", " 12 || +5.3050e-03 | +2.8143e-05 | +2.2473e-02\n", " 13 || +3.2787e-03 | +1.0750e-05 | +1.3889e-02\n", " 14 || +2.0263e-03 | +4.1061e-06 | +8.5837e-03\n", " 15 || +1.2523e-03 | +1.5684e-06 | +5.3050e-03\n", " 16 || +7.7399e-04 | +5.9907e-07 | +3.2787e-03\n", " 17 || +4.7835e-04 | +2.2882e-07 | +2.0263e-03\n", " 18 || +2.9564e-04 | +8.7403e-08 | +1.2523e-03\n", " 19 || +1.8272e-04 | +3.3385e-08 | +7.7399e-04\n", " 20 || +1.1292e-04 | +1.2752e-08 | +4.7835e-04\n", " 21 || +6.9791e-05 | +4.8708e-09 | +2.9564e-04\n", "Racine localisée à 1.0e-08 près : x_k = +6.9790976e-05 et f(x_k) = 4.8708e-09\n", "\n", "x = [2, 1, 0.6666666666666667, 0.4, 0.25, 0.15384615384615385, 0.09523809523809523, 0.058823529411764705, 0.03636363636363636, 0.02247191011235955, 0.013888888888888888, 0.008583690987124463, 0.005305039787798408, 0.003278688524590164, 0.0020263424518743665, 0.0012523481527864744, 0.0007739938080495355, 0.00047835446065534564, 0.00029563932002956393, 0.00018271514708569338, 0.00011292417141889222, 6.979097602679973e-05]\n", "f = [4, 1, 0.44444444444444453, 0.16000000000000003, 0.0625, 0.02366863905325444, 0.009070294784580497, 0.0034602076124567475, 0.0013223140495867767, 0.0005049867440979674, 0.00019290123456790122, 7.367975096244175e-05, 2.814344715012418e-05, 1.0749798441279227e-05, 4.1060637322682194e-06, 1.5683758957876945e-06, 5.990664148990212e-07, 2.2882299002886662e-07, 8.740260754754292e-08, 3.3384824974546565e-08, 1.2751868490643353e-08, 4.870780334773334e-09]\n", "d = [3.0, 3.0, 1.6666666666666667, 1.0666666666666667, 0.6500000000000001, 0.40384615384615385, 0.2490842490842491, 0.15406162464985992, 0.09518716577540108, 0.05883554647599591, 0.03636079900124844, 0.02247257987601335, 0.013888730774922873, 0.008583728312388572, 0.00530503097646453, 0.0032786906046608413, 0.0020263419608360102, 0.001252348268704881, 0.0007739937806849095, 0.00047835446711525734, 0.00029563931850458555]\n" ] } ], "source": [ "############################\n", "# Méthode de la sécante #\n", "############################\n", "\n", "help(\"MTH2210.secante\")\n", "\n", "print(\"\\n\\n\\n\")\n", "print(\"x, f, d = MTH2210.secante(lambda x :x**2, 2, 1) :\\n\")\n", "x, f, d = MTH2210.secante(lambda x :x**2, 2, 1)\n", "print(\"x =\", x)\n", "print(\"f =\", f)\n", "print(\"d =\", d)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function newton_1d in MTH2210:\n", "\n", "MTH2210.newton_1d = newton_1d(f, df, x0, nb_iter=100, tol_rel=1e-08, tol_abs=1e-08, output='')\n", " Méthode de recherche d'une racine de la fonction scalaire f via la méthode de Newton :\n", " - x_0 donné,\n", " - x_kp1 = xk - f(xk)/f'(xk).\n", " \n", " Les arguments attendus sont :\n", " - une fonction f, admettant en entrée un scalaire x et renvoyant un scalaire f(x),\n", " - une fonction df, admettant en entrée un scalaire x et renvoyant un scalaire f'(x),\n", " - un scalaire x0 (de type int, float ou np.float64), point de départ de la méthode itérative.\n", " \n", " Les arguments optionnels sont :\n", " - un entier nb_iter définissant le nombre maximal d'itérations allouées à la méthode,\n", " - un réel tol_rel définissant la condition d'arrêt abs(x_k-x_km1) / (abs(x_k)+eps) <= tol_rel,\n", " - un réel tol_abs définissant la condition d'arrêt abs(f(x_k)) <= tol_abs,\n", " - une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - f est définie en x0, et renvoie un scalaire,\n", " - df est définie en x0, et renvoie un scalaire,\n", " - tous les paramètres reçus ont bien le type attendu.\n", " \n", " Les sorties de la méthode sont :\n", " - list_x, la liste des points x_k,\n", " - list_f, les valeurs par f des éléments de list_x,\n", " - list_d, les valeurs par df des éléments de list_x.\n", " \n", " Exemples d'appel :\n", " - newton_1d(lambda x : np.sin(x), lambda x:np.cos(x), 1),\n", " - newton_1d(lambda x :x**2, lambda x:2*x, 1).\n", "\n", "\n", "\n", "\n", "x, f, d = MTH2210.newton_1d(lambda x : np.sin(x), lambda x:np.cos(x), 1) :\n", "\n", " k || x_k | f(x_k) | df(x_k)\n", "-----------------------------------------------\n", " 0 || +1.0000e+00 | +8.4147e-01 | +5.4030e-01\n", " 1 || -5.5741e-01 | -5.2899e-01 | +8.4863e-01\n", " 2 || +6.5936e-02 | +6.5889e-02 | +9.9783e-01\n", " 3 || -9.5722e-05 | -9.5722e-05 | +1.0000e+00\n", " 4 || +2.9236e-13 | +2.9236e-13 | +1.0000e+00\n", "Racine localisée à 1.0e-08 près : x = +2.9235662e-13 et f(x) = +2.9235662e-13\n", "\n", "x = [1, -0.5574077246549021, 0.06593645192484066, -9.572191932508134e-05, 2.923566201412306e-13]\n", "f = [0.8414709848078965, -0.5289880970896319, 0.06588868458420974, -9.572191917890302e-05, 2.923566201412306e-13]\n", "d = [0.5403023058681398, 0.8486292436261492, 0.9978269796130803, 0.9999999954186571, 1.0]\n" ] } ], "source": [ "############################\n", "# Méthode de Newton 1D #\n", "############################\n", "\n", "help(\"MTH2210.newton_1d\")\n", "\n", "print(\"\\n\\n\")\n", "print(\"x, f, d = MTH2210.newton_1d(lambda x : np.sin(x), lambda x:np.cos(x), 1) :\\n\")\n", "x, f, d = MTH2210.newton_1d(lambda x : np.sin(x), lambda x:np.cos(x), 1)\n", "print(\"x =\", x)\n", "print(\"f =\", f)\n", "print(\"d =\", d)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function newton_nd in MTH2210:\n", "\n", "MTH2210.newton_nd = newton_nd(f, x0, nb_iter=100, tol_rel=1e-08, tol_abs=1e-08, output='')\n", " Méthode de recherche d'une racine de la fonction vectorielle f via la méthode de Newton avec approximation de la jacobienne :\n", " - x_0 donné,\n", " - x_kp1 = xk - Jac(f)(x_k)^-1*f(x_k).\n", " \n", " Les arguments attendus sont :\n", " - une fonction f, admettant en entrée un vecteur x et renvoyant un vecteur f(x),\n", " - un scalaire x0 (de type int, float ou np.float64), point de départ de la méthode itérative.\n", " \n", " Les arguments optionnels sont :\n", " - un entier nb_iter définissant le nombre maximal d'itérations allouées à la méthode,\n", " - un réel tol_rel définissant la condition d'arrêt abs(x_k-x_km1) / (abs(x_k)+eps) <= tol_rel,\n", " - un réel tol_abs définissant la condition d'arrêt abs(f(x_k)) <= tol_abs,\n", " - une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - f est définie en x0, et renvoie un vecteur de même dimension que x0,\n", " - tous les paramètres reçus ont bien le type attendu.\n", " \n", " Les sorties de la méthode sont :\n", " - list_x, la liste des points x_k,\n", " - list_f, les valeurs par f des éléments de list_x,\n", " - list_d, les valeurs par Jac(f) des éléments de list_x.\n", " \n", " Exemples d'appel :\n", " - newton_nd(lambda x:x**2, np.array([1,1,1])),\n", " - def f(x):\n", " return(np.array([x[0]**2, x[1]/2, np.sin(x[2])]))\n", " x0 = np.array([1,1,1])\n", " newton_nd(f, x0).\n", "\n", "\n", "\n", "\n", "x, f = MTH2210.newton_nd(lambda x:x**2, np.array([1,1,1])) :\n", "\n", " k || x_k | f(x_k) \n", "-----------------------------------------------------------------------------------------\n", " 0 || [+1.0000e+00, +1.0000e+00, +1.0000e+00] | [+1.0000e+00, +1.0000e+00, +1.0000e+00]\n", " 1 || [+5.0000e-01, +5.0000e-01, +5.0000e-01] | [+2.5000e-01, +2.5000e-01, +2.5000e-01]\n", " 2 || [+2.5000e-01, +2.5000e-01, +2.5000e-01] | [+6.2500e-02, +6.2500e-02, +6.2500e-02]\n", " 3 || [+1.2500e-01, +1.2500e-01, +1.2500e-01] | [+1.5625e-02, +1.5625e-02, +1.5625e-02]\n", " 4 || [+6.2500e-02, +6.2500e-02, +6.2500e-02] | [+3.9062e-03, +3.9062e-03, +3.9062e-03]\n", " 5 || [+3.1250e-02, +3.1250e-02, +3.1250e-02] | [+9.7656e-04, +9.7656e-04, +9.7656e-04]\n", " 6 || [+1.5625e-02, +1.5625e-02, +1.5625e-02] | [+2.4414e-04, +2.4414e-04, +2.4414e-04]\n", " 7 || [+7.8125e-03, +7.8125e-03, +7.8125e-03] | [+6.1035e-05, +6.1035e-05, +6.1035e-05]\n", " 8 || [+3.9062e-03, +3.9062e-03, +3.9062e-03] | [+1.5259e-05, +1.5259e-05, +1.5259e-05]\n", " 9 || [+1.9531e-03, +1.9531e-03, +1.9531e-03] | [+3.8147e-06, +3.8147e-06, +3.8147e-06]\n", " 10 || [+9.7656e-04, +9.7656e-04, +9.7656e-04] | [+9.5367e-07, +9.5367e-07, +9.5367e-07]\n", " 11 || [+4.8828e-04, +4.8828e-04, +4.8828e-04] | [+2.3842e-07, +2.3842e-07, +2.3842e-07]\n", " 12 || [+2.4414e-04, +2.4414e-04, +2.4414e-04] | [+5.9605e-08, +5.9605e-08, +5.9605e-08]\n", " 13 || [+1.2207e-04, +1.2207e-04, +1.2207e-04] | [+1.4901e-08, +1.4901e-08, +1.4901e-08]\n", " 14 || [+6.1035e-05, +6.1035e-05, +6.1035e-05] | [+3.7253e-09, +3.7253e-09, +3.7253e-09]\n", "Racine localisée à 1.0e-08 près : x = [+6.1035e-05, +6.1035e-05, +6.1035e-05] et f(x) = [+3.7253e-09, +3.7253e-09, +3.7253e-09]\n", "\n", "x = [array([1, 1, 1]), array([0.5, 0.5, 0.5]), array([0.25, 0.25, 0.25]), array([0.125, 0.125, 0.125]), array([0.0625, 0.0625, 0.0625]), array([0.03125, 0.03125, 0.03125]), array([0.015625, 0.015625, 0.015625]), array([0.0078125, 0.0078125, 0.0078125]), array([0.00390625, 0.00390625, 0.00390625]), array([0.00195312, 0.00195312, 0.00195312]), array([0.00097656, 0.00097656, 0.00097656]), array([0.00048828, 0.00048828, 0.00048828]), array([0.00024414, 0.00024414, 0.00024414]), array([0.00012207, 0.00012207, 0.00012207]), array([6.10351562e-05, 6.10351562e-05, 6.10351562e-05])]\n", "f = [array([1, 1, 1]), array([0.25, 0.25, 0.25]), array([0.0625, 0.0625, 0.0625]), array([0.015625, 0.015625, 0.015625]), array([0.00390625, 0.00390625, 0.00390625]), array([0.00097656, 0.00097656, 0.00097656]), array([0.00024414, 0.00024414, 0.00024414]), array([6.10351562e-05, 6.10351562e-05, 6.10351562e-05]), array([1.52587891e-05, 1.52587891e-05, 1.52587891e-05]), array([3.81469727e-06, 3.81469727e-06, 3.81469727e-06]), array([9.53674316e-07, 9.53674316e-07, 9.53674316e-07]), array([2.38418579e-07, 2.38418579e-07, 2.38418579e-07]), array([5.96046448e-08, 5.96046448e-08, 5.96046448e-08]), array([1.49011612e-08, 1.49011612e-08, 1.49011612e-08]), array([3.7252903e-09, 3.7252903e-09, 3.7252903e-09])]\n", "d = [array([[2., 0., 0.],\n", " [0., 2., 0.],\n", " [0., 0., 2.]]), array([[1., 0., 0.],\n", " [0., 1., 0.],\n", " [0., 0., 1.]]), array([[0.5, 0. , 0. ],\n", " [0. , 0.5, 0. ],\n", " [0. , 0. , 0.5]]), array([[0.25, 0. , 0. ],\n", " [0. , 0.25, 0. ],\n", " [0. , 0. , 0.25]]), array([[0.125, 0. , 0. ],\n", " [0. , 0.125, 0. ],\n", " [0. , 0. , 0.125]]), array([[0.0625, 0. , 0. ],\n", " [0. , 0.0625, 0. ],\n", " [0. , 0. , 0.0625]]), array([[0.03125, 0. , 0. ],\n", " [0. , 0.03125, 0. ],\n", " [0. , 0. , 0.03125]]), array([[0.015625, 0. , 0. ],\n", " [0. , 0.015625, 0. ],\n", " [0. , 0. , 0.015625]]), array([[0.0078125, 0. , 0. ],\n", " [0. , 0.0078125, 0. ],\n", " [0. , 0. , 0.0078125]]), array([[0.00390625, 0. , 0. ],\n", " [0. , 0.00390625, 0. ],\n", " [0. , 0. , 0.00390625]]), array([[0.00195312, 0. , 0. ],\n", " [0. , 0.00195312, 0. ],\n", " [0. , 0. , 0.00195312]]), array([[0.00097656, 0. , 0. ],\n", " [0. , 0.00097656, 0. ],\n", " [0. , 0. , 0.00097656]]), array([[0.00048828, 0. , 0. ],\n", " [0. , 0.00048828, 0. ],\n", " [0. , 0. , 0.00048828]]), array([[0.00024414, 0. , 0. ],\n", " [0. , 0.00024414, 0. ],\n", " [0. , 0. , 0.00024414]]), array([[0.00012207, 0. , 0. ],\n", " [0. , 0.00012207, 0. ],\n", " [0. , 0. , 0.00012207]])]\n" ] } ], "source": [ "############################\n", "# Méthode de Newton nD #\n", "############################\n", "\n", "help(\"MTH2210.newton_nd\")\n", "\n", "print(\"\\n\\n\")\n", "print(\"x, f = MTH2210.newton_nd(lambda x:x**2, np.array([1,1,1])) :\\n\")\n", "x, f, d = MTH2210.newton_nd(lambda x:x**2, np.array([1,1,1]))\n", "print(\"x =\", x)\n", "print(\"f =\", f)\n", "print(\"d =\", d)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function point_fixe in MTH2210:\n", "\n", "MTH2210.point_fixe = point_fixe(f, x0, nb_iter=100, tol_rel=1e-08, tol_abs=1e-08, output='')\n", " Méthode de calcul d'un point fixe x=f(x) par méthode itérative :\n", " - x_0 donné,\n", " - x_kp1 = f(x_k).\n", " \n", " Les arguments attendus sont :\n", " - une fonction f, admettant en entrée un vecteur x, renvoyant un vecteur f(x) de même dimension que x,\n", " - un vecteur x0, point de départ de la méthode itérative.\n", " \n", " Les arguments optionnels sont :\n", " - un entier nb_iter défiinissant le nombre maximal d'itérations allouées à la méthode,\n", " - un réel tol_rel définissant la condition d'arrêt e_k = norm(x_k-x_km1) / (norm(x_k)+eps) <= tol_rel,\n", " - un réel tol_abs définissant la condition d'arrêt norm(f(x_k)-x_k) <= tol_abs,\n", " - une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - la fonction f est définie en x0,\n", " - norm(f(x0)-x0) >= norm(f(f(x0)-f(x0)))\n", " - f(x0) renvoie un vecteur de la même dimension que x0.\n", " \n", " À noter que si x est un vecteur de dim 1, f doit être implémentée avec parcimonie pour ne pas renvoyer un mauvais type. Par exemple, en définissant :\n", " - x = np.array(1) est un np.ndarray, x = np.array([1]) également,\n", " - f(x) = np.cos(x) est un np.float64,\n", " - f(x) = np.array(np.cos(x)) est un np.ndarray,\n", " - f(x) = np.cos(t) est un np.float64.\n", " Ces différences de types peuvent faire échouer la méthode si x est de dimension 1. La méthode est conçue pour fonctionner suivant :\n", " - si la dimension de x est > 1 :\n", " - x défini par un np.array([coordonnées]),\n", " - f(x) renvoyant un np.ndarray de même dimension que x,\n", " - si x est de dimension 1 :\n", " - x défini par un np.float64(valeur), un float ou un int,\n", " - f(x) renvoyant un np.float64,\n", " - cas sans garantie de fonctionnement correct :\n", " - x complexe,\n", " - x de dimension 1 défini par un np.array([valeur]).\n", " \n", " La sortie de la méthode est :\n", " - list_x, la liste des points x_k.\n", " \n", " Exemples d'appel :\n", " - point_fixe(lambda x : x**2, 0.5),\n", " - point_fixe(lambda x : x**2, np.array([0.1,0.1])).\n", "\n", "\n", "\n", "\n", "cas x de dim 1 : x = MTH2210.point_fixe(lambda x :x**2, 0.5) :\n", "\n", " k || norm(f_k-x_k) || x_k | f_k \n", "--------------------------------------------------\n", " 0 || 2.5000000e-01 || 5.00000e-01 | 2.50000e-01\n", " 1 || 1.8750000e-01 || 2.50000e-01 | 6.25000e-02\n", " 2 || 5.8593750e-02 || 6.25000e-02 | 3.90625e-03\n", " 3 || 3.8909912e-03 || 3.90625e-03 | 1.52588e-05\n", " 4 || 1.5258556e-05 || 1.52588e-05 | 2.32831e-10\n", " 5 || 2.3283064e-10 || 2.32831e-10 | 5.42101e-20\n", "Point fixe localisé à 1.0e-08 près : norme(f(x_k)-x_k) = 2.3283e-10\n", "\n", "x = [0.5, 0.25, 0.0625, 0.00390625, 1.52587890625e-05, 2.3283064365386963e-10]\n", "\n", "\n", "\n", "cas x de dim > 1 : x = MTH2210.point_fixe(lambda x : x**2, np.array([0.1,0.1])) :\n", "\n", " k || norm(f_k-x_k) || x_k | f_k \n", "--------------------------------------------------------------------------------\n", " 0 || 1.2727922e-01 || [+1.0000e-01, +1.0000e-01] | [+1.0000e-02, +1.0000e-02]\n", " 1 || 1.4000714e-02 || [+1.0000e-02, +1.0000e-02] | [+1.0000e-04, +1.0000e-04]\n", " 2 || 1.4140721e-04 || [+1.0000e-04, +1.0000e-04] | [+1.0000e-08, +1.0000e-08]\n", " 3 || 1.4142135e-08 || [+1.0000e-08, +1.0000e-08] | [+1.0000e-16, +1.0000e-16]\n", " 4 || 1.4142136e-16 || [+1.0000e-16, +1.0000e-16] | [+1.0000e-32, +1.0000e-32]\n", "Point fixe localisé à 1.0e-08 près : norme(f(x_k)-x_k) = 1.4142e-16\n", "\n", "x = [array([0.1, 0.1]), array([0.01, 0.01]), array([0.0001, 0.0001]), array([1.e-08, 1.e-08]), array([1.e-16, 1.e-16])]\n" ] } ], "source": [ "############################\n", "# Recherche du point fixe #\n", "############################\n", "\n", "help(\"MTH2210.point_fixe\")\n", "\n", "print(\"\\n\\n\")\n", "print(\"cas x de dim 1 : x = MTH2210.point_fixe(lambda x :x**2, 0.5) :\\n\")\n", "x = MTH2210.point_fixe(lambda x :x**2, 0.5)\n", "print(\"x =\", x)\n", "\n", "print(\"\\n\\n\")\n", "\n", "print(\"cas x de dim > 1 : x = MTH2210.point_fixe(lambda x : x**2, np.array([0.1,0.1])) :\\n\")\n", "x = MTH2210.point_fixe(lambda x : x**2, np.array([0.1,0.1]))\n", "print(\"x =\", x)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function lagrange in MTH2210:\n", "\n", "MTH2210.lagrange = lagrange(x, y, x_e, output='')\n", " Calcul du polynôme d'interpolation de Lagrange passant par tous les points (x_k,y_k) donnés en paramètres x et y :\n", " - pour tout z, Lagrange(x,y)(z) = somme(j)( y_j * prod(i)((x_i-z)/(x_i-x_j)) ).\n", " \n", " Les arguments attendus sont :\n", " - un vecteur x, contenant les abscisses des points d'interpolation,\n", " - un vecteur y, contenant les ordonnées des points d'interpolation,\n", " - un vecteur x_e, contenant les abscisses des points auxquels le polynôme d'interpolation sera évalué.\n", " \n", " L'argument optionnel est :\n", " - une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - x et y ont même dimension,\n", " - x, y et x_e contiennent des réels,\n", " - x ne contient pas deux fois la même abscisse,\n", " - tous les paramètres reçus ont bien le type attendu.\n", " \n", " Les sorties de la méthode sont :\n", " - y_e, la liste des valeurs du polynôme aux abscisses x_e,\n", " - interpolation, une fonction renvoyant les valeurs du polynôme en chacun des éléments du vecteur d'abscisses qu'on lui passe en paramètre.\n", " \n", " Exemples d'appel :\n", " - lagrange([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2]),\n", " - lagrange(np.array([-1,0,1]), np.array([0,-1,0]), np.array([-2,-1,-0.5,0,0.5,1,2])),\n", " - y_e, lag = lagrange([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2]), puis lag(np.array([3,4,5])).\n", "\n", "\n", "\n", "\n", "y, l = MTH2210.lagrange([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2]) :\n", "\n", " x || y \n", " --------------------------\n", " -1.0000e+00 || +0.0000e+00\n", " +0.0000e+00 || -1.0000e+00\n", " +1.0000e+00 || +0.0000e+00\n", " --------------------------\n", " x_e || y_e \n", " --------------------------\n", " -2.0000e+00 || +3.0000e+00\n", " -1.0000e+00 || +0.0000e+00\n", " -5.0000e-01 || -7.5000e-01\n", " +0.0000e+00 || -1.0000e+00\n", " +5.0000e-01 || -7.5000e-01\n", " +1.0000e+00 || +0.0000e+00\n", " +2.0000e+00 || +3.0000e+00\n", "\n", "y = [ 3. 0. -0.75 -1. -0.75 0. 3. ]\n", "l = .interpolation at 0x7ffaf781eb00>\n", "La fonction l s'utilise comme suit :\n", "l(5) = 24.0\n", "l(np.array([5,10,100])) = [ 24. 99. 9999.]\n" ] } ], "source": [ "############################\n", "# Interpolation Lagrange #\n", "############################\n", "\n", "help(\"MTH2210.lagrange\")\n", "\n", "print(\"\\n\\n\")\n", "print(\"y, l = MTH2210.lagrange([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2]) :\\n\")\n", "y, l = MTH2210.lagrange([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2])\n", "print(\"y =\", y)\n", "print(\"l =\", l)\n", "print(\"La fonction l s'utilise comme suit :\")\n", "print(\"l(5) =\", l(5))\n", "print(\"l(np.array([5,10,100])) =\", l(np.array([5,10,100])))" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function spline_cub in MTH2210:\n", "\n", "MTH2210.spline_cub = spline_cub(x, y, x_e, cond_g=0, val_g=0, cond_d=0, val_d=0, output='')\n", " Calcul d'une spline cubique d'interpolation de tous les points (x_k,y_k) donnés en paramètres x et y.\n", " \n", " Les arguments attendus sont :\n", " - un vecteur x, contenant les abscisses des points d'interpolation,\n", " \n", " - un vecteur y, contenant les ordonnées des points d'interpolation,\n", " \n", " - un vecteur x_e, contenant les abscisses des points auxquels le polynôme d'interpolation sera évalué.\n", " \n", " Les arguments optionnels sont :\n", " - un entier cond_g dans [0,1,2,3], déterminant la condition à gauche (défaut = 0) :\n", " - cond_g = 0 impose la condition naturelle à gauche,\n", " - cond_g = 1 impose à la courbure à gauche de valoir val_g,\n", " - cond_g = 2 impose à la courbure d'être constante à gauche,\n", " - cond_g = 3 impose à la pente à gauche de valoir val_g,\n", " - un réel val_g, utilisé dans la détermination de la condition à gauche (ignorée si cond_g = 0 ou 2) (défaut = 0),\n", " - un entier cond_d dans [0,1,2,3], déterminant la condition à droite (analogue à cond_g),\n", " - un réel val_d, utilisé dans la détermination de la condition à droite (analogue à val_g),\n", " - une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - x et y ont même dimension,\n", " - x, y et x_e contiennent des réels,\n", " - x ne contient pas deux fois la même abscisse,\n", " - les valeurs de x sont dans l'ordre croissant,\n", " - cond_g et cond_d sont tous les deux dans [0,1,2,3],\n", " - tous les paramètres reçus ont bien le type attendu.\n", " \n", " Les sorties de la méthode sont :\n", " - y_e, la liste des valeurs du polynôme aux abscisses x_e,\n", " - interpolation, une fonction renvoyant les valeurs de la spline en chacun des éléments du vecteur d'abscisses qu'on lui passe en paramètre.\n", " \n", " Exemples d'appel :\n", " - spline_cub([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2]),\n", " - spline_cub(np.array([-1,0,1]), np.array([0,-1,0]), np.array([-2,-1,-0.5,0,0.5,1,2])),\n", " - y_e, spl = spline_cub([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2]), puis spl(np.array([3,4,5])).\n", "\n", "\n", "\n", "\n", "Cas par défaut, spline naturelle : y, s = MTH2210.spline_cub([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2]) :\n", "\n", " x || y \n", " --------------------------\n", " -1.0000e+00 || +0.0000e+00\n", " +0.0000e+00 || -1.0000e+00\n", " +1.0000e+00 || +0.0000e+00\n", " --------------------------\n", " x_e || y_e \n", " --------------------------\n", " -2.0000e+00 || +1.0000e+00\n", " -1.0000e+00 || +0.0000e+00\n", " -5.0000e-01 || -6.8750e-01\n", " +0.0000e+00 || -1.0000e+00\n", " +5.0000e-01 || -6.8750e-01\n", " +1.0000e+00 || +0.0000e+00\n", " +2.0000e+00 || +1.0000e+00\n", "\n", "y = [ 1. 0. -0.6875 -1. -0.6875 0. 1. ]\n", "s = .interpolation at 0x7ffaf782a290>\n", "La fonction s s'utilise comme suit :\n", "s(5) = -26.0\n", "s(np.array([5,10,100])) = [-2.60000e+01 -3.51000e+02 -4.85001e+05]\n", "\n", "\n", "\n", "Les autres cas s'obtiennent via les paramètres optionnels cond_g, val_g, cond_d, val_d :\n", "MTH2210.spline_cub(x, y, x_e, cond_g, val_g, cond_d, val_d)\n" ] } ], "source": [ "############################\n", "# Interpolation spline cub #\n", "############################\n", "\n", "help(\"MTH2210.spline_cub\")\n", "\n", "print(\"\\n\\n\")\n", "print(\"Cas par défaut, spline naturelle : y, s = MTH2210.spline_cub([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2]) :\\n\")\n", "y, s = MTH2210.spline_cub([-1,0,1], [0,-1,0], [-2,-1,-0.5,0,0.5,1,2])\n", "print(\"y =\", y)\n", "print(\"s =\", s)\n", "print(\"La fonction s s'utilise comme suit :\")\n", "print(\"s(5) =\", s(5))\n", "print(\"s(np.array([5,10,100])) =\", s(np.array([5,10,100])))\n", "\n", "print(\"\\n\\n\")\n", "print(\"Les autres cas s'obtiennent via les paramètres optionnels cond_g, val_g, cond_d, val_d :\")\n", "print(\"MTH2210.spline_cub(x, y, x_e, cond_g, val_g, cond_d, val_d)\")" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function euler in MTH2210:\n", "\n", "MTH2210.euler = euler(f, x0, t0, tm, m, output='')\n", " Méthode de résolution numérique d'une équation (dx/dt)(t) = f(x(t),t) par le schéma d'Euler :\n", " - x_0 donné, t_0 donné, pas de temps h donné,\n", " - x_kp1 = x_k + h*f(x_k,t_k),\n", " - t_kp1 = t_k + h.\n", " \n", " Les arguments attendus sont :\n", " - une fonction f, admettant en entrée un vecteur x et un réel t, renvoyant un vecteur f(x,t),\n", " - un vecteur x0, condition initiale de l'équation,\n", " - deux réels t0 et tm, les bornes de l'intervalle de temps sur lequel l'équation est appliquée,\n", " - un entier m, le pas de discrétisation de [t0,tm], définissant donc h = (tm-t0)/m.\n", " \n", " L'argument optionnel est une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - la fonction f est définie en (x0,t0) et en (x0,tm),\n", " - f(x0,t0) renvoie un vecteur de la même dimension et même type que x0,\n", " - tous les paramètres reçus ont bien le type attendu.\n", " \n", " À noter que si x est un vecteur de dim 1, f doit être implémentée avec parcimonie pour ne pas renvoyer un mauvais type. Par exemple :\n", " - x = np.array(0) est un np.ndarray, x = np.array([0]) également,\n", " - f(x,t) = np.cos(np.array(0)) est un np.float64,\n", " - f(x,t) = np.cos(np.array([0])) est un np.ndarray,\n", " - f(x,t) = np.cos(t) est un np.float64.\n", " Ces différences de types peuvent faire échouer la méthode si x est de dimension 1. La méthode est conçue pour fonctionner suivant :\n", " - si la dimension de x est > 1 :\n", " - x défini par un np.array([coordonnées]),\n", " - f(x,t) renvoyant un np.ndarray de même dimension que x,\n", " - si x est de dimension 1 :\n", " - x défini par un np.float64(valeur), un float ou un int,\n", " - f(x,t) renvoyant un np.float64,\n", " - cas sans garantie de fonctionnement correct :\n", " - x complexe,\n", " - x de dimension 1 défini par un np.array([valeur]).\n", " \n", " Les sorties de la méthode sont :\n", " - list_x, la liste des points x(t_k),\n", " - list_t, la liste des instants t_k.\n", " \n", " Exemples d'appel :\n", " - euler(lambda x,t : np.cos(t), np.float64(0), 0, 2*np.pi, 100),\n", " - euler(lambda x,t : np.array([np.cos(t),np.sin(t)]), np.array([0,0]), 0, 2*np.pi, 100),\n", " - def f(x,t):\n", " x0,x1 = 1,1\n", " return(np.array([x[0]*(x[1]-1),x[1]*(1-x[0])]))\n", " x = np.array([2,1])\n", " list_x, list_t = euler(f, x, 0, 10, 100).\n", "\n", "\n", "\n", "\n", "cas x de dim 1 : x, t = MTH2210.euler(lambda x,t : np.cos(t), 0, 0, 2*np.pi, 10) :\n", "\n", " k || t_k | x_k \n", "------------------------------\n", " 0 || 0.0000 | +0.0000e+00\n", " 1 || 0.6283 | +6.2832e-01\n", " 2 || 1.2566 | +1.1366e+00\n", " 3 || 1.8850 | +1.3308e+00\n", " 4 || 2.5133 | +1.1366e+00\n", " 5 || 3.1416 | +6.2832e-01\n", " 6 || 3.7699 | +2.2204e-16\n", " 7 || 4.3982 | -5.0832e-01\n", " 8 || 5.0265 | -7.0248e-01\n", " 9 || 5.6549 | -5.0832e-01\n", " 10 || 6.2832 | +0.0000e+00\n", "Nombre maximal d'itérations k_max = 10 atteint\n", "\n", "x = [0.0, 0.6283185307179586, 1.1366388999494847, 1.3308000038220313, 1.1366388999494847, 0.6283185307179588, 2.220446049250313e-16, -0.5083203692315258, -0.7024814731040725, -0.5083203692315259, 0.0]\n", "t = [0, 0.6283185307179586, 1.2566370614359172, 1.8849555921538759, 2.5132741228718345, 3.141592653589793, 3.7699111843077517, 4.39822971502571, 5.026548245743669, 5.654866776461628, 6.283185307179586]\n", "\n", "\n", "\n", "cas x de dim > 1 : x, t = MTH2210.euler(lambda x,t : np.array([np.cos(t),np.sin(t)]), np.array([0,0]), 0, 2*np.pi, 10) :\n", "\n", " k || t_k | x_k \n", "---------------------------------------------\n", " 0 || 0.0000 | [+0.0000e+00, +0.0000e+00]\n", " 1 || 0.6283 | [+6.2832e-01, +0.0000e+00]\n", " 2 || 1.2566 | [+1.1366e+00, +3.6932e-01]\n", " 3 || 1.8850 | [+1.3308e+00, +9.6688e-01]\n", " 4 || 2.5133 | [+1.1366e+00, +1.5644e+00]\n", " 5 || 3.1416 | [+6.2832e-01, +1.9338e+00]\n", " 6 || 3.7699 | [+2.2204e-16, +1.9338e+00]\n", " 7 || 4.3982 | [-5.0832e-01, +1.5644e+00]\n", " 8 || 5.0265 | [-7.0248e-01, +9.6688e-01]\n", " 9 || 5.6549 | [-5.0832e-01, +3.6932e-01]\n", " 10 || 6.2832 | [+0.0000e+00, +0.0000e+00]\n", "Nombre maximal d'itérations k_max = 10 atteint\n", "\n", "x = [array([0, 0]), array([0.62831853, 0. ]), array([1.1366389 , 0.36931637]), array([1.3308 , 0.9668828]), array([1.1366389 , 1.56444923]), array([0.62831853, 1.9337656 ]), array([2.22044605e-16, 1.93376560e+00]), array([-0.50832037, 1.56444923]), array([-0.70248147, 0.9668828 ]), array([-0.50832037, 0.36931637]), array([0., 0.])]\n", "t = [0, 0.6283185307179586, 1.2566370614359172, 1.8849555921538759, 2.5132741228718345, 3.141592653589793, 3.7699111843077517, 4.39822971502571, 5.026548245743669, 5.654866776461628, 6.283185307179586]\n" ] } ], "source": [ "############################\n", "# Méthode d'approx d'Euler #\n", "############################\n", "\n", "help(\"MTH2210.euler\")\n", "\n", "print(\"\\n\\n\")\n", "print(\"cas x de dim 1 : x, t = MTH2210.euler(lambda x,t : np.cos(t), 0, 0, 2*np.pi, 10) :\\n\")\n", "x, t = MTH2210.euler(lambda x,t : np.cos(t), 0, 0, 2*np.pi, 10)\n", "print(\"x =\", x)\n", "print(\"t =\", t)\n", "\n", "print(\"\\n\\n\")\n", "print(\"cas x de dim > 1 : x, t = MTH2210.euler(lambda x,t : np.array([np.cos(t),np.sin(t)]), np.array([0,0]), 0, 2*np.pi, 10) :\\n\")\n", "x, t = MTH2210.euler(lambda x,t : np.array([np.cos(t),np.sin(t)]), np.array([0,0]), 0, 2*np.pi, 10)\n", "print(\"x =\", x)\n", "print(\"t =\", t)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function rk4 in MTH2210:\n", "\n", "MTH2210.rk4 = rk4(f, x0, t0, tm, m, output='')\n", " Méthode de résolution numérique d'une équation (dx/dt)(t) = f(x(t),t) par le schéma de Runge-Kutta d'ordre 4 :\n", " - x_0 donné, t_0 donné, pas de temps h donné,\n", " - y_k^1 = f(x_k , t_k ),\n", " - y_k^2 = f(x_k+y_k^1*h/2, t_k+h/2),\n", " - y_k^2 = f(x_k+y_k^2*h/2, t_k+h/2),\n", " - y_k^4 = f(x_k+y_k^3*h , t_k+h ),\n", " - x_kp1 = x_k + (y_k^1+2y_k^2+3y_k^3+y_k^4)*h/6,\n", " - t_kp1 = t_k + h.\n", " \n", " Les arguments attendus sont :\n", " - une fonction f, admettant en entrée un vecteur x et un réel t, renvoyant un vecteur f(x,t),\n", " - un vecteur x0, condition initiale de l'équation,\n", " - deux réels t0 et tm, les bornes de l'intervalle de temps sur lequel l'équation est appliquée,\n", " - un entier m, le pas de discrétisation de [t0,tm], définissant donc h = (tm-t0)/m.\n", " \n", " L'argument optionnel est une chaîne de caractères output qui renvoie les affichages de la fonction vers :\n", " - la sortie standard si output = \"\",\n", " - un fichier ayant pour nom+extension output (le paramètre doit donc contenir l'extension voulue, et le chemin d'accès doit exister),\n", " - nul part (aucune information écrite ni sauvegardée) si output = \"None\".\n", " \n", " La méthode vérifie les conditions suivantes :\n", " - la fonction f est définie en (x0,t0) et en (x0,tm),\n", " - f(x0,t0) renvoie un vecteur de la même dimension et même type que x0,\n", " - tous les paramètres reçus ont bien le type attendu.\n", " \n", " À noter que si x est un vecteur de dim 1, f doit être implémentée avec parcimonie pour ne pas renvoyer un mauvais type. Par exemple :\n", " - x = np.array(0) est un np.ndarray, x = np.array([0]) également,\n", " - f(x,t) = np.cos(np.array(0)) est un np.float64,\n", " - f(x,t) = np.cos(np.array([0])) est un np.ndarray,\n", " - f(x,t) = np.cos(t) est un np.float64.\n", " Ces différences de types peuvent faire échouer la méthode si x est de dimension 1. La méthode est conçue pour fonctionner suivant :\n", " - si la dimension de x est > 1 :\n", " - x défini par un np.array([coordonnées]),\n", " - f(x,t) renvoyant un np.ndarray de même dimension que x,\n", " - si x est de dimension 1 :\n", " - x défini par un np.float64(valeur), un float ou un int,\n", " - f(x,t) renvoyant un np.float64,\n", " - cas sans garantie de fonctionnement correct :\n", " - x complexe,\n", " - x de dimension 1 défini par un np.array([valeur]).\n", " \n", " Les sorties de la méthode sont :\n", " - list_x, la liste des points x(t_k),\n", " - list_t, la liste des instants t_k.\n", " \n", " Exemples d'appel :\n", " - rk4(lambda x,t : np.cos(t), np.float64(0), 0, 2*np.pi, 100),\n", " - rk4(lambda x,t : np.array([np.cos(t),np.sin(t)]), np.array([0,0]), 0, 2*np.pi, 100),\n", " - def f(x,t):\n", " x0,x1 = 1,1\n", " return(np.array([x[0]*(x[1]-x1),x[1]*(x0-x[0])]))\n", " x = np.array([2,1])\n", " list_x, list_t = rk4(f, x, 0, 10, 100).\n", "\n", "\n", "\n", "\n", "cas x de dim 1 : x, t = MTH2210.rk4(lambda x,t : np.cos(t), np.float64(0), 0, 2*np.pi, 10) :\n", "\n", " k || t_k | x_k \n", "------------------------------\n", " 0 || 0.0000 | +0.0000e+00\n", " 1 || 0.6283 | +5.8782e-01\n", " 2 || 1.2566 | +9.5111e-01\n", " 3 || 1.8850 | +9.5111e-01\n", " 4 || 2.5133 | +5.8782e-01\n", " 5 || 3.1416 | +1.1102e-16\n", " 6 || 3.7699 | -5.8782e-01\n", " 7 || 4.3982 | -9.5111e-01\n", " 8 || 5.0265 | -9.5111e-01\n", " 9 || 5.6549 | -5.8782e-01\n", " 10 || 6.2832 | -3.3307e-16\n", "Nombre maximal d'itérations k_max = 10 atteint\n", "\n", "x = [0.0, 0.5878174386237882, 0.9511085948731945, 0.9511085948731945, 0.5878174386237882, 1.1102230246251565e-16, -0.5878174386237881, -0.9511085948731945, -0.9511085948731947, -0.5878174386237884, -3.3306690738754696e-16]\n", "t = [0, 0.6283185307179586, 1.2566370614359172, 1.8849555921538759, 2.5132741228718345, 3.141592653589793, 3.7699111843077517, 4.39822971502571, 5.026548245743669, 5.654866776461628, 6.283185307179586]\n", "\n", "\n", "\n", "cas x de dim > 1 : x, t = MTH2210.rk4(lambda x,t : np.array([np.cos(t),np.sin(t)]), np.array([0,0]), 0, 2*np.pi, 10) :\n", "\n", " k || t_k | x_k \n", "---------------------------------------------\n", " 0 || 0.0000 | [+0.0000e+00, +0.0000e+00]\n", " 1 || 0.6283 | [+5.8782e-01, +1.9099e-01]\n", " 2 || 1.2566 | [+9.5111e-01, +6.9102e-01]\n", " 3 || 1.8850 | [+9.5111e-01, +1.3091e+00]\n", " 4 || 2.5133 | [+5.8782e-01, +1.8091e+00]\n", " 5 || 3.1416 | [+1.1102e-16, +2.0001e+00]\n", " 6 || 3.7699 | [-5.8782e-01, +1.8091e+00]\n", " 7 || 4.3982 | [-9.5111e-01, +1.3091e+00]\n", " 8 || 5.0265 | [-9.5111e-01, +6.9102e-01]\n", " 9 || 5.6549 | [-5.8782e-01, +1.9099e-01]\n", " 10 || 6.2832 | [-3.3307e-16, +0.0000e+00]\n", "Nombre maximal d'itérations k_max = 10 atteint\n", "\n", "x = [array([0, 0]), array([0.58781744, 0.19099346]), array([0.95110859, 0.69102084]), array([0.95110859, 1.30908867]), array([0.58781744, 1.80911605]), array([1.11022302e-16, 2.00010952e+00]), array([-0.58781744, 1.80911605]), array([-0.95110859, 1.30908867]), array([-0.95110859, 0.69102084]), array([-0.58781744, 0.19099346]), array([-3.33066907e-16, 0.00000000e+00])]\n", "t = [0, 0.6283185307179586, 1.2566370614359172, 1.8849555921538759, 2.5132741228718345, 3.141592653589793, 3.7699111843077517, 4.39822971502571, 5.026548245743669, 5.654866776461628, 6.283185307179586]\n" ] } ], "source": [ "############################\n", "# Méthode d'approx via RK4 #\n", "############################\n", "\n", "help(\"MTH2210.rk4\")\n", "\n", "print(\"\\n\\n\")\n", "print(\"cas x de dim 1 : x, t = MTH2210.rk4(lambda x,t : np.cos(t), np.float64(0), 0, 2*np.pi, 10) :\\n\")\n", "x, t = MTH2210.rk4(lambda x,t : np.cos(t), np.float64(0), 0, 2*np.pi, 10)\n", "print(\"x =\", x)\n", "print(\"t =\", t)\n", "\n", "print(\"\\n\\n\")\n", "print(\"cas x de dim > 1 : x, t = MTH2210.rk4(lambda x,t : np.array([np.cos(t),np.sin(t)]), np.array([0,0]), 0, 2*np.pi, 10) :\\n\")\n", "x, t = MTH2210.rk4(lambda x,t : np.array([np.cos(t),np.sin(t)]), np.array([0,0]), 0, 2*np.pi, 10)\n", "print(\"x =\", x)\n", "print(\"t =\", t)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }