コード例 #1
0
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
コード例 #2
0
def test_SingleAxisTracker_one_array_only():
    system = tracking.SingleAxisTracker(arrays=[
        pvsystem.Array(module='foo', surface_tilt=None, surface_azimuth=None)
    ])
    assert system.arrays[0].module == 'foo'
    with pytest.raises(ValueError,
                       match="SingleAxisTracker does not support "
                       r"multiple arrays\."):
        tracking.SingleAxisTracker(arrays=[
            pvsystem.Array(module='foo'),
            pvsystem.Array(module='bar')
        ])
    with pytest.raises(ValueError, match="Array must not have surface_tilt "):
        tracking.SingleAxisTracker(arrays=[pvsystem.Array(module='foo')])
    with pytest.raises(ValueError, match="Array must not have surface_tilt "):
        tracking.SingleAxisTracker(
            arrays=[pvsystem.Array(surface_azimuth=None)])
    with pytest.raises(ValueError, match="Array must not have surface_tilt "):
        tracking.SingleAxisTracker(arrays=[pvsystem.Array(surface_tilt=None)])
コード例 #3
0
loc = location.Location(40, -80)
solpos = loc.get_solarposition(times)
mount = DiscontinuousTrackerMount(axis_azimuth=180, gcr=0.4)
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')
コード例 #4
0
                             index_observed_pvrow=1)

# 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')
コード例 #5
0
solpos = loc.get_solarposition(weather.index)
# same default monthly tilts as SAM:
tilts = [40, 40, 40, 20, 20, 20, 20, 20, 20, 40, 40, 40]
mount = SeasonalTiltMount(monthly_tilts=tilts)
orientation = mount.get_orientation(solpos.apparent_zenith, solpos.azimuth)
orientation['surface_tilt'].plot()
plt.ylabel('Surface Tilt [degrees]')
plt.show()

# %%
# With our custom tilt strategy 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')

_ = mc.run_model(weather)

# %%
# Now let's re-run the simulation assuming tilt=30 for the entire year:

array2 = pvsystem.Array(mount=pvsystem.FixedMount(30, 180),
                        module_parameters=module_parameters,
                        temperature_model_parameters=temp_params)
system2 = pvsystem.PVSystem(arrays=[array2], inverter_parameters={'pdc0': 1})
mc2 = modelchain.ModelChain(system2, loc, spectral_model='no_loss')
_ = mc2.run_model(weather)
コード例 #6
0
# %%
# New Mount classes should extend ``pvlib.pvsystem.AbstractMount``
# and must implement a ``get_orientation(solar_zenith, solar_azimuth)`` method:


class DualAxisTrackerMount(pvsystem.AbstractMount):
    def get_orientation(self, solar_zenith, solar_azimuth):
        # no rotation limits, no backtracking
        return {'surface_tilt': solar_zenith, 'surface_azimuth': solar_azimuth}


loc = location.Location(40, -80)
array = pvsystem.Array(mount=DualAxisTrackerMount(),
                       module_parameters=dict(pdc0=1, gamma_pdc=-0.004,
                                              b=0.05),
                       temperature_model_parameters=dict(a=-3.56,
                                                         b=-0.075,
                                                         deltaT=3))
system = pvsystem.PVSystem(arrays=[array], inverter_parameters=dict(pdc0=3))
mc = modelchain.ModelChain(system, loc, 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)

mc.results.ac.plot()
plt.ylabel('Output Power')
plt.show()
コード例 #7
0
#
# This particular example has one east-facing array (azimuth=90) and one
# west-facing array (azimuth=270), which aside from orientation are identical.

from pvlib import pvsystem, modelchain, location
import pandas as pd
import matplotlib.pyplot as plt

array_kwargs = dict(module_parameters=dict(pdc0=1, gamma_pdc=-0.004),
                    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',