Mode solver semivectorialΒΆ

[1]:
import numpy as np
import matplotlib.pyplot as plt
import modes as ms

ms.mode_solver_semi(n_modes=2, thickness=0.22, width=0.5, wavelength=1.55, plot_index=True, plot=True)
[1]:
<modes._mode_solver_semi_vectorial.ModeSolverSemiVectorial at 0x7f84852dc040>
../_images/notebooks_10_mode_semi_1_1.png
../_images/notebooks_10_mode_semi_1_2.png
../_images/notebooks_10_mode_semi_1_3.png
[2]:
ms.mode_solver_semi(n_modes=2, thickness=0.22, width=0.5, wavelength=1.55, logscale=True, plot=True, plot_index=True)
[2]:
<modes._mode_solver_semi_vectorial.ModeSolverSemiVectorial at 0x7f8482e86f10>
../_images/notebooks_10_mode_semi_2_1.png
../_images/notebooks_10_mode_semi_2_2.png
../_images/notebooks_10_mode_semi_2_3.png
[3]:
ms.mode_solver_semi?

Convergence tests

Lets change the simulations size and see how the neff changes

[4]:
sub_widths = np.linspace(1.5, 3, 3)
n_effs = [ms.mode_solver_semi(plot=False, n_modes=1, sub_width=sub_width).results['n_effs'][0].real for sub_width in sub_widths]
[5]:
plt.plot(sub_widths, n_effs, '.-')
plt.xlabel('simulation width (um)')
plt.ylabel('neff')
[5]:
Text(0, 0.5, 'neff')
../_images/notebooks_10_mode_semi_6_1.png
[6]:
ds = np.linspace(0.01, 0.02, 3)
n_effs = [ms.mode_solver_semi(plot=False, n_modes=1, y_step=d, x_step=d).results['n_effs'][0].real for d in ds]
[7]:
plt.plot(ds*1e3, n_effs, '.-')
plt.xlabel('mesh size (nm)')
plt.ylabel('neff')
[7]:
Text(0, 0.5, 'neff')
../_images/notebooks_10_mode_semi_8_1.png
[8]:
d = 0.01
m = ms.mode_solver_semi(plot=False, n_modes=1, y_step=d, x_step=d)
[9]:
m.results
[9]:
{'modes': [array([[-1.22212706e-08+0.j, -8.75106883e-10+0.j, -1.35265699e-08+0.j,
          ...,  1.75989684e-09+0.j,  1.20416722e-08+0.j,
           6.12206070e-09+0.j],
         [-2.16327993e-08+0.j, -3.38750709e-08+0.j, -4.69190863e-08+0.j,
          ...,  4.74577268e-08+0.j,  3.68961702e-08+0.j,
           3.40223482e-08+0.j],
         [-3.96691909e-08+0.j, -6.75503158e-08+0.j, -8.14762270e-08+0.j,
          ...,  7.81833683e-08+0.j,  7.24674927e-08+0.j,
           4.51882551e-08+0.j],
         ...,
         [ 2.18078905e-08+0.j,  3.88439707e-08+0.j,  4.48783670e-08+0.j,
          ..., -4.42547954e-09+0.j,  3.05230778e-08+0.j,
           3.39312812e-08+0.j],
         [ 1.03063422e-08+0.j,  2.87666847e-08+0.j,  3.99013439e-08+0.j,
          ..., -8.60756051e-09+0.j,  2.64638928e-08+0.j,
           2.22844662e-08+0.j],
         [ 4.47935043e-09+0.j,  1.75518616e-08+0.j,  2.15664055e-08+0.j,
          ...,  6.08933534e-09+0.j,  8.64237263e-09+0.j,
           9.83124327e-09+0.j]])],
 'n_effs': [array(2.49763903+7.5550365e-07j)]}
[ ]: