.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/ode_dynamics/bifurcations/plot_01_normal_forms.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_ode_dynamics_bifurcations_plot_01_normal_forms.py: Saddle-node, pitchfork, and Hopf bifurcation diagrams ========================================================== Plots the closed-form fixed points (or limit-cycle radius) of the three canonical bifurcation normal forms as a function of the control parameter ``r``, showing the characteristic collision-and-annihilation, splitting, and birth-of-a-limit-cycle shapes. .. GENERATED FROM PYTHON SOURCE LINES 12-17 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from mathematicskit.ode_dynamics.systems.bifurcations import hopf_limit_cycle_radius, pitchfork_fixed_points, saddle_node_fixed_points .. GENERATED FROM PYTHON SOURCE LINES 18-20 Saddle-node: two fixed points collide and annihilate ------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 20-24 .. code-block:: Python r_sn = np.linspace(-4.0, 1.0, 400) fp_sn = saddle_node_fixed_points(r_sn) .. GENERATED FROM PYTHON SOURCE LINES 25-27 Pitchfork: one branch splits into three --------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 27-31 .. code-block:: Python r_pf = np.linspace(-4.0, 4.0, 400) fp_pf = pitchfork_fixed_points(r_pf, kind="supercritical") .. GENERATED FROM PYTHON SOURCE LINES 32-34 Hopf: a limit cycle is born and grows -------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 34-56 .. code-block:: Python r_hopf = np.linspace(-2.0, 4.0, 400) radius_hopf = hopf_limit_cycle_radius(r_hopf) fig, axes = plt.subplots(1, 3, figsize=(13, 4)) axes[0].plot(r_sn, fp_sn[:, 0], color="steelblue") axes[0].plot(r_sn, fp_sn[:, 1], color="firebrick", linestyle="--") axes[0].set_title("Saddle-node") axes[0].set_xlabel("r") axes[1].plot(r_pf, fp_pf[:, 0], color="black") axes[1].plot(r_pf, fp_pf[:, 1], color="steelblue") axes[1].plot(r_pf, fp_pf[:, 2], color="steelblue") axes[1].set_title("Pitchfork (supercritical)") axes[1].set_xlabel("r") axes[2].plot(r_hopf, radius_hopf, color="steelblue") axes[2].set_title("Hopf: limit-cycle radius") axes[2].set_xlabel("r") fig.tight_layout() plt.show() .. image-sg:: /api/gallery/ode_dynamics/bifurcations/images/sphx_glr_plot_01_normal_forms_001.png :alt: Saddle-node, Pitchfork (supercritical), Hopf: limit-cycle radius :srcset: /api/gallery/ode_dynamics/bifurcations/images/sphx_glr_plot_01_normal_forms_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.079 seconds) .. _sphx_glr_download_api_gallery_ode_dynamics_bifurcations_plot_01_normal_forms.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_normal_forms.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_normal_forms.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_normal_forms.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_