Python PVLib并行组合IV曲线



我正在使用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.
"""
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})

不同之处在于它应该并行地组合。

非常感谢,Kilian

我想我得到了:

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 parallel 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中是否有其他函数,请随时使用并告诉我。

问候Kilian

最新更新