Skip to content

Commit 78c4f59

Browse files
convert temp coeff to %/C (#433)
* convert temp coeff to %/C * update whatsnew * Update solarforecastarbiter/pvmodel.py Co-authored-by: Will Holmgren <[email protected]> Co-authored-by: Will Holmgren <[email protected]>
1 parent 2098f15 commit 78c4f59

File tree

8 files changed

+19
-15
lines changed

8 files changed

+19
-15
lines changed

docs/source/whatsnew/1.0.0rc1.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ API Changes
1111
* Added support for week-ahead persistence forecasts with
1212
:py:func:`solarforecastarbiter.utils.get_data_start_end` and
1313
:py:func:`solarforecastarbiter.main.run_persistence` modifications. (:issue:`55`) (:pull:`392`)
14+
* :py:func:`solarforecastarbiter.pvmodel.calculate_power` and
15+
:py:func:`solarforecastarbiter.datamodel.Site` expect a ``temperature_coefficient``
16+
with units of % of DC capacity/C instead of 1/C (:issue:`350`) (:pull:`433`)
1417

1518
Enhancements
1619
~~~~~~~~~~~~

solarforecastarbiter/conftest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def site_text():
300300
"max_rotation_angle": null,
301301
"surface_azimuth": 180.0,
302302
"surface_tilt": 45.0,
303-
"temperature_coefficient": -0.002,
303+
"temperature_coefficient": -0.2,
304304
"tracking_type": "fixed"
305305
},
306306
"name": "Power Plant 1",
@@ -359,7 +359,7 @@ def many_sites_text():
359359
"max_rotation_angle": null,
360360
"surface_azimuth": 180.0,
361361
"surface_tilt": 45.0,
362-
"temperature_coefficient": -0.002,
362+
"temperature_coefficient": -0.2,
363363
"tracking_type": "fixed"
364364
},
365365
"name": "Power Plant 1",
@@ -386,7 +386,7 @@ def many_sites_text():
386386
"max_rotation_angle": 90.0,
387387
"surface_azimuth": null,
388388
"surface_tilt": null,
389-
"temperature_coefficient": -0.002,
389+
"temperature_coefficient": -0.2,
390390
"tracking_type": "single_axis"
391391
},
392392
"name": "Tracking plant",
@@ -498,7 +498,7 @@ def powerplant_metadata():
498498

