.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_ch7\ch7_heatLagrange.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_ch7_ch7_heatLagrange.py: ==================================== 7.04 Lagrange Heat Equation ==================================== We reproduce here the figure 7.6 of the book. Utilitary functions can be found next to this file. Here, we only define codpy-related functions. .. GENERATED FROM PYTHON SOURCE LINES 10-12 Necessary Imports ------------------------ .. GENERATED FROM PYTHON SOURCE LINES 12-28 .. code-block:: Python import os import sys import matplotlib.pyplot as plt try: CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) except NameError: CURRENT_DIR = os.getcwd() data_path = os.path.join(CURRENT_DIR, "data") PARENT_DIR = os.path.abspath(os.path.join(CURRENT_DIR, "..")) sys.path.insert(0, PARENT_DIR) from utils.ch7.ch7_utils import Lagrangian .. GENERATED FROM PYTHON SOURCE LINES 29-37 Problem statement ------------------------ We consider the following semi-discrete scheme for $t \mapsto Y(t) \in \mathbb{R}^{N,D}$ $$\frac{d}{dt} Y = \nabla_k \cdot (\nabla_k Y)^{-1} = \nabla_k \cdot \Big( \Delta_k\Big)^{-1} \nabla_k Y, \quad Y(0,x) = X, $$ This figure shows our results with this numerical scheme. In the left=hand picture the initial condition, taken as a two-dimensional variate of a standard normal law. The figure in the middle displays the evolution at the time $t=1$. The right-hand picture is a standard scaling of this last to unit variance. .. GENERATED FROM PYTHON SOURCE LINES 37-39 .. code-block:: Python Lagrangian() plt.show() .. image-sg:: /auto_ch7/images/sphx_glr_ch7_heatLagrange_001.png :alt: initial condition, time evolution, sharp sequences :srcset: /auto_ch7/images/sphx_glr_ch7_heatLagrange_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.061 seconds) .. _sphx_glr_download_auto_ch7_ch7_heatLagrange.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ch7_heatLagrange.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ch7_heatLagrange.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: ch7_heatLagrange.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_