{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Group index" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import modes\n", "import opticalmaterialspy as mat" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ms = modes.group_index?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ms = modes.group_index" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "wavelength = np.arange(1500, 1600, 10)*1e-3\n", "widths = np.arange(400, 601, 50)*1e-3\n", "\n", "plt.figure(1)\n", "\n", "for i, width in enumerate(widths):\n", " ng = [modes.group_index(w, width=width) for w in wavelength]\n", " \n", " plt.plot(wavelength, ng, label=f'{width*1e3}')\n", " \n", "plt.legend()\n", "plt.xlabel('Wavelength (um)')\n", "plt.xlabel('ng')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "w = wavelength[0]\n", "modes.group_index(w, width=width)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "widths = np.array([490, 500, 510])*1e-3\n", "ng = [modes.group_index(w, width=width)[0] for width in widths]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "np.diff(ng)/np.diff(widths) # dng/dw [/um]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "thicknesss = np.array([200, 220, 240])*1e-3\n", "ng = [modes.group_index(w, thickness=thickness)[0] for thickness in thicknesss]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "np.diff(ng)/np.diff(thicknesss) # dng/dh [/um]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(thicknesss*1e3, ng, '-o')\n", "plt.ylabel('ng')\n", "plt.xlabel('thickness (nm)')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.7" } }, "nbformat": 4, "nbformat_minor": 4 }