👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
本文为演示光伏(PV)模块的操作而开发的交互式算法的改进版本。随着Excel文件(真实光伏模块的测量样本)的加载,该算法有效地显示了两条I-V特性曲线:基于测量输入值和初始化特性参数的模型I-V曲线(红色虚线)和基于电流和电压表阵列的测量I-V曲线(蓝色实线)。
通过最大功率 (Pmax)、最大功率电压 (Vmp)、最大功率电流 (Imp)、开路电压 (Voc)、短路电流 (Isc)、温度 (T)、填充因子 (FF) 和辐照度 (G) 等测量值的数字显示,二极管理想因子 (A)、串联电阻 (Rs) 和分流电阻 (Rsh) 等特性参数可在算法中编辑,以观察模型 I-V 曲线中的任何瞬时变化。由于功能与先前版本的算法相似,但很少有功能也很重要,例如显示电流电压(MAE)的平均绝对误差和平均绝对误差百分比(MAEP)。MAE和MAEP是数值测量值,表示测量的I-V曲线与模型I-V曲线之间的接近程度。该算法可用于三个现有的Excel文件:单晶硅光伏组件的“单晶数据.xlsx,多晶硅光伏组件的”多晶数据.xlsx“和非晶硅薄膜光伏组件的”a-Si薄膜数据.xlsx”。
部分代码:
uicontrol('Style','text','String','Ki','HorizontalAlignment','right','Position',[505 337 30 20]);
hKi=uicontrol('Style','edit','String','0.0','Position',[553 337 40 20],'Callback',@filechange);
uicontrol('Style','text','String','%/C','HorizontalAlignment','right','Position',[595 337 25 20]); % unit for Ki
uicontrol('Style','text','String','Kv','HorizontalAlignment','right','Position',[505 312 30 20]);
hKv=uicontrol('Style','edit','String','-0.0','Position',[553 312 40 20],'Callback',@filechange);
uicontrol('Style','text','String','%/C','HorizontalAlignment','right','Position',[595 312 25 20]); % unit for Kv
uicontrol('Style','text','String','G','HorizontalAlignment','right','Position',[505 287 30 20]);
hG=uicontrol('Style','text','String','0.0','Position',[553 287 40 20]);
uicontrol('Style','text','String','W/m2','HorizontalAlignment','right','Position',[595 287 30 20]); % unit for G
%hMPP=uicontrol('Style','text','String','0.0','Position',[553 389 40 20]);
uicontrol('Style','text','String','T','HorizontalAlignment','right','Position',[505 264 30 20]);
hTC=uicontrol('Style','text','String','0.0','Position',[553 264 40 20]);
uicontrol('Style','text','String','C','HorizontalAlignment','right','Position',[595 264 15 20]); % unit for T
uicontrol('Style','text','String','IL','HorizontalAlignment','right','Position',[505 239 30 20]);
hIL=uicontrol('Style','text','String','0.0','Position',[553 239 40 20]);
uicontrol('Style','text','String','A','HorizontalAlignment','right','Position',[595 239 15 20]); % unit for IL
uicontrol('Style','text','String','I0','HorizontalAlignment','right','Position',[505 214 30 20]);
hI0=uicontrol('Style','text','String','0.0','Position',[553 214 40 20]);
uicontrol('Style','text','String','A','HorizontalAlignment','right','Position',[595 214 15 20]); % unit for I0
uicontrol('Style','text','String','FF','HorizontalAlignment','right','Position',[505 189 30 20]);
hFFm=uicontrol('Style','text','String','0.0','Position',[553 189 40 20]);
uicontrol('Style','text','String','A','HorizontalAlignment','right','Position',[505 164 30 20]);
hA=uicontrol('Style','edit','String','1.00','Position',[553 164 40 20],'Callback',@filechange);
uicontrol('Style','text','String','Rs','HorizontalAlignment','right','Position',[505 139 30 20]);
hRs=uicontrol('Style','edit','String','0.00','Position',[553 139 40 20],'Callback',@filechange);
uicontrol('Style','text','String','ohm','HorizontalAlignment','right','Position',[595 139 25 20]); % unit for Rs
uicontrol('Style','text','String','Rsh','HorizontalAlignment','right','Position',[505 112 30 20]);
hRsh=uicontrol('Style','edit','String','1000','Position',[553 112 40 20],'Callback',@filechange);
uicontrol('Style','text','String','ohm','HorizontalAlignment','right','Position',[595 112 25 20]); % unit for Rsh
uicontrol('Style','text','String','MAE','HorizontalAlignment','right','Position',[505 87 30 20]);
hMAE=uicontrol('Style','text','Position',[553 87 40 20]);
uicontrol('Style','text','String','A','HorizontalAlignment','right','Position',[595 87 15 20]); % unit for MAE
uicontrol('Style','text','String','MAEP','HorizontalAlignment','right','Position',[505 62 30 20]);
hMAEP=uicontrol('Style','text','HorizontalAlignment','center','Position',[553 62 43 20]);
uicontrol('Style','text','String','%','HorizontalAlignment','right','Position',[595 62 15 20]); % unit for MAEP
n_sheet = 1;
uicontrol('Style','pushbutton','String','Open','Position',[505 12 100 25],'Callback',@Open);
h=subplot(1,1,1);
set(h,'position',[0.08 0.13 0.68 0.815]);
plot(0);
function Open(~,~)
filename = uigetfile('*.xlsx'); % Choosing the Excel file as input
if isequal(filename,0) % Handling Cancel button pressed
return;
end
pv.Imp = xlsread(filename,n_sheet,'B10:B10'); % Current at maximum power
pv.Vmp = xlsread(filename,n_sheet,'B9:B9'); % Voltage at maximum power
pv.Isc = xlsread(filename,n_sheet,'B7:B7'); % Short circuit current
pv.Voc = xlsread(filename,n_sheet,'B6:B6'); % Open circuit voltage
pv.G = xlsread(filename,n_sheet,'B14:B14'); % Irradiance
pv.TC = xlsread(filename,n_sheet,'B13:B13'); % Temperature
pv.FF_m = xlsread(filename,n_sheet,'B12:B12'); % Fill factor (of red I-V curve)
pv.Pmax_m = xlsread(filename,n_sheet,'B8:B8'); % Maximum power (of red I-V curve)
% Measured data (data arrays) from spreadsheet file
pv.V = xlsread(filename,n_sheet,'A18:A166'); % Array of measured voltage points
pv.I = xlsread(filename,n_sheet,'B18:B166'); % Array of measured current points
set(hG,'String',num2str(pv.G,'%0.0f'));
set(hTC,'String',num2str(pv.TC,'%0.1f'));
set(hFFm,'String',num2str(pv.FF_m,'%0.4f'));
set(hIsc,'String',num2str(pv.Isc,'%0.2f'));
set(hVoc,'String',num2str(pv.Voc,'%0.2f'));
set(hImp,'String',num2str(pv.Imp,'%0.2f'));
set(hVmp,'String',num2str(pv.Vmp,'%0.2f'));
set(hMPPi,'String',num2str(pv.Pmax_m,'%0.1f'));
cla;
filechange;
end
部分理论来源于网络,如有侵权请联系删除。
[1]Landon Hoo (2022). PV Module Characteristic Curve Algorithm