pvlib-python

repository·main·Indexed 23 days ago

https://github.com/pvlib/pvlib-python

A community-developed toolbox providing functions and classes for simulating the performance of photovoltaic (PV) energy systems. It includes models for loss, snow, soiling, shading, and spectrum effects, as well as tools for converting GHI to Plane of Array (POA) irradiance, reading weather files (EPW, TMY2, TMY3), and importing PVsyst PAN/OND files.

Tokens
54K
Snippets
71
Records
362
Agent score
82%

What's inside pvlib-python

  1. Overview of pvlib python

    main

    pvlib python is an open-source software toolbox for simulating the performance of solar photovoltaic (PV) energy components and systems. It provides reference implementations of over 100 empirical and physics-based models, including:

    • Solar position algorithms
    • Irradiance models
    • Thermal models
    • PV electrical models

    The library is designed with a 'toolbox' approach, providing individual low-level modeling 'building blocks' that users can chain together into high-level 'weather-to-power' workflows. This allows for significant customization and the incorporation of custom modeling steps. Because it is built on Python, it integrates seamlessly with the broader scientific Python ecosystem (e.g., NumPy, pandas, SciPy, Matplotlib).

  2. Explore effects on PV system output in pvlib

    main

    The pvlib library provides various models to account for environmental and physical factors that reduce the power output of a photovoltaic (PV) system. You can model these effects using the following categories of modules:

    • Loss models: General models for various system losses.
    • Snow: Models for the impact of snow accumulation on PV modules.
    • Soiling: Models for the impact of dust, dirt, and other contaminants on module performance.
    • Shading: Models for the impact of shadows from nearby objects or other modules.
    • Spectrum: Models for the impact of the solar spectrum (e.g., due to air mass or atmospheric conditions) on module response.
  3. Overview of weather data types for PV modeling

    main

    When simulating PV system performance, you can choose from three main categories of weather data depending on your needs:

    1. Ground station measurements: Highest quality (in-situ monitoring), but coverage is limited to where stations exist. Useful for high-resolution, accurate data if you have flexibility on location.
    2. Satellite data: Uses satellite imagery to estimate irradiance. Higher quality than NWP and better spatial/temporal resolution. Useful when ground measurements are unavailable. Examples include PVGIS, NSRDB, and CAMS.
    3. Numerical Weather Prediction (NWP): Mathematical simulations (e.g., GFS, ECMWF, ERA5). Lower quality due to coarser resolution, but provides worldwide coverage. Useful for polar regions or extremely long time ranges.
  4. Compare CEC and Sandia PV Module databases

    main

    When choosing between the CEC and Sandia databases:

    • CEC Database: Contains significantly more modules and is generally more up-to-date. It produces a continuous IV curve.
    • Sandia Database: Calculates only a few specific points of interest on the curve.

    For typical simulations where only the maximum power point is required, either model is sufficient, but the CEC database is often more useful due to its breadth.

  5. How IAM (Incidence Angle Modifier) functions are organized

    main

    IAM functions have been moved from pvsystem.py to iam.py. The following renames apply:

    • pvsystem.physicaliam $\rightarrow$ iam.physical
    • pvsystem.ashraeiam $\rightarrow$ iam.ashrae
    • pvsystem.sapm_aoi_loss $\rightarrow$ iam.sapm

    Additionally, PVSystem now provides IAM models via the PVSystem.get_iam(iam_model=...) method. The direct methods PVSystem.ashraeiam, PVSystem.physicaliam, and PVSystem.sapm_aoi_loss are deprecated.

  6. How PVSystem separates intrinsic and extrinsic data

    main

    The PVSystem class follows a design philosophy that separates intrinsic data (properties of the hardware) from extrinsic data (environmental conditions).

    1. Intrinsic Data: Stored as object attributes. Examples include PVSystem.module_parameters and PVSystem.inverter_parameters. These define the physical characteristics of the system.
    2. Extrinsic Data: Passed as arguments to PVSystem methods. Examples include irradiance and temperature. These define the environment at a specific moment in time.

    By storing intrinsic data in the object, methods like PVSystem.pvwatts_dc can be called with only the extrinsic environmental data, as the method automatically retrieves the necessary module parameters from the object's state.

    module_parameters = {'pdc0': 5000, 'gamma_pdc': -0.004}
    inverter_parameters = {'pdc0': 5000, 'eta_inv_nom': 0.96}
    system = pvsystem.PVSystem(inverter_parameters=inverter_parameters,
                                   module_parameters=module_parameters)
    
    # Using extrinsic data (irradiance and temp) while the method handles intrinsic data
    pdc = system.pvwatts_dc(effective_irradiance=1000, temp_cell=30)
    print(pdc)
  7. Understand PV temperature modeling in pvlib

    main

    pvlib provides models to predict the operating temperature of a PV module using irradiance and weather inputs. These models fall into several categories based on what they predict, how they handle time, and what inputs they require.

    Predicted Quantities

    • module temperature: The temperature at the back surface of the module. It is easier to measure but is typically slightly lower than the cell temperature.
    • cell temperature: The temperature of the PV cell itself. This is the critical value for determining PV efficiency but is rarely measured directly.

    Note: The specific type of temperature predicted (cell vs. module) is determined by the parameter values used, rather than the model function itself.

    Steady-state vs. Transient Models

    • steady-state: Assumes the module has reached thermal equilibrium under the specified operating conditions.
    • transient: Accounts for the thermal inertia of the module, resulting in a time lag between changes in weather inputs and changes in modeled temperature.

    Model Selection Guide

    ModelTypeTransient?POA irradianceAmbient tempWind speedDownwelling IR
    pvlib.temperature.faimaneitherNo
    pvlib.temperature.faiman_radeitherNo
    pvlib.temperature.fuenteseitherYes
    pvlib.temperature.generic_lineareitherNo
    pvlib.temperature.noct_samcellNo
    pvlib.temperature.pvsyst_cellcellNo
    pvlib.temperature.rosscellNo
    pvlib.temperature.sapm_cellcellNo
    pvlib.temperature.sapm_modulemoduleNo

    Additional Temperature Functions

    • pvlib.temperature.prilliman: An "add-on" model that applies transient effects to the output of a steady-state model.
    • pvlib.temperature.sapm_cell_from_module: Estimates cell temperature from a known module temperature.
  8. How Single Diode Models (SDM) work in pvlib

    main

    Single-diode models (SDM) simulate the electrical output of a PV module by pairing the single-diode equation (SDE) with auxiliary equations that predict SDE parameters based on irradiance and temperature.

    In pvlib, modeling with an SDM is a two-step process:

    1. Compute auxiliary equations: Use a model-specific function to calculate parameters.
      • CEC SDM: pvlib.pvsystem.calcparams_cec
      • PVsyst SDM: pvlib.pvsystem.calcparams_pvsyst
      • De Soto SDM: pvlib.pvsystem.calcparams_desoto
    2. Compute I-V curve points: Use the output from step 1 with functions like pvlib.pvsystem.singlediode to find specific points (Maximum Power, Open Circuit, or Short Circuit) or full curves.
  9. Use pvlib.clearsky functions for fine-grained control

    main

    For users requiring finer control, explicit code, or working with multidimensional data, use the functions in the pvlib.clearsky module directly instead of the Location method.

    Key Functions:

    • pvlib.clearsky.ineichen: Implements the Ineichen and Perez model.
    • pvlib.clearsky.simplified_solis: Implements the Simplified Solis model.

    Data Types and Outputs:

    • Series input: Results in a pandas.DataFrame output with keys 'ghi', 'dni', and 'dhi'.
    • Array input: Results in an OrderedDict of array outputs.