while executing a m-file it shows busy?
Afficher commentaires plus anciens
I am working on PV Cell modelling. I came across a matlab code and while running the m file it shows busy.
clc;
clear all;
T=25+273;
Tn=25+273;
dT=T-Tn;
G=800;
Gn=1000;
Imp=7.61;
Vmp=26.3;
Iscn=8.21;
Vocn=32.9;
Pmaxe=Vmp*Imp;
Kv=-0.1230;
Ki=0.0032;
Ns=54;
k=1.38065e-23;
q=1.602e-19;
a=1.3;
Vtn=k*Tn/q;
Vt=k*T/q;
Rpmin=(Vmp/(Iscn-Imp))-((Vocn-Vmp)/Imp);
Rp=Rpmin;
Rs=0;
Io=(Iscn+(Ki*dT))/((exp((Vocn+(Kv*dT))/a*Vt))-1);
P=(0);
err=inf;
tol=0.01;
while(err>tol)
Ipvn=(((Rs+Rp)/Rp))*Iscn;
Ipv=(Ipvn+(Ki*dT))*(G/Gn);
Isc=(Iscn+(Ki*dT))*(G/Gn);
Rs=Rs+0.01;
b=exp(((Vmp+(Imp*Rs))*q)/(Ns*a*k*T));
Rp=(Vmp+(Imp*Rs))/((Vmp*Ipv)-(Vmp*Io*b)+(Vmp*Io)-Pmaxe);
clear V
clear I
V=0:0.1:50;
I=zeros(1,size(V,2));
g=zeros(1,size(V,2));
glin=zeros(1,size(V,2));
I_=zeros(1,size(V,2));
for j=1:size(V,2)
g(j)=Ipv-(Io*exp(V(j)+(Rs*I(j)))/(Vt*a*Ns))+Io-((V(j)+(Rs*I(j)))/Rp)-I(j);
while(abs(g(j))>0.001)
g(j)=Ipv-(Io*exp(V(j)+(Rs*I(j)))/(Vt*a*Ns))+Io-((V(j)+(Rs*I(j)))/Rp)-I(j);
glin(j)=-(Io*exp((V(j)+(Rs*I(j)))/(Vt*a*Ns))*Rs/(Vt*a*Ns))-(Rs/Rp)-1;
I_(j)=I(j)-(g(j)/glin(j));
I(j)=I_(j);
end
end
P=(Ipv-(Io*exp((V+(I.*Rs))/(Vt*a*Ns)))+Io-((V+(I.*Rs))/Rp)).*V;
Pmax=max(P);
err=(Pmax-Pmaxe);
end
fprintf('Model info:-\n');
fprintf('Rp=%f',Rp);
fprintf('Rs=%f',Rs);
fprintf('Pmax=%f',Pmax);
1 commentaire
Adam
le 3 Nov 2016
What is your question? Matlab always shows busy when it is busy. It's a feature.
Réponse acceptée
Plus de réponses (1)
Emircan Han
le 30 Juin 2017
0 votes
How did you solve this problem, i couldn't get it?
Catégories
En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!