.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/kinetics/oscillators/plot_01_brusselator.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_api_gallery_kinetics_oscillators_plot_01_brusselator.py: Prigogine and Lefever's Brusselator limit cycle ================================================== Below the Hopf-bifurcation threshold (:math:`B < 1 + A^2`) the Brusselator's single fixed point is a stable focus and any initial concentration relaxes toward it. Above threshold, that same fixed point becomes unstable and every trajectory is drawn instead onto a surrounding stable limit cycle -- sustained chemical oscillation with no external forcing, driven purely by the autocatalytic :math:`X^2 Y` term. .. GENERATED FROM PYTHON SOURCE LINES 14-21 .. code-block:: Python import matplotlib.pyplot as plt from chemistrykit.kinetics.systems.oscillators import Brusselator from chemistrykit.kinetics.visualizers.kinetics_plots import plot_concentration_vs_time, plot_phase_portrait fig, axes = plt.subplots(2, 2, figsize=(11, 8)) .. image-sg:: /api/gallery/kinetics/oscillators/images/sphx_glr_plot_01_brusselator_001.png :alt: plot 01 brusselator :srcset: /api/gallery/kinetics/oscillators/images/sphx_glr_plot_01_brusselator_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 22-23 Below threshold: relaxation to the fixed point (X*, Y*) = (A, B/A). .. GENERATED FROM PYTHON SOURCE LINES 23-32 .. code-block:: Python below = Brusselator(X0=2.0, Y0=0.2, A=1.0, B=1.5) result_below = below.integrate((0.0, 60.0), dt=1e-2, method="rk4") plot_concentration_vs_time(result_below, ax=axes[0, 0]) axes[0, 0].set_title(f"Below threshold (B={below.B} < 1+A^2={1 + below.A**2}): relaxes to fixed point") plot_phase_portrait(result_below, "X", "Y", ax=axes[0, 1]) fp_below = below.fixed_point() axes[0, 1].plot(*fp_below, "k*", markersize=12, label="fixed point") axes[0, 1].legend() .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 33-34 Above threshold: a stable limit cycle around the now-unstable fixed point. .. GENERATED FROM PYTHON SOURCE LINES 34-45 .. code-block:: Python above = Brusselator(X0=1.0, Y0=1.0, A=1.0, B=3.0) result_above = above.integrate((0.0, 60.0), dt=1e-2, method="rk4") plot_concentration_vs_time(result_above, ax=axes[1, 0]) axes[1, 0].set_title(f"Above threshold (B={above.B} > 1+A^2={1 + above.A**2}): sustained oscillation") plot_phase_portrait(result_above, "X", "Y", ax=axes[1, 1]) fp_above = above.fixed_point() axes[1, 1].plot(*fp_above, "k*", markersize=12, label="unstable fixed point") axes[1, 1].legend() fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.304 seconds) .. _sphx_glr_download_api_gallery_kinetics_oscillators_plot_01_brusselator.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_brusselator.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_brusselator.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_brusselator.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_