.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/basic/plot_U_vs_V.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_gallery_basic_plot_U_vs_V.py: Figure 3.13 of Jacques Bures ============================ .. GENERATED FROM PYTHON SOURCE LINES 8-10 Imports ~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 10-49 .. code-block:: Python import numpy from PyFiberModes.fiber import get_fiber_from_delta_and_V0 from PyFiberModes import HE11, TE01, TM01, HE21, EH11, HE31, HE12, HE22, HE32 from PyFiberModes.fundamentals import get_U_parameter import matplotlib.pyplot as plt figure, ax = plt.subplots(1, 1) ax.set( title='Mode fields for vectorial mode if x-direction', xlabel='V number', ylabel='U number', ) V0_list = numpy.linspace(0.5, 12, 150) for mode in [HE11, TE01, TM01, HE21, EH11, HE31, HE12, HE22, HE32]: data_list = [] for V0 in V0_list: fiber = get_fiber_from_delta_and_V0( delta=0.3, V0=V0, wavelength=1310e-9 ) data = get_U_parameter( fiber=fiber, mode=mode, wavelength=fiber.wavelength ) data_list.append(data) ax.plot(V0_list, data_list, label=str(mode), linewidth=1.5) ax.plot(V0_list, V0_list, linewidth=2, label='U = V') _ = figure.show() .. image-sg:: /gallery/basic/images/sphx_glr_plot_U_vs_V_001.png :alt: Mode fields for vectorial mode if x-direction :srcset: /gallery/basic/images/sphx_glr_plot_U_vs_V_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 5.628 seconds) .. _sphx_glr_download_gallery_basic_plot_U_vs_V.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_U_vs_V.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_U_vs_V.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_