0

我正在尝试使用 CECMod 光伏模块上的 pvlib 库计算能量输出。我发现的唯一实现(感谢 Mark 和 Cliff)假设模块安装在全天跟随太阳的单轴跟踪器上。这对我来说是个问题,因为我的模块将被修复并且不会跟踪太阳。

有没有一种方法可以计算 CECMod 模块的能量输出而不假设它们会跟踪太阳?

作为参考,我在下面包含了使用单轴跟踪器的实现。

import pvlib
import pandas as pd

YEAR = 1990
STARTDATE = '%d-01-01T00:00:00' % YEAR
ENDDATE = '%d-12-31T23:59:59' % YEAR
TIMES = pd.date_range(start=STARTDATE, end=ENDDATE, freq='H')
INVERTERS = pvlib.pvsystem.retrieve_sam('CECInverter')
INVERTER_10K = INVERTERS['SMA_America__SB10000TL_US__240V_']
CECMODS = pvlib.pvsystem.retrieve_sam('CECMod')
CECMOD_POLY = CECMODS['Canadian_Solar_Inc__CS6X_300P']
CECMOD_MONO = CECMODS['Canadian_Solar_Inc__CS6X_300M']
LATITUDE, LONGITUDE = 40.5137, -108.5449
NREL_API_KEY = os.getenv('NREL_API_KEY', 'DEMO_KEY')
EMAIL = os.getenv('EMAIL', 'bwana...@yahoo.com')
 
header, data = pvlib.iotools.get_psm3(LATITUDE, LONGITUDE, NREL_API_KEY, EMAIL)
# get solar position
data.index = TIMES
sp = pvlib.solarposition.get_solarposition(
        TIMES, LATITUDE, LONGITUDE)
solar_zenith = sp.apparent_zenith.values
solar_azimuth = sp.azimuth.values
dni = data.DNI.values
ghi = data.GHI.values
dhi = data.DHI.values
surface_albedo = data['Surface Albedo'].values
temp_air = data.Temperature.values
dni_extra = pvlib.irradiance.get_extra_radiation(TIMES).values

## Here is where the single-axis tracker is introduced

tracker = pvlib.tracking.singleaxis(solar_zenith, solar_azimuth)
surface_tilt = tracker['surface_tilt']
surface_azimuth = tracker['surface_azimuth']
poa_sky_diffuse = pvlib.irradiance.get_sky_diffuse(
        surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
        dni, ghi, dhi, dni_extra=dni_extra, model='haydavies')
aoi = tracker['aoi']
poa_ground_diffuse = pvlib.irradiance.get_ground_diffuse(
        surface_tilt, ghi, albedo=surface_albedo)
poa = pvlib.irradiance.poa_components(
        aoi, dni, poa_sky_diffuse, poa_ground_diffuse)
poa_direct = poa['poa_direct']
poa_diffuse = poa['poa_diffuse']
poa_global = poa['poa_global']
iam = pvlib.iam.ashrae(aoi)
effective_irradiance = poa_direct*iam + poa_diffuse
temp_cell = pvlib.temperature.pvsyst_cell(poa_global, temp_air)

# this is the magic
cecparams = pvlib.pvsystem.calcparams_cec(
        effective_irradiance, temp_cell,
        CECMOD_MONO.alpha_sc, CECMOD_MONO.a_ref,
        CECMOD_MONO.I_L_ref, CECMOD_MONO.I_o_ref,
        CECMOD_MONO.R_sh_ref, CECMOD_MONO.R_s, CECMOD_MONO.Adjust)
