{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from solcore.solar_cell import SolarCell\n", "from solcore.light_source import LightSource\n", "from solcore.spice.pv_module_solver import solve_pv_module\n", "from solcore.structure import Junction" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "T = 298" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First we define the properties of the MJ solar cell that the solar module is made of. We use junctions of kind 2-diode" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "db_junction = Junction(kind='2D', T=T, reff=1, jref=300, Eg=0.66, A=1, R_series=0.00236, R_shunt=1e14, n=3.5)\n", "db_junction2 = Junction(kind='2D', T=T, reff=1, jref=300, Eg=1.4, A=1, R_series=0.00012, R_shunt=1e14, n=3.5)\n", "db_junction3 = Junction(kind='2D', T=T, reff=1, jref=300, Eg=1.9, A=1, R_series=8.0e-5, R_shunt=1e14, n=3.5)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "my_solar_cell = SolarCell([db_junction3, db_junction2, db_junction], T=T, R_series=0.0, area=0.1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "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": [ "options = {'light_iv': True, 'wavelength': wl, 'light_source': light_source, 'optics_method': 'BL'}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After defining the individual solar cell, we solve the module IV characteristics adding some dispersion in the
\n", "values of the short circuit currents." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "voltage, current, all_Isc_values, raw_data = solve_pv_module(my_solar_cell, options, jscSigma=0.02)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.figure(1)\n", "\n", "plt.subplot(311)\n", "plt.title('Histogram of sub-cell photocurrents')\n", "plt.ylabel('InGaP')\n", "plt.hist(([row[0] for row in all_Isc_values]), bins=20)\n", "\n", "plt.subplot(312)\n", "plt.hist(([row[1] for row in all_Isc_values]), bins=20)\n", "plt.ylabel('GaAs')\n", "\n", "plt.subplot(313)\n", "plt.xlabel('Current (A)')\n", "plt.ylabel('Ge')\n", "plt.hist(([row[2] for row in all_Isc_values]), bins=20)\n", "\n", "plt.figure(2)\n", "plt.plot(voltage, current)\n", "plt.xlabel('Voltage (V)')\n", "plt.ylabel('Current (A)')\n", "plt.xlim(0, 80)\n", "plt.ylim(0, 17)\n", "\n", "plt.show()" ] } ], "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 }