Weather Adjusted Expected Generation

165 views
Skip to first unread message

Kris

unread,
May 26, 2025, 12:28:34 PMMay 26
to pvlib-python
Need to compute Weather Adjusted Expected Generation using PVLIB.

The computation is done for the previous day, so that really weather data can be used from the site, but it is not working correctly.  I am getting values that are completely different.

Attached is the example source code.

Is there an example that I can follow or what would be the best way to verify the source code?
example.txt

cwh...@sandia.gov

unread,
May 26, 2025, 12:56:56 PMMay 26
to pvlib-python
Several observations and two questions:

1) DC power is being calculated for a single module, in units of W (since that's the unit of module_parameters['pdco']
2) Why is DC power being averaged? I think you need to calculate the power of all strings connected to an inverter. Since all modules are assumed to have the same irradiance and temperature conditions, you multiply the single mddule power by the number of modules in a string, and by the number of strings in parallel that feed the inverter.
3) The inverter parameter pdc0 must have the same unit as the input DC power, parameter pdc. If the input pdc is still in W, then the inverter parameter pdc0 must also be in W.
4) Why is the AC power being averaged across the inverters, instead of simply added?

Cliff

Kris

unread,
May 27, 2025, 12:53:53 PMMay 27
to pvlib-python
The original source code was generated using ChatGPT and I am not sure it is accurate at all.  I was hoping to get a primer on PVLIB and look at examples for this, but I couldn't find any examples.  I also was willing to take some training, but I can't find anything to specifically create financial reports using this data.  I've got over 165,000+ OPC-UA tags and several MET stations to give me a better (close to actual) value for weather adjusted expected generation.

I made the changes you mentioned, but the output I am getting for 1 hour about midday is still zero:
--------------------------------
Date: 2025-05-23 00:00:00-04:00
Actual Produced (for entire day): 865
Expected Produced (PVLIB alog, hour=12:00 PM): 0.0

--------------------------------

The actual site details are the following:
System Summary
- Module
  - (49,920) ASTROENERGY CHSM66M(DG)/F-BH-655, 655 W STC RATING
  - (114,330) ASTRRONERGY CHSM66M(DG)/F-BH-660, 660 W STC RATING
- Inverter
  - (10) SMA SC 2800 S2-US
  - (16) SMA SC 2930 S2-US

I've attached the weather data and the actual source code.

Does anything stick out as obviously wrong or what would I need to change?
met_data_2025-5-23_Hour_12_GHIAvg_Wm2_Minute.csv
example_pvlib.py.txt
met_data_2025-5-23_Hour_12_WindSpeedAvg_ms_Minute.csv
site_system_summary.png
met_data_2025-5-23_Hour_12_AirTemperatureAvg_C_Minute.csv

cwh...@sandia.gov

unread,
May 27, 2025, 1:26:53 PMMay 27
to pvlib-python

The key fact for this PV modeling problem is the number of modules feeding each inverter. Because we're using the pvwatts model rather than more detailed model options, it's OK to omit the detail that there are two different modules in the system and instead model a single module with an average power rating (655*49920 + 660*114330)/(49920+114330). Similarly, it's OK to model an average inverter rather than distinguish between 2800kW and 2930kW inverters.

GIven that, you should
1) calculate power from an average module
2) multiply that power by the number of modules feeding an average inverter, to get the pdc input to the inverter. (49920 + 114330) / 26 is a reasonable guess at this number of modules.
3) calculate AC power from a single inverter, and multiply that by 26.

If you are getting 0. power from your current code, I'd first check that the weather inputs (GHI, temperature, wind speed) are being passed correctly to the compute_expected_generation_for_hour function.

I suspect the get_hourly_weather_data function is overwriting data with 0's.

Cliff

Kris

unread,
May 28, 2025, 9:34:56 AMMay 28
to pvlib-python
Cliff,

I made that changes that you suggested and now I am getting values other than 0.

What is interesting is that setting the latitude and longitude to 0 just shows a slight difference in the output. I wonder why this make a difference at all since I am providing the measurements.
Expected Produced (PVLIB algorithm, hour=12:00 PM): 73.3824
- versus -
Expected Produced (PVLIB algorithm, hour=12:00 PM): 72.59572002151778 (latitude= 0, longitude=0)

The other part I noticed is that when I run it for 24 hours of data, the expected value is less than what is actually produced at the site:
Date: 2025-05-23 00:00:00-04:00
Actual Produced (for entire day): 865
Expected Produced (PVLIB algorithm): 743.2071639350548

I would expect that the "expected produced" would be higher (because ideal conditions) than the "actual produced".  The questions that come to mind is:
- Is this valid, having actual be higher than expected?
- What would need to be modified for the expected to be more accurate or precise?

I've attached the latest version of the Python file (leaving out the three data input files, since they didn't change).
example_pvlib.py

cwh...@sandia.gov

unread,
May 28, 2025, 10:14:14 AMMay 28
to pvlib-python
I think all bets on accuracy/precision are off when solar position is not computed for the actual site. With lat=0. and long=0., the simulation "thinks" the sun is rising 4 hours before the GHI data start to increase, and takes a different path through the sky, so predicted plane-of-array irradiance will not be close to what actually happened. That can cause predictions to be less, or more, than measured.

Cliff
Reply all
Reply to author
Forward
0 new messages