mpp = pvlib.pvsystem.max_power_point(*cecparams, method='newton')
mpp = pd.DataFrame(mpp, index=TIMES)
Edaily = mpp.p_mp.resample('D').sum() ```

Thanks for any help you can offer!
4

1 回答 1

0

在我看来,如果您使用PVSystem类构造函数创建一个基本系统,而不是SingleAxisTracker,您可以在没有跟踪功能的情况下实现基本相同的行为。

这是我的代码,它说明了使用这两个构造函数实现两个类似系统的代码,大致基于PV 生产示例

import datetime
import pytz

import pandas as pd
import matplotlib.pyplot as plt

import pvlib.forecast as pvlib_foreacst
import pvlib.pvsystem as pvlib_pvsystem
import pvlib.temperature as pvlib_temperature
import pvlib.tracking as pvlib_tracking
import pvlib.modelchain as pvlib_modelchain

def pv_power_forecast_example():

    """ an example from https://pvlib-python.readthedocs.io/en/stable/forecasts.html?highlight=power#pv-power-forecast """

    sandia_modules = pvlib_pvsystem.retrieve_sam(name="sandiamod", path=None)  # retrieve a table of pv panel data from database name in ["CECMod", "SandiaMod"]
    cec_inverters = pvlib_pvsystem.retrieve_sam(name="cecinverter", path=None)  # retrieve a table of inverter data from database name in ["CECInverter", "SandiaInverter", "ADRInverter"]
    module_parameters = sandia_modules["Canadian_Solar_CS5P_220M___2009_"]  # select single PV module parameters
    inverter_parameters = cec_inverters["SMA_America__SC630CP_US__with_ABB_EcoDry_Ultra_transformer_"]  # select single inverter module paramters
    temperature_modeling_methodology = pvlib_temperature.TEMPERATURE_MODEL_PARAMETERS["sapm"]  # select corresponding cell temperature modelling methodlogy
    temperature_model_parameters = temperature_modeling_methodology["open_rack_glass_glass"]  # select type from  ['open_rack_glass_glass', 'close_mount_glass_glass', 'open_rack_glass_polymer', 'insulated_back_glass_polymer']

    # create a PV system from previous selection

    fig = plt.figure()

    for iterator in [0, 1]:

        if iterator == 0:
            # tracking example
            example_label = "tracking"
            system = pvlib_tracking.SingleAxisTracker(
                axis_tilt=0,  # tilt of rotational axis (axis_azimuth) with respect to horizontal
                axis_azimuth=0,   # east of north
                max_angle=90,
                module_parameters=module_parameters,
                inverter_parameters=inverter_parameters,
                temperature_model_parameters=temperature_model_parameters,
                modules_per_string=15,  # num of modules in series
                strings_per_inverter=300,  # num of modules in parallel
                albedo=0.3,
                surface_type="concrete",
                )

        if iterator == 1:
            # fixed example
            example_label = "fixed?"
            system = pvlib_pvsystem.PVSystem(
                surface_tilt=0,  # surface facing up = 0, surface facing horizon = 90
                surface_azimuth=180,  # N=0, E=90, S=180, W=270
                albedo=0.3,
                surface_type="concrete",
                module=None,  # model name of selected module
                module_type=None,  # [=None, "glass_polymer", "glass_glass"]
                module_parameters=module_parameters,
                temperature_model_parameters=temperature_model_parameters,
                modules_per_string=15,  # num of modules in series
                strings_per_inverter=300,  # num of modules in parallel
                inverter=None,  # model name of selected inverter
                inverter_parameters=inverter_parameters,
                racking_model=None,  # [=None, "open_rack", "close_mount", "insulated_back"]
                losses_parameters=None,
                name=None
                )

        # define test site location and simulation time span
        (latitude, longitude, zone) = (44.787197, 20.457273, "Europe/Belgrade")
        start = pytz.timezone(zone=zone).localize(dt=datetime.datetime(2021, 1, 1, 0, 0)).astimezone(tz=pytz.timezone(zone))
        end = start + pd.Timedelta(days=21)

        model = pvlib_foreacst.GFS(resolution="half", set_type="best")  # instantiate weather data/forecast model
        weather = model.get_processed_data(latitude=latitude, longitude=longitude, start=start, end=end)  # obtain and process weather data/forecast

        model_chain = pvlib_modelchain.ModelChain(system=system, location=model.location)  # create a helper-model i.e. model chain to automate simulation
        model_chain.run_model(weather=weather)  # run the simulation
    
        plt.plot(model_chain.ac.fillna(0)/1000, label=example_label)
        plt.legend()
        plt.ylabel("AC Power [kW]")
        plt.grid(which="both")
        plt.tight_layout()

        print(example_label + " " + str(model_chain.ac.fillna(0)))
        print("")

    plt.show()
    plt.ion()

    pass

if __name__ == "__main__":
    pv_power_forecast_example()
    pass
else:
    pass

结果是这样的……

但是,我只在很短的时间内尝试了 pvlib,所以请对我的回应持保留态度。

于 2021-01-18T08:23:15.583 回答