gpt4 book ai didi

python - 如何使用 PVLIB 构建通用光伏系统

转载 作者:太空宇宙 更新时间:2023-11-04 04:07:12 24 4
gpt4 key购买 nike

我正在尝试构建一个通用的光伏系统来建模,而不需要特定的模块和逆变器。我有所有关键变量(表面方位角、倾斜、反照率、跟踪技术(固定、单、双)、位置、DC 大小(KW)、损耗因子、DC/AC 比)

我知道 PVWatts 是执行此操作的最佳方法,但我不知道它是如何工作的。我如何最好地在 PVLIB 中构建这样的 pvsystem?

附加的当前代码,它可以工作,但希望更改 pvsystem 构建

# import packages
import os
import itertools
import matplotlib.pyplot as plt
import pandas as pd
from pandas.plotting import register_matplotlib_converters
import numpy as np

# pvlib imports
import pvlib
from pvlib import clearsky, atmosphere, solarposition
from pvlib.iotools import read_tmy3
from pvlib.pvsystem import PVSystem
from pvlib.location import Location
from pvlib.modelchain import ModelChain

# Set Location
latitude, longitude, tz, altitude, name = -17.0, 145.4, 'Etc/GMT+10', 400, 'Mareeba/QLD'
location = Location(latitude, longitude, tz, altitude, name)

# load some module and inverter specifications
sandia_modules = pvlib.pvsystem.retrieve_sam('SandiaMod')
cec_inverters = pvlib.pvsystem.retrieve_sam('cecinverter')
sandia_module = sandia_modules['Canadian_Solar_CS5P_220M___2009_']
cec_inverter = cec_inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_']
system = PVSystem(
surface_tilt=20,
surface_azimuth=0,
module_parameters=sandia_module,
inverter_parameters=cec_inverter,
albedo=0.2,
# modules_per_string=5,
# strings_per_inverter=5
)

# Get Irradiance and weather
times = pd.date_range(start='2018-01-01', end='2018-12-31', freq='5min', tz=location.tz)
solpos = pvlib.solarposition.get_solarposition(times, latitude, longitude)
apparent_zenith = solpos['apparent_zenith']
airmass = pvlib.atmosphere.get_relative_airmass(apparent_zenith)
pressure = pvlib.atmosphere.alt2pres(altitude)
airmass = pvlib.atmosphere.get_absolute_airmass(airmass, pressure)
linke_turbidity = pvlib.clearsky.lookup_linke_turbidity(times, latitude, longitude)
dni_extra = pvlib.irradiance.get_extra_radiation(times)
ineichen = clearsky.ineichen(apparent_zenith, airmass, linke_turbidity, altitude, dni_extra)
print(ineichen.head(3))

# Graph Irriadiance
# plt.figure();
# ax = ineichen.plot()
# ax.set_ylabel('Irradiance $W/m^2$');
# ax.set_title('Ineichen Clear Sky Model');
# ax.legend(loc=2);
# plt.show()

# build weather data
weather = pd.concat(
[
ineichen,
pd.DataFrame(
[[20.0, 5.0] for _ in range(ineichen.shape[0])],
ineichen.index, ['temp_air', 'wind_speed']
)
], axis=1)
print(weather.head(3))

# build model chain
mc = ModelChain(system, location)

# run model chain
mc.run_model(times=weather.index, weather=weather)

register_matplotlib_converters()
plt.plot(mc.ac)
plt.show()

最佳答案

用指定 PVWatts 参数的字典替换您的 sandia_modulecec_inverter。本文档部分中的代码演示了如何指定 PVWatts 参数:https://pvlib-python.readthedocs.io/en/stable/user_guide/pvsystem.html#design-philosophy

关于python - 如何使用 PVLIB 构建通用光伏系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57067952/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com