499499
def _powerplant_metadata():
500500
modeling_params = datamodel.FixedTiltModelingParameters(
501-
ac_capacity=.003, dc_capacity=.0035, temperature_coefficient=-0.003,
501+
ac_capacity=.003, dc_capacity=.0035, temperature_coefficient=-0.3,
502502
dc_loss_factor=3, ac_loss_factor=0,
503503
surface_tilt=30, surface_azimuth=180)
504504
metadata = datamodel.SolarPowerPlant(
@@ -673,15 +673,15 @@ def ac_power_forecast_metadata_label(request, site_metadata):
673673

674674
def fixed_modeling_parameters():
675675
modeling_params = datamodel.FixedTiltModelingParameters(
676-
ac_capacity=.003, dc_capacity=.0035, temperature_coefficient=-0.003,
676+
ac_capacity=.003, dc_capacity=.0035, temperature_coefficient=-0.3,
677677
dc_loss_factor=3, ac_loss_factor=0,
678678
surface_tilt=30, surface_azimuth=180)
679679
return modeling_params
680680

681681

682682
def tracking_modeling_parameters():
683683
modeling_params = datamodel.SingleAxisModelingParameters(
684-
ac_capacity=.003, dc_capacity=.0035, temperature_coefficient=-0.003,
684+
ac_capacity=.003, dc_capacity=.0035, temperature_coefficient=-0.3,
685685
dc_loss_factor=3, ac_loss_factor=0,
686686
axis_tilt=0, axis_azimuth=0, ground_coverage_ratio=2 / 7,
687687
backtrack=True, max_rotation_angle=45)

solarforecastarbiter/datamodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ class PVModelingParameters(BaseModel):
361361
dc_capacity : float
362362
Nameplate DC power rating in megawatts
363363
temperature_coefficient : float
364-
The temperature coefficient of DC power in units of 1/C.
365-
Typically -0.002 to -0.005 per degree C.
364+
The temperature coefficient of DC power in units of %/C.
365+
Typically -0.2 to -0.5 % per degree C.
366366
dc_loss_factor : float
367367
Applied to DC current in units of %. 0 = no loss.
368368
ac_loss_factor : float

solarforecastarbiter/io/reference_observations/rtc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def adjust_site_parameters(site):
3333
modeling_params = {
3434
'ac_capacity': 0.00324, # no clipping
3535
'dc_capacity': 0.00324,
36-
'temperature_coefficient': -0.00420,
36+
'temperature_coefficient': -0.420,
3737
'dc_loss_factor': 0,
3838
'ac_loss_factor': 0,
3939
'surface_tilt': 35,

solarforecastarbiter/pvmodel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ def calculate_power(dc_capacity, temperature_coefficient, dc_loss_factor,
277277
----------
278278
dc_capacity : float
279279
temperature_coefficient : float
280+
Specified in units of %/C to be converted to 1/C
280281
dc_loss_factor : float
281282
ac_capacity : float
282283
ac_loss_factor : float
@@ -291,7 +292,7 @@ def calculate_power(dc_capacity, temperature_coefficient, dc_loss_factor,
291292
pvtemps = pvlib.temperature.pvsyst_cell(poa_effective, temp_air,
292293
wind_speed=wind_speed)
293294
dc = pvlib.pvsystem.pvwatts_dc(poa_effective, pvtemps, dc_capacity,
294-
temperature_coefficient)
295+
temperature_coefficient / 100)
295296
dc *= (1 - dc_loss_factor / 100)
296297
# set eta values to turn off clipping in pvwatts_ac
297298
ac = pvlib.pvsystem.pvwatts_ac(dc, dc_capacity, eta_inv_nom=1,

solarforecastarbiter/reference_forecasts/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def run_nwp(forecast, model, run_time, issue_time):
7777
>>> modeling_parameters = datamodel.FixedTiltModelingParameters(
7878
... surface_tilt=30, surface_azimuth=180,
7979
... ac_capacity=10, dc_capacity=15,
80-
... temperature_coefficient=-0.004, dc_loss_factor=0,
80+
... temperature_coefficient=-0.4, dc_loss_factor=0,
8181
... ac_loss_factor=0)
8282
>>> power_plant = datamodel.SolarPowerPlant(
8383
... name='Test plant', latitude=32.2, longitude=-110.9,

solarforecastarbiter/reference_forecasts/tests/test_persistence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def load_data_base(data, observation, data_start, data_end):
2727
def powerplant_metadata():
2828
"""1:1 AC:DC"""
2929
modeling_params = datamodel.FixedTiltModelingParameters(
30-
ac_capacity=200, dc_capacity=200, temperature_coefficient=-0.003,
30+
ac_capacity=200, dc_capacity=200, temperature_coefficient=-0.3,
3131
dc_loss_factor=3, ac_loss_factor=0,
3232
surface_tilt=30, surface_azimuth=180)
3333
metadata = datamodel.SolarPowerPlant(

solarforecastarbiter/tests/test_pvmodel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ def test_calculate_poa_effective(aoi_func_system_type, apparent_zenith,
180180
@pytest.mark.parametrize(
181181
'dc_capacity,temperature_coefficient,dc_loss_factor,'
182182
'ac_capacity,ac_loss_factor,expected', (
183-
(10, -0.005, 0, 10, 0, (0., 7.58301313763377)),
184-
(5, 0.005, 0, 10, 0, (0., 5.)), # pvwatts_ac max out is pdc0
183+
(10, -0.5, 0, 10, 0, (0., 7.58301313763377)),
184+
(5, 0.5, 0, 10, 0, (0., 5.)), # pvwatts_ac max out is pdc0
185185
(10, 0.000, 20, 10, 20, (0., 6.1789760000000005)),
186186
(10, 0.000, -20, 10, -20, (0., 12.)),
187-
(15, -0.005, 0, 10, 0, (0., 10.)),
187+
(15, -0.5, 0, 10, 0, (0., 10.)),
188188
),
189189
ids=[
190190
'10:10 DC:AC, neg temp co, no loss',

0 commit comments

Comments
 (0)