def test_faiman_ndarray(): temps = np.array([0, 10, 5]) irrads = np.array([0, 500, 0]) winds = np.array([10, 5, 0]) result = temperature.faiman(irrads, temps, wind_speed=winds) expected = np.array([0.0, 18.446, 5.0]) assert_allclose(expected, result, 3)
def test_faiman_series(): times = pd.date_range(start="2015-01-01", end="2015-01-02", freq="12H") temps = pd.Series([0, 10, 5], index=times) irrads = pd.Series([0, 500, 0], index=times) winds = pd.Series([10, 5, 0], index=times) result = temperature.faiman(irrads, temps, wind_speed=winds) expected = pd.Series([0.0, 18.446, 5.0], index=times) assert_series_equal(expected, result)
def test_faiman_default(): result = temperature.faiman(900, 20, 5) assert_allclose(result, 35.203, 0.001)
def test_faiman_kwargs(): result = temperature.faiman(900, 20, wind_speed=5.0, u0=22.0, u1=6.) assert_allclose(result, 37.308, 0.001)
pvrow_height, pvrow_width, albedo, n_pvrows=3, index_observed_pvrow=1) # turn into pandas DataFrame irrad = pd.concat(irrad, axis=1) # using bifaciality factor and pvfactors results, create effective irradiance bifaciality = 0.75 effective_irrad_bifi = irrad['total_abs_front'] + (irrad['total_abs_back'] * bifaciality) # get cell temperature using the Faiman model temp_cell = temperature.faiman(effective_irrad_bifi, temp_air=25, wind_speed=1) # using the pvwatts_dc model and parameters detailed above, # set pdc0 and return DC power for both bifacial and monofacial pdc0 = 1 gamma_pdc = -0.0043 pdc_bifi = pvsystem.pvwatts_dc(effective_irrad_bifi, temp_cell, pdc0, gamma_pdc=gamma_pdc).fillna(0) pdc_bifi.plot(title='Bifacial Simulation on June Solstice', ylabel='DC Power') # %% # For illustration, perform monofacial simulation using pvfactors front-side # irradiance (AOI-corrected), and plot along with bifacial results.