{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Tutorial 4 - PV Module Performance\n", "\n", "Now that we know how to obtain the plane of array (POA) irradiance and cell temperature, let's calculate a module's performance assuming a subset of irradiance and temperature conditions. The objectives for this tutorial are to use pvlib python to do the following:\n", "\n", "1. Retrieve a set of module CEC parameters from the latest [NREL System Advisor Model (SAM)](https://sam.nrel.gov/) library.\n", "2. Calculate the single diode model (SDM) parameters at standard test conditions (STC) and for a set of PV module test conditions known as IEC61853.\n", "3. Produce an IV curve for each of the IEC61853 test conditions.\n", "4. Derive the California Energy Commission (CEC) model parameters based on standard CEC test measurements.\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## PV Concepts:\n", "\n", "- STC Parameters\n", "- IV Curve\n", "- PV module energy conversion models\n", " - Point Models\n", " - [PVWatts](https://pvwatts.nrel.gov/)\n", " - [Sandia Array Performance Model (SAPM)](https://energy.sandia.gov/wp-content/gallery/uploads/043535.pdf)\n", " - Continuous Models\n", " - CEC\n", " - [PVSyst](https://www.pvsyst.com/)\n", " - [DeSoto](https://doi.org/10.1016/j.solener.2005.06.010)\n", "- Low light and temperature module performance\n", "- IEC 61853 standard \n", "\n", "## Python Concepts:\n", "\n", "- [`numpy.meshgrid`](https://numpy.org/doc/stable/reference/generated/numpy.meshgrid.html)\n", "- `try: except` clauses to catch errors\n", "- Transpose a Pandas dataframe\n", "- [Pandas series and index string methods](https://pandas.pydata.org/pandas-docs/stable/user_guide/text.html#string-methods): _e.g._ `df.index.str.startswith('Canadian')` where `df` is a dataframe of PV modules." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Standard Test Conditions (STC)\n", "\n", "The most basic condition is called \"standard test conditions\" or STC, which is considered the reference for most PV modules. For example, all of the PV modules in the SAM CEC module database list their nameplate power at STC.\n", "* irradiance: 1000-W/m²\n", "* cell temperature: 25°C\n", "* angle of incidence (AOI): 0°\n", "* spectrum: AM1.5g (ASTM G-173)\n", "\n", "### Air mass (AM)\n", "\n", "The standard reference AM1.5g (ASTM G-173) is defined as the solar spectrum of global irradiance that passes through 1.5 atmospheres. For more information see [NREL Solar Spectra](https://www.nrel.gov/grid/solar-resource/spectra.html)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## IEC 61853 test conditions\n", "\n", "Another common set of test conditions is the IEC 61853 standard which provides a PV module test matrix that covers the expected range of inicident irradiance and cell temperatures for PV modules assuming that the irradiance is normal and the solar spectrum is similar to AM1.5g.\n", "\n", "* irradiance (W/m²): 100, 200, 400, 600, 800, 1000, 1100\n", "* module temperature (°C): 15, 25, 50, 75\n", "* angle of incidence: 0°\n", "* spectrum: AM1.5g (ASTM G-173)\n", "\n", "The figure below shows IEC 61853 test results performed at CFV labs:\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Certain combinations are excluded because they're unlikely: (1100-W/m², 15°C), (400-W/m², 75°C), (200-W/m², 50°C), (200-W/m², 75°C), (100-W/m², 50°C), and (100-W/m², 75°C). The figure below shows SAM parametrs fit to IEC61853 test results for two different cell technologies. The white space shows combinations of irradiance and temperature which were intentionally excluded from testing.\n", "\n", "\n", "\n", "Attribution: [NREL Dobos, Freeman 2019](https://www.nrel.gov/docs/fy19osti/68637.pdf)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent \"ModuleNotFoundError\" in later cells:\n", "# !pip install -r https://raw.githubusercontent.com/PVSC-Python-Tutorials/PVSC50/main/requirements.txt" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# import pvlib and other useful python packages\n", "import pvlib\n", "import numpy as np\n", "from matplotlib import pyplot as plt\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[array([[15, 25, 50, 75],\n", " [15, 25, 50, 75],\n", " [15, 25, 50, 75],\n", " [15, 25, 50, 75],\n", " [15, 25, 50, 75],\n", " [15, 25, 50, 75],\n", " [15, 25, 50, 75]]),\n", " array([[ 100, 100, 100, 100],\n", " [ 200, 200, 200, 200],\n", " [ 400, 400, 400, 400],\n", " [ 600, 600, 600, 600],\n", " [ 800, 800, 800, 800],\n", " [1000, 1000, 1000, 1000],\n", " [1100, 1100, 1100, 1100]])]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# set STC reference conditions\n", "E0 = 1000 # W/m^2\n", "T0 = 25 # degC\n", "\n", "# set the IEC61853 test matrix\n", "E_IEC61853 = [100, 200, 400, 600, 800, 1000, 1100] # irradiances [W/m^2]\n", "T_IEC61853 = [15, 25, 50, 75] # temperatures [degC]\n", "\n", "# create a meshgrid of temperatures and irradiances\n", "# for all 28 combinations in the test matrix\n", "IEC61853 = np.meshgrid(T_IEC61853, E_IEC61853)\n", "\n", "# meshgrid returns two 2-D arrays in the same order as the input arguments\n", "# so the first item in the output is a 2-D array of temperatures and\n", "# the second item is the mesh of irradiances\n", "# display temperature and irradiance test matrices\n", "IEC61853" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Single Diode Model (SDM) & IV Curve\n", "\n", "PV module performance can be modeled using *point* or *continuous* IV-curve models. \n", "\n", "Point models like PVWatts and The Sandia Array Performance Model (SAPM, _aka_ King model) yield the current (I), voltage (V), and power (P) at a single or discrete set of points. \n", "PVWatts only yields the performance at the max power point (MPP) of the module, whereas the SAPM also yields the short circuit current (Isc), open circuit voltage (Voc).\n", "\n", "Continuous IV curve models like the CEC, PVsyst, and DeSoto models yield a relation between current and voltage called an IV curve, and therefore yield a continuous set of (V, I) points spanning from Isc to Voc and beyond. The domain of the IV curve is in quadrants 1, 2, and 4 where voltage is on the horizontal and current is on the vertical axis. The figure below from [PV Education PVCDROM](https://www.pveducation.org/pvcdrom/welcome-to-pvcdrom) shows an IV curve of an \"ideal\" cell.\n", "\n", "[](https://www.pveducation.org/pvcdrom/modules-and-arrays/mismatch-effects)\n", "\n", "Attribution: [PV Education, UNSW, ASU, _et al._](https://www.pveducation.org/pvcdrom/modules-and-arrays/mismatch-effects)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The IV curve relationship is based on an electrical analog called the \"single diode model\" or SDM which is defined by 5 parameters: the light current ($I_L$), shunt resistance ($R_{sh}$), series resistance ($R_s$), diode saturation current ($I_o$ or $I_{sat}$), and the diode ideality factor ($n$). Other symbols for diode ideality factor are ($\\gamma$) used by PVsyst and ($a$) used by SAM, but ($\\gamma$) is also frequently used for power temperature coefficient. This \"ideal\" cell is described by the electrical schematic drawing below.\n", "\n", "[](https://www.sandia.gov/app/uploads/sites/243/2022/11/Single-Diode-EC2.png)\n", "\n", "\n", "Attribution: [Sandia NL PV Performance Modeling Collaborative](https://pvpmc.sandia.gov/modeling-steps/2-dc-module-iv/single-diode-equivalent-circuit-models/)\n", "\n", "\n", "Combining the components in the SDM using Ohm's and Kirchhoff's laws yields the following equation, which is implicit because current (I) is on both sides of the equation, and cannot be solved explicitly:\n", "\n", "$$ I = I_L - I_o \\left( \\exp \\left( \\frac{V + I R_s}{n V_T} \\right) - 1 \\right) - \\frac{V + I R_s}{R_{sh}} $$\n", "\n", "with the diode voltage ($V_D = V + I R_s$), the diode current ($I_D$) given by the ideal diode equation:\n", "\n", "$$ I_D = I_o \\left( \\exp \\left( \\frac{V_D}{n V_T} \\right) - 1 \\right) $$\n", "\n", "the thermal voltage ($V_T = k_T / q_e$), elementary charge ($q_e$), Boltzmann constant ($k_T$), and the shunt current ($I_{sh} = V_D / R_{sh}$)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## CEC Model (_aka_ SAM or 6-parameter model)\n", "\n", "The California Energy Commision (CEC) contracted authorized testing labs to measure at STC the nameplate power (Pmp), Isc, Voc, and the MPP voltage and current (Vmp, Imp), as well as Isc and Voc temperature coefficients, the module dimensions, the number of series cells (Ns), parallel substrings (Np), module area in m² (Ac), and more. Tables of the CEC module parameters are available from the [Solar Equipment Lists](https://www.energy.ca.gov/programs-and-topics/programs/solar-equipment-lists). These measurements have been fit to the SDM by the NREL System Advisor Model (SAM) and stored in a CSV file that is bundled with SAM. You can access the [SAM library on GitHub](https://github.com/NREL/SAM/tree/develop/deploy/libraries). This SAM library of module coefficients derived from the CEC measurements are collectively called CEC modules and the SAM model that uses the derived SDM coefficients is called the CEC model. The CEC model used in SAM is sometimes also called the 6-parameter model because of the `Adjust` additional parameter which differentiates it from the DeSoto model.\n", "\n", "### pvlib python\n", "\n", "There are several functions we can use in pvlib python:\n", "\n", "* [`pvlib.pvsystem.retrieve_sam()`](https://pvlib-python.readthedocs.io/en/stable/reference/generated/pvlib.pvsystem.retrieve_sam.html)\n", "* [`pvlib.pvsystem.calcparams_cec()`](https://pvlib-python.readthedocs.io/en/stable/reference/generated/pvlib.pvsystem.calcparams_cec.html)\n", "* [`pvlib.pvsystem.singlediode()`](https://pvlib-python.readthedocs.io/en/stable/reference/generated/pvlib.pvsystem.singlediode.html)\n", "* [`pvlib.ivtools.sdm.fit_cec_sam()`](https://pvlib-python.readthedocs.io/en/stable/reference/generated/pvlib.ivtools.sdm.fit_cec_sam.html)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | Technology | \n", "Bifacial | \n", "STC | \n", "PTC | \n", "A_c | \n", "Length | \n", "Width | \n", "N_s | \n", "I_sc_ref | \n", "V_oc_ref | \n", "... | \n", "a_ref | \n", "I_L_ref | \n", "I_o_ref | \n", "R_s | \n", "R_sh_ref | \n", "Adjust | \n", "gamma_r | \n", "BIPV | \n", "Version | \n", "Date | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A10Green_Technology_A10J_S72_175 | \n", "Mono-c-Si | \n", "0 | \n", "175.0914 | \n", "151.2 | \n", "1.3 | \n", "1.576 | \n", "0.825 | \n", "72 | \n", "5.17 | \n", "43.99 | \n", "... | \n", "1.981696 | \n", "5.175703 | \n", "0.0 | \n", "0.316688 | \n", "287.102203 | \n", "16.057121 | \n", "-0.5072 | \n", "N | \n", "SAM 2018.11.11 r2 | \n", "1/3/2019 | \n", "
| A10Green_Technology_A10J_S72_180 | \n", "Mono-c-Si | \n", "0 | \n", "179.928 | \n", "155.7 | \n", "1.3 | \n", "1.576 | \n", "0.825 | \n", "72 | \n", "5.31 | \n", "44.06 | \n", "... | \n", "1.988414 | \n", "5.316148 | \n", "0.0 | \n", "0.299919 | \n", "259.047943 | \n", "16.418983 | \n", "-0.5072 | \n", "N | \n", "SAM 2018.11.11 r2 | \n", "1/3/2019 | \n", "
| A10Green_Technology_A10J_S72_185 | \n", "Mono-c-Si | \n", "0 | \n", "184.7016 | \n", "160.2 | \n", "1.3 | \n", "1.576 | \n", "0.825 | \n", "72 | \n", "5.43 | \n", "44.14 | \n", "... | \n", "1.984817 | \n", "5.435676 | \n", "0.0 | \n", "0.311962 | \n", "298.424438 | \n", "15.688233 | \n", "-0.5072 | \n", "N | \n", "SAM 2018.11.11 r2 | \n", "1/3/2019 | \n", "
| A10Green_Technology_A10J_M60_220 | \n", "Multi-c-Si | \n", "0 | \n", "219.876 | \n", "189.1 | \n", "1.624 | \n", "1.632 | \n", "0.995 | \n", "60 | \n", "7.95 | \n", "36.06 | \n", "... | \n", "1.673094 | \n", "7.959062 | \n", "0.0 | \n", "0.140393 | \n", "123.168404 | \n", "21.875164 | \n", "-0.5196 | \n", "N | \n", "SAM 2018.11.11 r2 | \n", "1/3/2019 | \n", "
| A10Green_Technology_A10J_M60_225 | \n", "Multi-c-Si | \n", "0 | \n", "224.9856 | \n", "193.5 | \n", "1.624 | \n", "1.632 | \n", "0.995 | \n", "60 | \n", "8.04 | \n", "36.24 | \n", "... | \n", "1.671782 | \n", "8.047206 | \n", "0.0 | \n", "0.14737 | \n", "164.419479 | \n", "20.698376 | \n", "-0.5196 | \n", "N | \n", "SAM 2018.11.11 r2 | \n", "1/3/2019 | \n", "
5 rows × 25 columns
\n", "| \n", " | Technology | \n", "Bifacial | \n", "STC | \n", "PTC | \n", "A_c | \n", "Length | \n", "Width | \n", "N_s | \n", "I_sc_ref | \n", "V_oc_ref | \n", "... | \n", "a_ref | \n", "I_L_ref | \n", "I_o_ref | \n", "R_s | \n", "R_sh_ref | \n", "Adjust | \n", "gamma_r | \n", "BIPV | \n", "Version | \n", "Date | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Canadian_Solar_Inc__CS5P_220M | \n", "Mono-c-Si | \n", "0 | \n", "219.961 | \n", "200.1 | \n", "1.7 | \n", "1.602 | \n", "1.061 | \n", "96 | \n", "5.1 | \n", "59.4 | \n", "... | \n", "2.635926 | \n", "5.11426 | \n", "0.0 | \n", "1.066023 | \n", "381.254425 | \n", "8.619516 | \n", "-0.476 | \n", "N | \n", "SAM 2018.11.11 r2 | \n", "1/3/2019 | \n", "
| Canadian_Solar_Inc__CS6P_220M | \n", "Mono-c-Si | \n", "0 | \n", "219.775 | \n", "198.5 | \n", "1.549 | \n", "1.615 | \n", "0.959 | \n", "60 | \n", "7.97 | \n", "36.9 | \n", "... | \n", "1.515583 | \n", "7.980784 | \n", "0.0 | \n", "0.397651 | \n", "293.871094 | \n", "-3.311191 | \n", "-0.436 | \n", "N | \n", "SAM 2018.11.11 r2 | \n", "1/3/2019 | \n", "
2 rows × 25 columns
\n", "