From: Giano on
I imagine something is wrong, but i could really not get what...

the error is:

--------------------------------------------------------------------------
??? Error using ==> odearguments at 110
HSR.

Error in ==> ode15s at 228
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0,
odeArgs, odeFcn, ...

Error in ==> prova at 51
[t,x] = ode15s(@HSR,tspan,x0,options);
------------------------------------------------------------------------------

and the code is:

-------------------------------------------------------------------------------
x0=[10; 100; 10; 100; 10; 100; 10; 100; 10; 100; Proteint; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...
RNAPt; s70t; 100; 100; 100; 100; 100; 100];

tspan = [0 400];

M1=eye(23);
M2=zeros(23,8);
M3=zeros(8,31);

M=[M1 M2; M3];

options = odeset('Mass',M,'RelTol',1e-6,'Vectorized','on');

[t,x] = ode15s(@HSR,tspan,x0,options);

plot(t,x)
------------------------------------------------------------------------------------
function out=HSR(t,x)

out=[ktr1.*x(20,:)-kmRna.*x(1,:)
kTL.*x(1,:)-kprot.*x(2,:)
ktr2.*x(20,:)-kmRna.*x(3,:)
kTL.*x(3,:)-kprot.*x(4,:)
ktr3.*x(20,:)-kmRna.*x(5,:)
kTL.*x(5,:)-kprot.*x(6,:)
ktr4.*x(20,:)-kmRna.*x(7,:)
kTL.*x(7,:)-kprot.*x(8,:)
ktr5.*x(21)-kmRna.*x(9)
kTL*0.35.*x(9,:)-kprot.*x(26,:)-kFtsh.*x(15,:)-0.5.*x(17,:)-0.7.*x(18,:)
kfold.*x(19,:)-75.*x(11,:)
K1.*x(25,:).*x(24,:)
K2.*x(26,:).*x(24,:)
K3.*x(24,:)*Dt
K4.*x(16,:).*x(28,:)
K5.*x(26,:).*x(27,:)
K6.*x(16,:).*x(30,:)
K7.*x(26,:).*x(29,:)
K8.*x(31,:).*x(27,:)
K9.*x(13,:)*pht./(1+K9.*x(13,:))
K10.*x(12,:)*pgt./(1+K10.*x(12,:))
K11.*x(12,:)*Dt
K12.*x(13,:)*Dt
x(24,:)+x(12,:)+x(13,:)+x(14,:)+x(20,:)+x(21,:)+x(22,:)+x(23,:)-RNAPt
x(25,:)+x(12,:)+x(21,:)+x(22,:)-s70t
x(26,:)+x(17,:)+x(13,:)+x(23,:)+x(15,:)+x(16,:)+x(20,:)+x(18,:)-x(10,:)
x(27,:)+x(15,:)+x(16,:)+x(19,:)+x(17,:)-x(2,:)
x(28,:)+x(15,:)-x(4,:)
x(29,:)+x(18,:)-x(8,:)
x(30,:)+x(17,:)-x(6,:)
x(31,:)+x(11,:)+x(19,:)-Proteint];
---------------------------------------------------------------------------------------------

Anyone?
From: Michael on
I haven't used the 'vectorize' option in particular, however ode functions usually expect the return values to be column vectors, i.e. dim(x0)x1 (for non-vectorized calls).

So for vectorized version, I would expect the correct return dimension for the HSR function to be dim(x0)xdim(t). Can you try to transpose the out variable before returning?

Regards, Michael
From: Giano on
@ "Michael "

thanks for your fast replay, but i don't think that vectorization is an issue... just to let you understand, if i comment part of the model function (let's say the algebraic part of it), the error just doesn't pop up...
From: Steven_Lord on


"Giano " <fasbender(a)gmail.com> wrote in message
news:i2kalo$jgr$1(a)fred.mathworks.com...
> I imagine something is wrong, but i could really not get what...
>
> the error is:
>
> --------------------------------------------------------------------------
> ??? Error using ==> odearguments at 110
> HSR.
>
> Error in ==> ode15s at 228
> [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0,
> odeArgs, odeFcn, ...
>
> Error in ==> prova at 51
> [t,x] = ode15s(@HSR,tspan,x0,options);
> ------------------------------------------------------------------------------

I don't think this is the full text of the error message -- can you show the
_whole_ error instead of the last piece?

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

From: Giano on
@ Steven_Lord

the error message is just that...