{"id":1821,"date":"2023-03-29T18:49:00","date_gmt":"2023-03-29T16:49:00","guid":{"rendered":"https:\/\/www.gistlabs.net\/weblogs\/?p=1821"},"modified":"2026-03-29T20:35:13","modified_gmt":"2026-03-29T18:35:13","slug":"algo-chaos-2-le-papillon-de-lorenz","status":"publish","type":"post","link":"https:\/\/www.gistlabs.net\/weblogs\/algo-chaos-2-le-papillon-de-lorenz\/","title":{"rendered":"Algo &#038; Chaos 2 : Le Papillon de Lorenz"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"269\" src=\"https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/CirculationVents.png\" alt=\"\" class=\"wp-image-1845\" srcset=\"https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/CirculationVents.png 700w, https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/CirculationVents-300x115.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n<p>Le travail de mod\u00e9lisation de Lorenz sur la convection atmosph\u00e9rique nous offre un excellent exemple d&#8217;attracteurs \u00e9tranges chaotiques.<\/p>\n\n<!--more-->\n\n<h2>Objectifs<\/h2>\n<h3>Math\u00e9matiques<\/h3>\n<ul>\n<li>R\u00e9soudre num\u00e9riquement le syst\u00e8me d&#8217;\u00e9quations diff\u00e9rentielles de Lorenz<\/li>\n<li>Visualiser dans l&#8217;espace des phases en 3D<\/li>\n<li>Visualiser l&#8217;influence des conditions initiales<\/li>\n<\/ul>\n<h3>Informatiques<\/h3>\n<ul>\n<li>Utiliser un g\u00e9n\u00e9rateur Python (yield)<\/li>\n<li>Tracer des courbes en 3D<\/li>\n<li>Animer une fen\u00eatre matplotlib<\/li>\n<li>Enregistrer des animations en .gif ou mp4<\/li>\n<\/ul>\n<h2>L&#8217;origine du papillon<\/h2>\n<p>En 1962, <strong>Edward Norton Lorenz<\/strong> publie un mod\u00e8le simplifi\u00e9 d&#8217;atmosph\u00e8re bas\u00e9 sur les \u00e9quations de Navier-Stokes.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/EdwardLorenz.jpg\" alt=\"Edward Lorenz\" width=\"300\" \/><\/p>\n<p>En 1972, il propose ce titre c\u00e9l\u00e8bre :<\/p>\n<blockquote>\n<p>Le battement d&#8217;ailes d&#8217;un papillon au Br\u00e9sil peut-il provoquer une tornade au Texas ?<\/p>\n<\/blockquote>\n<p>C&#8217;est l&#8217;origine de l&#8217;<strong>Effet papillon<\/strong>.<\/p>\n<p><strong>Vid\u00e9o :<\/strong> <a href=\"https:\/\/www.youtube.com\/watch?v=YrOyRCD7M14\">Science \u00e9tonnante &#8211; Le chaos<\/a><\/p>\n<h2>Les \u00e9quations de Lorenz<\/h2>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/EquationsDeLorenz.png\" alt=\"\u00c9quations de Lorenz\" \/><\/p>\n<pre><code class=\"language-python\">def lorenz(x, y, z, s=10, r=28, b=2.667):\n    x_point = s*(y - x)\n    y_point = r*x - y - x*z\n    z_point = x*y - b*z\n    return x_point, y_point, z_point\n\ndef lorenz_gen(x0, y0, z0):\n    x, y, z = x0, y0, z0\n    dt = 0.01\n    while True:\n        yield x, y, z\n        x_point, y_point, z_point = lorenz(x, y, z)\n        x = x + x_point * dt\n        y = y + y_point * dt\n        z = z + z_point * dt\n<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/habib256\/algo-chaos\/blob\/main\/2.PapillonDeLorenz\/LorenzGenerator.py\">Code sur GitHub<\/a><\/p>\n<h2>Visualisation 3D<\/h2>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/Lorenz3D.png\" alt=\"Lorenz 3D\" \/><\/p>\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\nNbPasMax = 10000\nxs, ys, zs = [], [], []\nposition = iter(lorenz_gen(0., 1., 3.))\n\nfor i in range(NbPasMax):\n    x, y, z = next(position)\n    xs.append(x)\n    ys.append(y)\n    zs.append(z)\n\nfig = plt.figure()\nax = plt.axes(projection='3d')\nax.plot(xs, ys, zs, lw=0.5)\nplt.show()\n<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/habib256\/algo-chaos\/blob\/main\/2.PapillonDeLorenz\/Lorenz3dBasic.py\">Code sur GitHub<\/a><\/p>\n<h2>Sensibilit\u00e9 aux conditions initiales<\/h2>\n<p>En 1961, Lorenz d\u00e9couvrit que des conditions initiales l\u00e9g\u00e8rement diff\u00e9rentes produisaient des trajectoires compl\u00e8tement divergentes.<\/p>\n<blockquote>\n<p>\u00ab Tout syst\u00e8me physique ayant un comportement non p\u00e9riodique est impr\u00e9visible. \u00bb &#8211; Edward Lorenz<\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/Lorenz2DXY.gif\" alt=\"Animation 2D\" \/><\/p>\n<p><a href=\"https:\/\/github.com\/habib256\/algo-chaos\/blob\/main\/2.PapillonDeLorenz\/Lorenz2dTrajectoireXY.py\">Code de l&#8217;animation<\/a><\/p>\n<h2>Animations spectaculaires<\/h2>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/LorenzSpiderAnim.gif\" alt=\"Animation Spider\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/github.com\/habib256\/algo-chaos\/blob\/main\/2.PapillonDeLorenz\/LorenzBlackHoles.py\">Code sur GitHub<\/a><\/p>\n<h2>Circuit \u00e9lectronique<\/h2>\n<p>Il est possible de construire un circuit \u00e9lectrique r\u00e9el visualisant le papillon de Lorenz sur oscilloscope :<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.gistlabs.net\/weblogs\/wp-content\/uploads\/2026\/03\/lorenz_ckt_640.jpg\" alt=\"Circuit Lorenz\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>Notre incapacit\u00e9 \u00e0 mesurer les conditions initiales avec pr\u00e9cision infinie implique qu&#8217;il nous sera \u00e0 jamais impossible de pr\u00e9dire l&#8217;avenir avec certitude !<\/p>\n<p><strong>Documentaire :<\/strong> <a href=\"https:\/\/www.chaos-math.org\/fr.html\">CHAOS: UNE AVENTURE MATH\u00c9MATIQUE<\/a><\/p>\n<p><strong>D\u00e9p\u00f4t GitHub :<\/strong> <a href=\"https:\/\/github.com\/habib256\/algo-chaos\/tree\/main\/2.PapillonDeLorenz\">algo-chaos\/2.PapillonDeLorenz<\/a><\/p>\n\n\n<p><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Le travail de mod\u00e9lisation de Lorenz sur la convection atmosph\u00e9rique nous offre un excellent exemple d&#8217;attracteurs \u00e9tranges chaotiques.<\/p><p><a class=\"more-link btn\" href=\"https:\/\/www.gistlabs.net\/weblogs\/algo-chaos-2-le-papillon-de-lorenz\/\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":1845,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[551,9,12],"tags":[546,514,548,549,545,393,547,504,483,550],"class_list":["post-1821","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-algo-chaos","category-dev","category-sciences","tag-attracteur","tag-chaos","tag-effet-papillon","tag-equations-differentielles","tag-lorenz","tag-math","tag-matplotlib","tag-python","tag-simulation","tag-visualisation","item-wrap"],"_links":{"self":[{"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/posts\/1821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/comments?post=1821"}],"version-history":[{"count":3,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/posts\/1821\/revisions"}],"predecessor-version":[{"id":1866,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/posts\/1821\/revisions\/1866"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/media\/1845"}],"wp:attachment":[{"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/media?parent=1821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/categories?post=1821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/tags?post=1821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}