PVWATTS_DC
Overview
The PVWATTS_DC function calculates the DC power output of a photovoltaic (PV) module using the NREL PVWatts DC power model. This model estimates the DC power as a function of effective irradiance, cell temperature, module reference power, and temperature coefficient. The calculation is based on the following equation:
where is the effective irradiance in W/m², is the module DC power at reference conditions (W), is the temperature coefficient (1/°C), is the cell temperature (°C), and is the reference cell temperature (°C, default 25). For more details, see the pvlib.pvsystem.pvwatts_dc documentation .
This example function is provided as-is without any representation of accuracy.
Usage
To use the function in Excel:
=PVWATTS_DC(effective_irradiance, temp_cell, pdc_zero, gamma_pdc, [temp_ref])effective_irradiance(float, required): Irradiance transmitted to the PV cells (W/m²). Must be a float.temp_cell(float, required): Cell temperature (°C). Must be a float.pdc_zero(float, required): Module DC power at reference conditions (W).gamma_pdc(float, required): Temperature coefficient of power (1/°C), typically negative.temp_ref(float, optional, default=25.0): Reference cell temperature (°C).
The function returns a float representing the DC power output (W), or an error message (string) if the input is invalid.
Examples
Example 1: Scalar Inputs
In Excel:
=PVWATTS_DC(1000, 25, 300, -0.003)Expected output:
| Result (W) |
|---|
| 300.0 |
Example 2: Different Cell Temperature
In Excel:
=PVWATTS_DC(1000, 35, 300, -0.003)Expected output:
| Result (W) |
|---|
| 291.0 |
Example 3: Custom Reference Temperature
In Excel:
=PVWATTS_DC(1000, 35, 300, -0.003, 20)Expected output:
| Result (W) |
|---|
| 295.5 |
This means, for example, that a module with 300 W reference power at 1000 W/m² and 25°C cell temperature will output 300 W DC power.
Python Code
import micropip
await micropip.install(['pvlib'])
from pvlib.pvsystem import pvwatts_dc as pvlib_pvwatts_dc
def pvwatts_dc(effective_irradiance: float, temp_cell: float, pdc_zero: float, gamma_pdc: float, temp_ref: float = 25.0) -> float:
"""
Calculate the DC power output of a PV module using the PVWatts DC model.
This function is a wrapper around the pvlib.pvsystem.pvwatts_dc function.
For more details, see the [pvlib documentation](https://pvlib-python.readthedocs.io/en/stable/reference/generated/pvlib.pvsystem.pvwatts_dc.html).
Args:
effective_irradiance: Irradiance transmitted to the PV cells (float), W/m^2.
temp_cell: Cell temperature (float), °C.
pdc_zero: Module DC power at reference conditions (float), W.
gamma_pdc: Temperature coefficient of power (float), 1/°C.
temp_ref: Reference cell temperature (float, default 25.0), °C.
Returns:
DC power output (float), or error message (str) if input is invalid.
This example function is provided as-is without any representation of accuracy.
"""
try:
return pvlib_pvwatts_dc(float(effective_irradiance), float(temp_cell), float(pdc_zero), float(gamma_pdc), float(temp_ref))
except Exception as e:
return f"Error: {e}"