help-octave
[Top][All Lists]
Advanced

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

lsode inconsistent sizes error


From: tessaract87
Subject: lsode inconsistent sizes error
Date: Fri, 7 Nov 2014 14:58:15 -0800 (PST)

Hi all,

I've successfully figured out how to implement my differential equations
model in Octave- I put in data, and it gets me back answers.  However, when
I try to solve it using lsode using the command >>
lsode(@Venus,[0.051,0.0056,0.0045,2220,1930,0.625],0:5:100), I get the
following error:

error: lsode: inconsistent sizes for state and derivative vectors

I'm assuming this means there's a mismatch between vectors, but I haven't
been able to figure out where.

The model code is as such:

function venus = f(x,t)
BDR=0.016;
SPC=5.8*10^-3;
SC=0.01377;
SHC=0.025;

venus=[BDR*(x(2).+x(3))-(SRB(x(1),x(4))*x(2)+PS(x(1),x(6))*x(3));SRB(x(1),x(4))*x(2)-(BDR)*x(2);PS(x(1),x(6))*x(3)-BDR*x(3);PS(x(1),x(6))*x(3)-BDR*x(3);SPC*x(5)-SRB(x(1),x(4))*SC*x(2)*x(5);PS(x(1),x(6))*SHC*x(3)*x(6)-SPC*x(5);SRB(x(1),x(4))*SC*x(2)*x(4)-PS(x(1),x(6))*SHC*x(2)*x(6);]
end function

SRB and PS are other functions, with the structure 

function answer=SRB(i,y)
V=0.528;
KmC=0.22;
KmP=0.0002;
KmN=0.02;
KmS=3;
PN=16;
PC=106;
KmSH=3;
answer=((V*i)/(KmP+i))*(i/((KmN/PN)+i))*(i/((KmC/PC)+i))*(y/(KmS+y));
return 
endfunction

 and 

function answer=PS(i,w)
V=0.528;
KmC=0.22;
KmP=0.0002;
KmN=0.02;
KmSH=3;
PC=106;
PN=16;
answer=((V*i)/(KmP+i))*(i/((KmN/PN)+i))*(i/((KmC/PC)+i))*(w/(KmSH+w));
return
endfunction

Can anyone point me in the direction of where the conflict is?

Thanks!



--
View this message in context: 
http://octave.1599824.n4.nabble.com/lsode-inconsistent-sizes-error-tp4667267.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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