help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wierd octave behaviour


From: cyber gilles
Subject: wierd octave behaviour
Date: Mon, 21 Jul 2008 11:29:48 -0400

Hello there,

 I am using Octave 3.0.1 on Mac OS X 10.5. It works fine, however It
is giving me a hard time with one special calculation.
I get a "syntax error    >>>" endfunction^ " 99% of the time.

About 5 minutes again, it worked, (see screen) but it does not work
anymore. I am pasting my .m file below

close all
clear*

function Ia=f(Suns,Va,TaC)
k=1.38e-23;
q=1.60e-19;
n=1.2;
Vg=1.12;
Ns=36;
T1=273+25;
Voc_T1=21.06/Ns;
Isc_T1=3.80;
T2=273+75;
Voc_T2=17.05/Ns;
Isc_T2=3.92;
TaK=273+TaC;
K0=(Isc_T2-Isc_T1)/(T2-T1);
IL_T1=Isc_T1*Suns;
IL=IL_T1+K0*(TaK-T1);
I0_T1=Isc_T1/(exp(q*Voc_T1/(n*k*T1))-1);
I0=I0_T1*(TaK/T1).^(3/n).*exp(-q*Vg/(n*k).*((1./TaK)-(1/T1)));
Xv=I0_T1*q/(n*k*T1)*exp(q*Voc_T1/(n*k*T1));
dVdI_Voc=-1.15/Ns/2;
Rs=-dVdI_Voc-1/Xv;
Vt_Ta=k*TaK/q;
Vc=Va/Ns;
Ia=zeros(1,length(Va));
for j=1:5
Ia=Ia-(IL-Ia-I0.*(exp((Vc+Ia.*Rs)./Vt_Ta)-1))./(-1-(I0.*(exp((Vc+Ia.*Rs)./Vt_Ta)-1)).*Rs./Vt_Ta);
endfor
end function

voltage=f(0,25);
onesun=f(1,voltage,25)
halfsun=f(.5,voltage,25);
quartersun=f(.25,voltage,25);
plot(voltage,onesun,voltage,halfsun,voltage,quartersun)

grid on
axis ([0 20 0 4])




If you have any idea.. that would really make peace between me and Octave.

Attachment: ivcurves.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]