@@ -304,8 +304,26 @@ def test_missing_p_values(self):
304304 ** test_modelchain )
305305 test_mc .run_model (self .weather_df )
306306
307+ def test_modelchain_with_power_curve_as_dict (self ):
308+ """Test power curves as dict"""
309+ my_turbine = {'nominal_power' : 3e6 , 'hub_height' : 105 ,
310+ 'rotor_diameter' : 70 ,
311+ 'power_curve' : {
312+ 'value' : [p * 1000 for p in [
313+ 0.0 , 26.0 , 180.0 , 1500.0 , 3000.0 , 3000.0 ]],
314+ 'wind_speed' : [0.0 , 3.0 , 5.0 , 10.0 , 15.0 , 25.0 ]},
315+ 'power_coefficient_curve' : {
316+ 'value' : [0.0 , 0.43 , 0.45 , 0.35 , 0.12 , 0.03 ],
317+ 'wind_speed' : [0.0 , 3.0 , 5.0 , 10.0 , 15.0 , 25.0 ]}}
318+ power_output_exp = pd .Series (data = [919055.54840 ,
319+ 1541786.60559 ],
320+ name = 'feedin_power_plant' )
321+ test_mc = mc .ModelChain (wt .WindTurbine (** my_turbine ))
322+ test_mc .run_model (self .weather_df )
323+ assert_series_equal (test_mc .power_output , power_output_exp )
324+
307325 def test_modelchain_with_power_coefficient_curve_as_dict (self ):
308- """Test power ( coefficient) curves as dict"""
326+ """Test power coefficient curves as dict"""
309327 my_turbine = {'nominal_power' : 3e6 , 'hub_height' : 105 ,
310328 'rotor_diameter' : 70 ,
311329 'power_curve' : {
@@ -315,9 +333,10 @@ def test_modelchain_with_power_coefficient_curve_as_dict(self):
315333 'power_coefficient_curve' : {
316334 'value' : [0.0 , 0.43 , 0.45 , 0.35 , 0.12 , 0.03 ],
317335 'wind_speed' : [0.0 , 3.0 , 5.0 , 10.0 , 15.0 , 25.0 ]}}
318- # run model with power curve
319- mc .ModelChain (wt .WindTurbine (** my_turbine )).run_model (self .weather_df )
320- # run model with power coefficient curve
321- mc .ModelChain (wt .WindTurbine (** my_turbine ),
322- power_output_model = 'power_coefficient_curve' ).run_model (
323- self .weather_df )
336+ power_output_exp = pd .Series (data = [469518.35104 ,
337+ 901794.28532 ],
338+ name = 'feedin_power_plant' )
339+ test_mc = mc .ModelChain (wt .WindTurbine (** my_turbine ),
340+ power_output_model = 'power_coefficient_curve' )
341+ test_mc .run_model (self .weather_df )
342+ assert_series_equal (test_mc .power_output , power_output_exp )
0 commit comments