Files
modeconverter/fiber_modes.ipynb
T

85 KiB

In [17]:
import sys
import scipy
import numpy as np
import matplotlib.pyplot as plt
import ofiber
In [18]:
V = 3.8
ell = 0
plt.subplots(1, 2, figsize=(10, 4))
plt.subplot(1, 2, 1)
aplt = ofiber.plot_LP_modes(V, ell)
plt.subplot(1, 2, 2)
ell = 1

aplt = ofiber.plot_LP_modes(V, ell)
aplt.show()
In [19]:
plt.subplots(figsize=(8,4.5))
r_over_a = np.linspace(-1.2, 1.2, 100)

for ell in range(3):
    for em in range(1,2):
        b = ofiber.LP_mode_value(V, ell, em)
        if b is None:
            continue
        irradiance = ofiber.LP_radial_irradiance(V, b, ell, r_over_a)
        i = np.argmax(irradiance)

        plt.plot(r_over_a, irradiance)
        plt.annotate(r" LP$_{%d%d}$" % (ell,em), xy=(r_over_a[i],irradiance[i]), va="bottom", ha="center")

plt.xlabel("r / r$_{core}$")
plt.ylabel("Normalized Irradiance")
plt.plot([-1, -1], [0, 5], ":k")
plt.plot([1, 1], [0, 5], ":k")
plt.axvspan(-1, 1, color="cyan", alpha=0.5)
plt.title("Step-index fiber, V=%.2f" % V)
plt.ylim(0, 5)
plt.xlim(-1.2, 1.2)
plt.show()