Python PVLib并行组合IV曲线
我正在使用PVLib来模拟由于失配效应导致的光伏功率损失 是否可以添加并联连接的模块IV曲线 类似于:Python PVLib并行组合IV曲线,python,pvlib,Python,Pvlib,我正在使用PVLib来模拟由于失配效应导致的光伏功率损失 是否可以添加并联连接的模块IV曲线 类似于: def combine_series(dfs): """ Combine IV curves in series by aligning currents and summing voltages. The current range is based on the first curve's current range. &quo
def combine_series(dfs):
"""
Combine IV curves in series by aligning currents and summing voltages.
The current range is based on the first curve's current range.
"""
df1 = dfs[0]
imin = df1['i'].min()
imax = df1['i'].max()
i = np.linspace(imin, imax, 1000)
v = 0
for df2 in dfs:
v_cell = interpolate(df2, i)
v += v_cell
return pd.DataFrame({'i': i, 'v': v})
不同的是,它应该并行组合
非常感谢你,
基里安我想我明白了:
def interpolate_p(df, v):
"""convenience wrapper around scipy.interpolate.interp1d"""
f_interp = interp1d(df['v'], df['i'], kind='linear',
fill_value='extrapolate')
return f_interp(v)
def combine_parallel(dfs):
"""
Combine IV curves in parrallel by aligning voltages and summing currents.
The current range is based on the first curve's voltage range.
"""
df1 = dfs[0]
imin = df1['v'].min()
imax = df1['v'].max()
v = np.linspace(imin, imax, 1000)
i = 0
for df2 in dfs:
v_cell = interpolate_p(df2, v)
i += v_cell
return pd.DataFrame({'i': i, 'v': v})
我想这是成功的。请随意使用并告诉我我是否错了,或者PVLib中是否有其他函数
问候
基里安很高兴看到你自己试一试。不过,我会重新命名其中的一些变量。它看起来有点奇怪,以增加电压和电流…真的!!!谢谢你的提示:)