{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from solcore.structure import Junction\n", "from solcore.solar_cell import SolarCell\n", "from solcore.light_source import LightSource\n", "from solcore.solar_cell_solver import solar_cell_solver\n", "from solcore.graphing.Custom_Colours import colours" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "TODO This needs some explanations/descriptions" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "T = 298" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Vin = np.linspace(-6, 2, 600)\n", "V = np.linspace(-1.5, 4, 500)\n", "wl = np.linspace(350, 2000, 301) * 1e-9\n", "light_source = LightSource(source_type='standard', version='AM1.5g', x=wl, output_units='photon_flux_per_m',\n", " concentration=1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "color = ['b', 'g', 'r']\n", "label = ['Top', 'Mid', 'Bot']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig, ax = plt.subplots(1, 2, sharey='all', figsize=(7, 4.5));\n", "\n", "for k, rad in enumerate([False, True]):\n", "\n", " # Input data for the 2D kind of junction\n", " db_junction = Junction(kind='2D', T=T, reff=0.3, jref=300, Eg=0.66, A=1, R_shunt=np.inf, n=3.5)\n", " db_junction2 = Junction(kind='2D', T=T, reff=1, jref=300, Eg=1.4, A=1, R_shunt=np.inf, n=3.5)\n", " db_junction3 = Junction(kind='2D', T=T, reff=1, jref=300, Eg=1.8, A=1, R_shunt=np.inf, n=3.5)\n", " my_solar_cell = SolarCell([db_junction3, db_junction2, db_junction], T=T, R_series=0)\n", " solar_cell_solver(my_solar_cell, 'iv',\n", " user_options={'T_ambient': T, 'voltages': V, 'light_iv': True, 'wavelength': wl,\n", " 'light_source': light_source, 'radiative_coupling': rad, 'mpp': True,\n", " 'internal_voltages': Vin, 'optics_method': 'BL'})\n", "\n", " # This is the total junction IV\n", " ax[k].plot(my_solar_cell.iv['IV'][0], my_solar_cell.iv['IV'][1], marker='o', color=colours(\"Black\"), ls='-',\n", " markerfacecolor='none', markeredgecolor=colours(\"Black\"))\n", "\n", " # This is the junciton IV when it is in the MJ device, including coupling if it is enabled. \n", " for i, data in enumerate(my_solar_cell.iv['junction IV']):\n", " ax[k].plot(data[0], data[1], color[i] + '--', linewidth=2)\n", "\n", " # This is the junction IV as if it were an isolated device and therefore not affected by coupling or current limiting. \n", " for i in range(my_solar_cell.junctions):\n", " ax[k].plot(V, -my_solar_cell(i).iv(V), color[i], linewidth=2, label=label[i])\n", " ax[k].set_ylim(0, 300)\n", " ax[k].set_xlim(0, 3.5)\n", " ax[k].set_xlabel('Bias (V)')\n", " Isc = my_solar_cell.iv[\"Isc\"]\n", " Voc = my_solar_cell.iv[\"Voc\"]\n", " FF = my_solar_cell.iv[\"FF\"] * 100\n", " Eta = my_solar_cell.iv[\"Eta\"] * 100\n", " ax[k].text(1.75, 275, 'I$_{sc}$ = ' + str(round(Isc, 1)) + ' A/m$^2$', fontsize=12)\n", " ax[k].text(1.75, 250, 'V$_{oc}$ = ' + str(round(Voc, 2)) + ' V', fontsize=12)\n", " ax[k].text(1.75, 225, 'FF = {:.1f} %'.format(FF), fontsize=12)\n", " ax[k].text(1.75, 200, r'$\\eta$ = {:.1f} %'.format(Eta), fontsize=12)\n", " \n", "ax[0].set_ylabel('Current (A/m$^2$)')\n", "ax[0].text(0.9, 0.05, '(a)', transform=ax[0].transAxes, fontsize=12)\n", "ax[1].text(0.9, 0.05, '(b)', transform=ax[1].transAxes, fontsize=12)\n", "plt.tight_layout()\n", "ax[0].legend(loc=(0.10, 0.80), frameon=False)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }