.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/plate_tectonics/plot_16_nuvel1_euler_circuit.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_plate_tectonics_plot_16_nuvel1_euler_circuit.py: NUVEL-1 relative plate motions (1990) ===================================== Charles DeMets, Richard Gordon, Donald Argus and Seth Stein fitted spreading rates, transform azimuths and earthquake slip vectors for all the major plates at once. The fit requires every circuit of relative Euler vectors to close: the motion of A relative to C is A-B plus B-C. At a triple junction the three relative velocities then form a closed triangle. The Euler vectors here are synthetic. .. GENERATED FROM PYTHON SOURCE LINES 12-62 .. image-sg:: /api/gallery/plate_tectonics/images/sphx_glr_plot_16_nuvel1_euler_circuit_001.png :alt: The velocity triangle closes :srcset: /api/gallery/plate_tectonics/images/sphx_glr_plot_16_nuvel1_euler_circuit_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.constants import EARTH_RADIUS from earthsciencekit.plate_tectonics import compose_euler_vectors, euler_velocity_x, euler_velocity_y, euler_velocity_z from earthsciencekit.units import convert def euler_vector(latitude, longitude, degrees_per_myr): rate = convert(degrees_per_myr, "degree", "rad") / convert(1e6, "year", "s") lat, lon = np.deg2rad(latitude), np.deg2rad(longitude) return rate * np.array([np.cos(lat) * np.cos(lon), np.cos(lat) * np.sin(lon), np.sin(lat)]) def velocity(omega, r): return np.array( [ euler_velocity_x(omega[1], omega[2], r[1], r[2]), euler_velocity_y(omega[2], omega[0], r[2], r[0]), euler_velocity_z(omega[0], omega[1], r[0], r[1]), ] ) omega_ab = euler_vector(48.7, -78.2, 0.78) omega_bc = euler_vector(-10.0, -60.0, 0.5) omega_ac = compose_euler_vectors(omega_ab, omega_bc) np.testing.assert_allclose(compose_euler_vectors(omega_ac, -omega_ac), 0) lat, lon = np.deg2rad(20.0), np.deg2rad(-110.0) r = EARTH_RADIUS * np.array([np.cos(lat) * np.cos(lon), np.cos(lat) * np.sin(lon), np.sin(lat)]) east = np.array([-np.sin(lon), np.cos(lon), 0]) north = np.array([-np.sin(lat) * np.cos(lon), -np.sin(lat) * np.sin(lon), np.cos(lat)]) legs = {"A relative to B": velocity(omega_ab, r), "B relative to C": velocity(omega_bc, r), "C relative to A": velocity(-omega_ac, r)} np.testing.assert_allclose(sum(legs.values()), 0, atol=1e-20) fig, ax = plt.subplots() corners = [np.zeros(2)] for name, v in legs.items(): step = convert(np.array([east @ v, north @ v]), "m/s", "cm/year") ax.annotate("", corners[-1] + step, corners[-1], arrowprops={"arrowstyle": "->", "lw": 2}) ax.text(*(corners[-1] + step / 2), name, ha="center", va="bottom") corners.append(corners[-1] + step) assert np.allclose(corners[-1], 0, atol=1e-12) ax.plot(*np.array(corners).T, "o", color="k", ms=4) ax.set(xlabel="east [cm/year]", ylabel="north [cm/year]", title="The velocity triangle closes", aspect="equal") ax.margins(0.25) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.068 seconds) .. _sphx_glr_download_api_gallery_plate_tectonics_plot_16_nuvel1_euler_circuit.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/plate_tectonics/plot_16_nuvel1_euler_circuit.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_16_nuvel1_euler_circuit.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_16_nuvel1_euler_circuit.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_16_nuvel1_euler_circuit.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_