.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/plasma/waves/plot_02_cma_diagram.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_plasma_waves_plot_02_cma_diagram.py: Stix's cold-plasma dielectric tensor and the CMA diagram ============================================================= Thomas Stix's 1962 *The Theory of Plasma Waves* organized the zoo of magnetized cold-plasma wave modes -- Alfven waves, whistlers, cyclotron waves, the ordinary and extraordinary radio-propagation modes -- into a single 3x3 dielectric tensor built from each species' plasma and cyclotron frequencies, .. math:: \mathbf{K} = \begin{pmatrix} S & -iD & 0 \\ iD & S & 0 \\ 0 & 0 & P \end{pmatrix}, from which every cold-plasma dispersion relation follows as one quartic equation in the refractive index. The Clemmow-Mullaly-Allis (CMA) diagram maps the entire parameter space of that quartic onto one two-dimensional plot. :func:`~physicskit.plasma.waves.stix_parameters` builds :math:`S`, :math:`D`, :math:`P` for an arbitrary multi-species plasma; :func:`~physicskit.plasma.waves.cold_plasma_dispersion` solves the resulting quartic at any propagation angle, and :func:`~physicskit.plasma.waves.cma_coordinates` supplies the CMA diagram's axes. .. GENERATED FROM PYTHON SOURCE LINES 29-34 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import physicskit as pk .. GENERATED FROM PYTHON SOURCE LINES 35-39 Tracing a CMA trajectory ---------------------------- A magnetized electron-proton plasma, swept in wave frequency across the electron cyclotron resonance, traces one path on the CMA map. .. GENERATED FROM PYTHON SOURCE LINES 39-46 .. code-block:: Python n0, B0 = 1e19, 1.0 wpe = pk.plasma.plasma_frequency(n0) wce = pk.plasma.cyclotron_frequency(pk.plasma.QE, pk.plasma.ME, B0) omega_scan = np.linspace(0.05 * wce, 5 * wce, 300) X, Y = pk.plasma.cma_coordinates(omega_scan, wpe, wce) .. GENERATED FROM PYTHON SOURCE LINES 47-50 At a fixed frequency, the same species build S, D, P, and solving the quartic gives the two cold-plasma wave branches at every propagation angle to B0. .. GENERATED FROM PYTHON SOURCE LINES 50-70 .. code-block:: Python species = [(n0, -pk.plasma.QE, pk.plasma.ME), (n0, pk.plasma.QE, pk.plasma.MP)] S, D, P = pk.plasma.stix_parameters(omega=2e9, B=B0, species=species) theta = np.linspace(0, np.pi / 2, 200) n2 = np.array([pk.plasma.cold_plasma_dispersion(th, S, D, P) for th in theta]) fig, axes = plt.subplots(1, 2, figsize=(10, 4)) pk.plasma.plot_cma_diagram(X, Y, ax=axes[0]) axes[0].set_title("CMA trajectory vs. wave frequency") axes[1].plot(theta, n2[:, 0], label=r"$n^2_+$") axes[1].plot(theta, n2[:, 1], label=r"$n^2_-$") axes[1].axhline(0.0, color="gray", linestyle="--", linewidth=0.8) axes[1].set_xlabel(r"$\theta$ (rad)") axes[1].set_ylabel(r"$n^2$") axes[1].set_title("Cold-plasma dispersion branches") axes[1].legend() fig.tight_layout() plt.show() .. image-sg:: /api/gallery/plasma/waves/images/sphx_glr_plot_02_cma_diagram_001.png :alt: CMA trajectory vs. wave frequency, Cold-plasma dispersion branches :srcset: /api/gallery/plasma/waves/images/sphx_glr_plot_02_cma_diagram_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.091 seconds) .. _sphx_glr_download_api_gallery_plasma_waves_plot_02_cma_diagram.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_cma_diagram.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_cma_diagram.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_cma_diagram.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_