.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/basic/plot_fiber_LP_modes.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_fiber_LP_modes.py: Groupe index VS core index ========================== .. GENERATED FROM PYTHON SOURCE LINES 8-10 Imports ~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 10-14 .. code-block:: Python from PyFiberModes import FiberFactory, HE11, HE12, HE22 import matplotlib.pyplot as plt import numpy .. GENERATED FROM PYTHON SOURCE LINES 15-18 Generating the fiber structures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here we create the different fiber design that we want to explore .. GENERATED FROM PYTHON SOURCE LINES 18-24 .. code-block:: Python core_indexes = numpy.linspace(1.454, 1.494, 30) factory = FiberFactory(wavelength=1550e-9) factory.add_layer(name="core", radius=7e-6, index=core_indexes) factory.add_layer(name="cladding", index=1.4444) .. GENERATED FROM PYTHON SOURCE LINES 25-26 Preparing the figure .. GENERATED FROM PYTHON SOURCE LINES 26-47 .. code-block:: Python figure, ax = plt.subplots(1, 1) ax.set( title='Groupe index vs core index', xlabel='Core refractive index', ylabel='Group index' ) for mode in [HE11, HE12, HE22]: neff = [] for fiber in factory: effective_index = fiber.get_group_index(mode) neff.append(effective_index) ax.plot(core_indexes, neff, label=str(mode)) plt.legend() plt.show() # - .. image-sg:: /gallery/basic/images/sphx_glr_plot_fiber_LP_modes_001.png :alt: Groupe index vs core index :srcset: /gallery/basic/images/sphx_glr_plot_fiber_LP_modes_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.166 seconds) .. _sphx_glr_download_gallery_basic_plot_fiber_LP_modes.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_fiber_LP_modes.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_fiber_LP_modes.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_