def power_tracking(clearsky, albuquerque, system_parameters): """Simulated power for a pvlib SingleAxisTracker PVSystem in Albuquerque""" system = tracking.SingleAxisTracker(**system_parameters) mc = modelchain.ModelChain(system, albuquerque, orientation_strategy='south_at_latitude_tilt') mc.run_model(clearsky) return mc.ac
def summer_power_fixed(summer_clearsky, albuquerque, system_parameters): """Simulated power from a FIXED PVSystem in Albuquerque, NM.""" pv_system = pvsystem.PVSystem(**system_parameters) mc = modelchain.ModelChain(pv_system, albuquerque, orientation_strategy='south_at_latitude_tilt') mc.run_model(summer_clearsky) return mc.ac
def summer_power_tracking(summer_clearsky, albuquerque, array_parameters, system_parameters): """Simulated power for a TRACKING PVSystem in Albuquerque""" array = pvsystem.Array(pvsystem.SingleAxisTrackerMount(), **array_parameters) system = pvsystem.PVSystem(arrays=[array], **system_parameters) mc = modelchain.ModelChain(system, albuquerque) mc.run_model(summer_clearsky) return mc.results.ac
def summer_power_tracking_old_pvlib(summer_clearsky, albuquerque, array_parameters, system_parameters): """Simulated power for a TRACKING PVSystem in Albuquerque""" # copy of `summer_power_tracking` but with older pvlib API # TODO: remove when minimum pvlib version is >= 0.9.0 pv_system = tracking.SingleAxisTracker(**array_parameters, **system_parameters) mc = modelchain.ModelChain(pv_system, albuquerque) mc.run_model(summer_clearsky) return mc.ac
def summer_power_fixed(summer_clearsky, albuquerque, array_parameters, system_parameters): """Simulated power from a FIXED PVSystem in Albuquerque, NM.""" pv_system = pvsystem.PVSystem(surface_azimuth=180, surface_tilt=albuquerque.latitude, **array_parameters, **system_parameters) mc = modelchain.ModelChain( pv_system, albuquerque, ) mc.run_model(summer_clearsky) try: ac = mc.results.ac except AttributeError: ac = mc.ac # pvlib < 0.9.0 return ac
tracker_data = mount.get_orientation(solpos.apparent_zenith, solpos.azimuth) tracker_data['tracker_theta'].plot() plt.ylabel('Tracker Rotation [degree]') plt.show() # %% # With our custom tracking logic defined, we can create the corresponding # Array and PVSystem, and then run a ModelChain as usual: module_parameters = {'pdc0': 1, 'gamma_pdc': -0.004, 'b': 0.05} temp_params = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_polymer'] array = pvsystem.Array(mount=mount, module_parameters=module_parameters, temperature_model_parameters=temp_params) system = pvsystem.PVSystem(arrays=[array], inverter_parameters={'pdc0': 1}) mc = modelchain.ModelChain(system, loc, spectral_model='no_loss') # simple simulated weather, just to show the effect of discrete tracking weather = loc.get_clearsky(times) weather['temp_air'] = 25 weather['wind_speed'] = 1 mc.run_model(weather) fig, axes = plt.subplots(2, 1, sharex=True) mc.results.effective_irradiance.plot(ax=axes[0]) axes[0].set_ylabel('Effective Irradiance [W/m^2]') mc.results.ac.plot(ax=axes[1]) axes[1].set_ylabel('AC Power') fig.show() # %%
# turn into pandas DataFrame irrad = pd.concat(irrad, axis=1) # create bifacial effective irradiance using aoi-corrected timeseries values irrad['effective_irradiance'] = (irrad['total_abs_front'] + (irrad['total_abs_back'] * bifaciality)) # %% # With effective irradiance, we can pass data to ModelChain for # bifacial simulation. # dc arrays array = pvsystem.Array(mount=sat_mount, module_parameters=cec_module, temperature_model_parameters=temp_model_parameters) # create system object system = pvsystem.PVSystem(arrays=[array], inverter_parameters=cec_inverter) # ModelChain requires the parameter aoi_loss to have a value. pvfactors # applies surface reflection models in the calculation of front and back # irradiance, so assign aoi_model='no_loss' to avoid double counting # reflections. mc_bifi = modelchain.ModelChain(system, site_location, aoi_model='no_loss') mc_bifi.run_model_from_effective_irradiance(irrad) # plot results mc_bifi.results.ac.plot(title='Bifacial Simulation on June Solstice', ylabel='AC Power')
temperature_model_parameters=dict(a=-3.56, b=-0.075, deltaT=3)) arrays = [ pvsystem.Array(pvsystem.FixedMount(30, 270), name='West-Facing Array', **array_kwargs), pvsystem.Array(pvsystem.FixedMount(30, 90), name='East-Facing Array', **array_kwargs), ] loc = location.Location(40, -80) system = pvsystem.PVSystem(arrays=arrays, inverter_parameters=dict(pdc0=3)) mc = modelchain.ModelChain(system, loc, aoi_model='physical', spectral_model='no_loss') times = pd.date_range('2019-01-01 06:00', '2019-01-01 18:00', freq='5min', tz='Etc/GMT+5') weather = loc.get_clearsky(times) mc.run_model(weather) fig, ax = plt.subplots() for array, pdc in zip(system.arrays, mc.results.dc): pdc.plot(label=f'{array.name}') mc.results.ac.plot(label='Inverter') plt.ylabel('System Output') plt.legend()