The following are my code for simple pv modules, I keep getting the same plot for different irradiance values. Can someone help?
Show older comments
Even after changing the values of Gn and S in code 1 and code 2 resp. I keep getting the same plot.
Code 1 for a simple Pv module with one diode and one resistor:
clc;
clear all;
K= 1.38065e-23; %Boltsman constant
q= 1.602e-19; %charge of electron
Iscn= 8.21; %nominal SC current
Vocn= 32.9; %nominal OC voltage
Kv= -0.123; %temp. voltage constant
Ki= 0.0032; %temp current constant
Ns= 54; %No. of series connected cells
T= 25+273; %operating temp.
Tn= 25+273 %nominal temp.
Gn= 1000; %nominal irradiance
a= 1.3; %diode ideality constant
Eg= 1.12; %band gap of silicon at 25 degree celcius
G= 800; %actual irradiation
Rs= 0.221;
Rp= 415.405;
tic
Vtn= Ns*(K*Tn/q);
Ion = Iscn/((exp(Vocn/(a*Vtn)))-1)
Io= Ion*((Tn/T)^3)*exp(((q*Eg/(a*K)*((1/Tn)-(1/T)))));
Ipvn = Iscn;
Ipv= (Ipvn + Ki*(T-Tn)*(G/Gn))
Vt = Ns*(K*T/q);
I= zeros(330,1);
i=1;
I(1,1)=0;
for V= 32.9:-0.1:0
I_part = Io*(exp((V+(I(i,1)*Rs))/(Vt*a))-1) + ((V+(Rs*I(i,1)))/Rp);
I(i+1)= Ipv -I_part;
V1(i)= V;
P(i)= V*I(i);
i=i+1;
end
time_elapsed=toc;
V1(i) = V1(i-1);
P(i) = P(i-1);
V1=transpose(V1);
%subplot(3,1,1)
%plot(V1,I);
%subplot(3,1,2)
plot(V1,P);
%subplot(3,1,3)
%plot(V1, I_part);
Code 2 is basically the same as code 1 but uses more complex equations and give better and faster solutions:
clc;
clear all;
Pmpp = 50; %Max Power
Vmpp = 17.98; %Vol at Pmax
Impp = 2.77; %Current at Pmax
Isc= 3; %Short-circuit current
Voc= 22; %Open Circuit Voltage
a= 0.0004; %Temp coeff. of Isc
b= -0.0033; %Temp coeff. of Voc
T = 30;
Tref= 25;
S= 800;
Sref= 1000;
Rs= 0.085;
V= 30;
kref= (1-(Impp/Isc))^(1/(((Vmpp+Rs*Impp)/Voc)-1));
Vo = Voc*(1+ a*log(S/Sref)+ b*(T-Tref));
I= zeros(330,1);
for i = 1:330
V(i)= (i-1)*0.1;
Is = Isc*(1+a*(T-Tref))*(S/Sref);
I(i)= Isc*(1-kref.^((V(i)-Voc+Rs*I(i))/Voc));
end
plot(V,I),grid;
xlabel('Voltage'),ylabel('Current');
Accepted Answer
More Answers (0)
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!