基于pvlib模拟不同辐照度下串联光伏组件的I-V曲线
多块不同辐照度光伏组件串联的IV曲线计算示例
当光伏组件串联时,所有组件的工作电流一致,组件串的总电压等于各组件电压之和。基于此,我们可以通过以下步骤计算不同辐照度下多组件串联后的IV曲线:
from pvlib import pvsystem import numpy as np import pandas as pd import matplotlib.pyplot as plt # 采用官网示例的加拿大太阳能CS5P-220M组件参数 parameters = { 'Name': 'Canadian Solar CS5P-220M', 'BIPV': 'N', 'Date': '10/5/2009', 'T_NOCT': 42.4, 'A_c': 1.7, 'N_s': 96, 'I_sc_ref': 5.1, 'V_oc_ref': 59.4, 'I_mp_ref': 4.69, 'V_mp_ref': 46.9, 'alpha_sc': 0.004539, 'beta_oc': -0.22216, 'a_ref': 2.6373, 'I_L_ref': 5.114, 'I_o_ref': 8.196e-10, 'R_s': 1.065, 'R_sh_ref': 381.68, 'Adjust': 8.7, 'gamma_r': -0.476, 'Version': 'MM106', 'PTC': 200.1, 'Technology': 'Mono-c-Si', } # 定义3块组件的工作条件:不同辐照度,相同电池温度 module_conditions = pd.DataFrame([ (1000, 55), # 组件1:1000 W/m²,55℃ (800, 55), # 组件2:800 W/m²,55℃ (600, 55) # 组件3:600 W/m²,55℃ ], columns=['Geff', 'Tcell']) # 为每块组件计算De Soto模型参数 IL, I0, Rs, Rsh, nNsVth = pvsystem.calcparams_desoto( module_conditions['Geff'], module_conditions['Tcell'], alpha_sc=parameters['alpha_sc'], a_ref=parameters['a_ref'], I_L_ref=parameters['I_L_ref'], I_o_ref=parameters['I_o_ref'], R_sh_ref=parameters['R_sh_ref'], R_s=parameters['R_s'], EgRef=1.121, dEgdT=-0.0002677 ) # 计算每块组件的单二极管曲线信息 SDE_params = { 'photocurrent': IL, 'saturation_current': I0, 'resistance_series': Rs, 'resistance_shunt': Rsh, 'nNsVth': nNsVth } curve_info = pvsystem.singlediode(method='lambertw', **SDE_params) # 生成统一的电流序列:串联时电流不能超过任意组件的短路电流,取最小值作为上限 min_i_sc = curve_info['i_sc'].min() i_series = np.linspace(0, min_i_sc, 200) # 生成200个电流点,覆盖串联工作范围 # 计算每个电流点下,每块组件对应的电压,再求和得到组件串总电压 v_total = np.zeros_like(i_series) module_voltages = [] for idx in range(len(module_conditions)): # 获取单块组件的参数 single_params = {k: v[idx] for k, v in SDE_params.items()} # 计算该组件在对应电流下的电压 v_module = pvsystem.v_from_i(current=i_series, method='lambertw', **single_params) module_voltages.append(v_module) v_total += v_module # 绘图:先画单组件IV曲线,再画串联后的总曲线 plt.figure(figsize=(10, 6)) # 绘制每块组件的IV曲线 colors = ['#1f77b4', '#ff7f0e', '#2ca02c'] for idx, (case, v_mod) in enumerate(zip(module_conditions.iterrows(), module_voltages)): _, row = case label = f"单组件{idx+1}: G={row['Geff']} W/m², T={row['Tcell']}℃" plt.plot(v_mod, i_series, label=label, color=colors[idx], linestyle='--') # 绘制串联后的组件串IV曲线 plt.plot(v_total, i_series, label='3组件串联总曲线', color='#d62728', linewidth=2) # 标记每块组件的MPP和串联后的MPP for idx in range(len(module_conditions)): v_mp = curve_info['v_mp'][idx] i_mp = curve_info['i_mp'][idx] plt.plot([v_mp], [i_mp], ls='', marker='o', c=colors[idx]) # 计算串联后的MPP:找到总功率最大的点 p_total = v_total * i_series mpp_idx = np.argmax(p_total) plt.plot([v_total[mpp_idx]], [i_series[mpp_idx]], ls='', marker='*', c='#d62728', markersize=12, label='串联MPP') plt.legend(loc='upper right') plt.xlabel('电压 [V]') plt.ylabel('电流 [A]') plt.title('不同辐照度组件串联的IV曲线') plt.grid(alpha=0.3) plt.tight_layout() plt.show() # 输出关键参数 print("单组件关键参数:") print(pd.DataFrame({ '组件编号': [1,2,3], '短路电流(A)': curve_info['i_sc'], '开路电压(V)': curve_info['v_oc'], 'MPP电流(A)': curve_info['i_mp'], 'MPP电压(V)': curve_info['v_mp'], 'MPP功率(W)': curve_info['p_mp'], })) print("\n组件串关键参数:") print(f"串联开路电压(V): {sum(curve_info['v_oc']):.2f}") print(f"串联短路电流(A): {min_i_sc:.2f}") print(f"串联MPP功率(W): {p_total.max():.2f}") print(f"串联MPP电压(V): {v_total[mpp_idx]:.2f}") print(f"串联MPP电流(A): {i_series[mpp_idx]:.2f}")
核心步骤说明
- 组件条件定义:可灵活设置每块组件的辐照度、温度参数,模拟阴影遮挡等差异化工况
- 统一电流序列:串联时所有组件电流必须一致,因此电流范围取所有组件短路电流的最小值,确保覆盖所有组件的有效工作区间
- 电压求和逻辑:对每个电流点,分别计算单组件的对应电压并累加,得到组件串的总电压
- MPP计算:通过总功率(电压×电流)的最大值,定位串联后的最大功率点
内容的提问来源于stack exchange,提问作者August
相关产品推荐
相关产品推荐

