Skip to content

Commit

Permalink
Chap 4 - Équations LaTeX et graphique de 10 rectangles
Browse files Browse the repository at this point in the history
  • Loading branch information
plstonge committed May 13, 2024
1 parent cdc7a97 commit e5a430a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions 4-collectives.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -425,18 +425,34 @@
},
{
"cell_type": "markdown",
"id": "780f805a-0702-4bbd-8895-fa9789e78ce1",
"id": "ceb94aaa-b702-4490-a433-adeb4964d90c",
"metadata": {},
"source": [
"### Exemple - Intégration par la méthode des rectangles\n",
"Soit la fonction :\n",
"\n",
"$$f(x) = \\sin^2{x \\mathrm{e}^{-x}}$$\n",
"$$f(x) = \\sin^2(x) \\ \\mathrm{e}^{-x}$$\n",
"\n",
"Calculons en parallèle une approximation de l'intégrale $I$\n",
"de cette fonction dans l'intervalle allant de $0$ à $\\pi$ :\n",
"\n",
"$$I = \\int_{0}^{\\pi} \\sin^2{x \\mathrm{e}^{-x}} \\mathrm{d}x$$"
"$$I = \\int_{0}^{\\pi} \\sin^2(x) \\ \\mathrm{e}^{-x} \\mathrm{d}x\n",
" = 2(1 - \\mathrm{e}^{-\\pi}) / 5$$"
]
},
{
"cell_type": "markdown",
"id": "b8743ecd-5427-46e9-b488-c3ea24f55ea8",
"metadata": {},
"source": [
"Pour ce faire, nous calculerons $N$ rectangles de largeur\n",
"$\\Delta{}x = \\pi / N$ et d'abscisse $x_i = i\\Delta{}x$,\n",
"où $i$ varie de $0$ à $N - 1$ :\n",
"\n",
"$$I \\approx \\Sigma_{i=0}^{N-1} \\sin^2(x_i) \\ \\mathrm{e}^{-x_i} \\Delta{}x$$\n",
"$$I \\approx \\Sigma_{i=0}^{N-1} \\sin^2(i\\pi/N) \\ \\mathrm{e}^{-i\\pi/N} \\pi / N$$\n",
"\n",
"![Intégration par la méthode des rectangles](images/integration-rectangles.png)"
]
},
{
Expand Down
Binary file added images/integration-rectangles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e5a430a

Please sign in to comment.