.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/geophysics/plot_13_rikitake_two_disc_dynamo.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 or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_geophysics_plot_13_rikitake_two_disc_dynamo.py: Rikitake's two-disc dynamo (1958) ================================= Tsuneji Rikitake coupled two disc dynamos, each driven by the same torque and each powering the coil of the other. The currents never settle: they oscillate about one of two steady states of opposite sign and, at irregular intervals, jump to the other. The model was the first to show that a deterministic dynamo can reverse its field spontaneously, without any outside trigger, with polarity intervals of very unequal length, as in the geological record. .. GENERATED FROM PYTHON SOURCE LINES 12-39 .. image-sg:: /api/gallery/geophysics/images/sphx_glr_plot_13_rikitake_two_disc_dynamo_001.png :alt: Spontaneous reversals, Two unstable centres :srcset: /api/gallery/geophysics/images/sphx_glr_plot_13_rikitake_two_disc_dynamo_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.geophysics import rikitake_fixed_point, simulate_rikitake_dynamo mu, k = 1.0, 2.0 time = np.linspace(0, 400, 8001) result = simulate_rikitake_dynamo(mu, k, 1.0, time) x, y, z = result.values.T flips = np.flatnonzero(np.diff(np.sign(x))) assert flips.size > 10 lengths = np.diff(time[flips]) assert lengths.max() > 3 * np.median(lengths) steady = rikitake_fixed_point(mu, k) fig, (left, right) = plt.subplots(1, 2, figsize=(11, 4), gridspec_kw={"width_ratios": [2, 1]}) left.plot(time, x, lw=0.8) left.axhline(0, color="k", lw=0.5) left.set(xlabel="nondimensional time", ylabel="current x (sign = polarity)", title="Spontaneous reversals") right.plot(x, y, lw=0.4) right.plot([steady[0], -steady[0]], [steady[1], -steady[1]], "r*", ms=12, label="steady states") right.set(xlabel="x", ylabel="y", title="Two unstable centres") right.legend() fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.846 seconds) .. _sphx_glr_download_api_gallery_geophysics_plot_13_rikitake_two_disc_dynamo.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../lite/lab/index.html?path=api/gallery/geophysics/plot_13_rikitake_two_disc_dynamo.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_13_rikitake_two_disc_dynamo.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_13_rikitake_two_disc_dynamo.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_13_rikitake_two_disc_dynamo.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_