Skip to content

Commit

Permalink
added ng
Browse files Browse the repository at this point in the history
  • Loading branch information
parkeraa committed Jan 10, 2024
1 parent 572e1aa commit b274090
Showing 1 changed file with 49 additions and 7 deletions.
56 changes: 49 additions & 7 deletions book/pages/waveguides_mode_solvers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m2024-01-10 16:05:51.512\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mgplugins.gmeep\u001b[0m:\u001b[36m<module>\u001b[0m:\u001b[36m39\u001b[0m - \u001b[1mMeep '1.28.0' installed at ['/home/parkeraa/miniconda3/envs/mp/lib/python3.11/site-packages/meep']\u001b[0m\n"
]
}
],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -69,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -139,7 +147,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -192,13 +200,47 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Notice that the slice of the electric field through $z = 0$ is now continuous at the boundaries. You can also see a slight numerical error at the boundary that arises from the finite resolution of the mode solver."
"Notice that the slice of the electric field through $z = 0$ is now continuous at the boundaries. You can also see a slight numerical error at the boundary that arises from the finite resolution of the mode solver.\n",
"\n",
"We can also extract useful values related to the waveguide from the models we have created. Below are some of the functions, and more can be found in the [gplugins mode solver docs](https://gdsfactory.github.io/gplugins/notebooks/mpb_001_mpb_waveguide.html)"
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The effective index of mode 1 is : 3.106\n",
"The group index of mode 1 is : 3.892\n"
]
}
],
"source": [
"mm = gm.find_mode_dispersion(\n",
" core=\"Si\",\n",
" clad=\"SiO2\",\n",
" mode_number=1,\n",
" core_width=core_w,\n",
" core_thickness=core_t,\n",
" resolution=40,\n",
" sy=3,\n",
" sz=3,\n",
" \n",
" )\n",
"\n",
"\n",
"neff = m1.neff\n",
"ng = mm.ng\n",
"\n",
"\n",
"print(f'The effective index of mode 1 is : {neff:.3f}')\n",
"print(f'The group index of mode 1 is : {ng:.3f}')\n",
"\n"
]
}
],
"metadata": {
Expand Down

0 comments on commit b274090

Please sign in to comment.