Please help me..Question on m-file and simulink
Show older comments
With reference to the paper ( http://www.imeko2009.it.pt/Papers/FP_622.pdf ), I have written a matlab code..I got IV and PV curves. But when I change the temperature(TaC) value,I'm getting negative values for the PV curve.What might be the problem?Can anyone suggest me?
And Also I want to model a simulink model of the PV array.Could anyone please please help me.
k = 1.381e-23; % Boltzmann constant, J/K
q=1.602e-19; % Electronic charge, C
N= 1.2; % Diode quality facror
Vg=1.12;%Band gap voltage,V
Ns=60; % Number of cells in series
% T1=0+273;% Temperature for which values are known
TaC= 25;% TaC Temperature for which values have to be found
Voc=36.6; %Open circuit voltage, V
Isc=8.3;%Short circuit current,
Ir0=1000;% Irradiance,W/m^2
T1=273+25;
Vt=k*T1/q;
%Calculation of Iph
Voc_T1=36.6/Ns;
TK=TaC+273;
K0=0.0008; %Temperature coefficient of Isc
Ir=1000;
Iph_T1=Isc*(Ir0/Ir);
Iph=Iph_T1+K0*(TK-T1);
%Calculation of Saturation current Is
Is_T1=Isc/(exp(Voc/N/Vt/Ns)-1);
Is=Is_T1*(TK/T1).^(3/N).*exp(-q*Vg/(N*k).*((1./TK)-(1/T1)));
%Rs
Xv = Is_T1*q/(N*k*T1*Ns)*exp(q*Voc_T1/(N*k*T1));
dVdI_Voc = -0.705;
Rs=-dVdI_Voc - (1/Xv);
%Rp
Vmp=29.1;
Imp=7.70;
Rp=(Vmp+Rs*Imp)/(-Imp+Iph-Is*(exp(q*(Vmp+Rs*Imp)/N*k*Ns*T1)-1));
Vt_Ta=N*k*TK / q;
V=0:0.5:Voc;
Vc=V/Ns;
I = zeros(size(Vc));
for j=1:5;
I = I - (Iph - I - Is.*( exp((V+I.*Rs)./(Vt_Ta*Ns)) -1))./(-1 - (Is.*( exp((V+I.*Rs)./(Vt_Ta*Ns)) -1)).*Rs./(Vt_Ta*Ns)-Rs/Rp);
end
P=I.*V;
% P=(Iph-Is*(exp((V+I.*Rs)/Vt/Ns/N)-1)-(V+I.*Rs)/Rp).*V;
% figure(1)
% grid on
% hold on
% plot(V,I)
figure(2)
grid on
hold on
plot(V,P)
Answers (4)
Hossein
on 2 Nov 2011
0 votes
you can try the('elec_solar')model in simscape.
3 Comments
Sai001 Cheguri
on 2 Nov 2011
Sai001 Cheguri
on 2 Nov 2011
Hossein
on 6 Nov 2011
it is exactly my problem with elec_solar model...
I have changed the iv_data but it doesn't work....
Hossein
on 16 Nov 2011
0 votes
Hi Cheguri, I have found your problem... please tell me the value of your panel which you want to use for your work...
4 Comments
Sai001 Cheguri
on 2 Dec 2011
kaithala sairam
on 15 Mar 2014
can any one please send me MATLAB code for shading effects of array(I-V,P-V ) Characterstics
palak mehta
on 22 Aug 2015
plz send me (v-I) code of this.
jyoteesh arumalla
on 3 Oct 2016
Hello can i know why is it popping out negative values
Emircan Han
on 30 Jun 2017
0 votes
how did you solve that problem?
Caio Meira
on 6 Nov 2017
0 votes
when you increase the temperature to the point of Voc tends to decrease, and as in your code the band remains the same, ie: V = 0: 0.5: Voc: it is natural that you stray.
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!