if PlotVI_Module
assignin('base', 'Voc', Voc);
assignin('base', 'Isc', Isc);
assignin('base', 'Rs', Rs);
assignin('base', 'Rp', Rp);
assignin('base', 'Isat', Isat);
assignin('base', 'Vt', Vt);
if PlotVI_Module,
F1 = figure('Name', 'IV and PV characteristics of a Module at 25 deg.c');
end
load_system('PV_Model_Param');
for ksun=1:-0.25:0.25
assignin('base', 'Iph', Iph*ksun);
sim('PV_Model_Param');
n=find(I_PV>=1);
I_PV=I_PV(n);
P_PV=V_PV.*I_PV;
if PlotVI_Module
figure(F1);
subplot(211)
if ksun==1
plot(V_PV, I_PV, 'b' (0 Vmp Voc), (Isc Imp 0), 'ro')
text(Voc/15, Isc*1.1, '1 Kw/m^2')
hold on
grid
else
plot(V_PV, I_PV, '--m')
text(Voc/15, Isc*(ksun+0.1), sprintf('%g Kw/m^2', ksun))
end
subplot(212)
if ksun==1
plot(V_PV, P_PV, 'b', (0 Vmp Voc), (0 Imp*Vmp 0), 'ro')
text(Vmp*1.02, Vmp*Imp, '1 Kw/m^2')
hold on
grid
else
n=find(P_PV==max(P_PV));
plot(V_PV, P_PV, '--m', V_PV(n), P_PV(n), 'mo')
text(Vmp*1.02, Vmp*Imp*ksun, sprintf('%g Kw/m^2', ksun))
end
subplot(211)
ylabel('Current (A)')
xlabel('Voltage (V)')
title('PV_Module')
axis_xy=axis;
axis_xy(4)=Isc*1.2;
axis(axis_xy);
subplot(212)
ylabel('Power (W)')
xlabel('Voltage (V)')
axis_xy=axis;
axis_xy(4)=Vmp*Imp*1.2;
axis(axis_xy);
set_param(BlockName,'PlotVI_Module', 'off')
end
end
end
6 Comments
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577687
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577687
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577688
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577688
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577691
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577691
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577698
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577698
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577700
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577700
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577702
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/405219-i-am-getting-unbalanced-or-unexpected-parenthesis-or-bracket#comment_577702
Sign in to comment.