{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "from solcore import material, si\n", "from solcore.structure import Layer, Structure\n", "from solcore.absorption_calculator.rigorous_coupled_wave import calculate_rat_rcwa" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "T = 300\n", "# define materials\n", "Air = material(\"Air\")(T=T)\n", "TiO2 = material(\"TiO2\", sopra=True)(T=T) # for the nanoparticles\n", "GaAs = material(\"GaAs\")(T=T)\n", "\n", "# define a flat layer and another with circular discs with the same thickness\n", "Flat = Layer(si('50nm'), TiO2)\n", "NP_layer = Layer(si('50nm'), Air, geometry=[{'type': 'circle', 'mat': TiO2, 'center': (200, 200), 'radius': 50}])\n", "\n", "flat_struct = Structure([Flat])\n", "np_struct = Structure([NP_layer])\n", "\n", "# And the wavelength in which the solve the problem\n", "wl = np.linspace(300, 1000, 150)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "is_executing": true } }, "outputs": [], "source": [ "rat_flat = calculate_rat_rcwa(flat_struct, size=((400, 0), (0, 400)), orders=10, wavelength=wl,\n", " substrate=GaAs, incidence=Air)\n", "rat_np = calculate_rat_rcwa(np_struct, size=((400, 0), (0, 400)), orders=10, wavelength=wl,\n", " substrate=GaAs, incidence=Air)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "is_executing": true, "name": "#%%\n" } }, "outputs": [], "source": [ "plt.plot(wl, rat_flat[\"R\"], '-k', label=\"Flat (R)\")\n", "plt.plot(wl, rat_np[\"R\"], '-b', label=\"Nanoparticles (R)\")\n", "plt.plot(wl, rat_flat[\"T\"], '--k', label=\"Flat (T)\")\n", "plt.plot(wl, rat_np[\"T\"], '--b', label=\"Nanoparticles (T)\")\n", "plt.legend()\n", "plt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "PyCharm (solcore5)", "language": "python", "name": "pycharm-cadd906b" }, "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.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }