help-octave
[Top][All Lists]
Advanced

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

a vector of six equations producing seven answers?


From: tessaract87
Subject: a vector of six equations producing seven answers?
Date: Mon, 10 Nov 2014 10:23:48 -0800 (PST)

Hi all,

So, with the model I've been working on, I have a series of six equations,
as described in the following function:

function venus = g(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);]


endfunction

Running lsode on this, I get the error:

 y=lsode(@g,[0.051,0.0056,0.0045,2220,1930,0.625],0:1:10)
venus =

  -2.9798e-03
   2.6690e-03
   3.1072e-04
   3.1072e-04
   1.1121e+01
  -1.1194e+01
   8.4323e-02

error: lsode: inconsistent sizes for state and derivative vectors

Looking at it, however, I noticed the output is producing seven, not six,
numbers- is this where the vector inconsistency error might be coming from?
And if so, where's the extra output coming from?  I've attached all the
files used.

Thanks!
Venus.m <http://octave.1599824.n4.nabble.com/file/n4667313/Venus.m>   PS.m
<http://octave.1599824.n4.nabble.com/file/n4667313/PS.m>   PS.m
<http://octave.1599824.n4.nabble.com/file/n4667313/PS.m>  



--
View this message in context: 
http://octave.1599824.n4.nabble.com/a-vector-of-six-equations-producing-seven-answers-tp4667313.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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