Daniel
2010-10-04 14:26:05 UTC
Hi there,
I'm trying to solve a DAE system of the following form:
M=diag([1 1 1 1 1 1 0 0 0 0]);
options=odeset('Mass',M);
[t,sol]=ode15s(@fun,tspan,x0,options)
function d_dt=fun(t,x)
c1=... some expression
c2=...
c3=...
c4=...
c5=...
c6=...
res7=c7+c8
res8=c1*c7
res9=parameter/(c1+c2+c3)*c7
res10=parameter/(c1+c2+c3)*c8
d_dt=[c1 c2 c3 c4 c5 c6 res7 res8 res9 res10 ]
I get the error message:
###################################################################
??? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> daeic12 at 62
F = UM' * f;
Error in ==> ode15s at 395
[y,yp,f0,dfdy,nFE,nPD,Jfac] = daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,...
###################################################################
So question 1:
What is this error about???
question 2:
What does the option 'Vectorized', 'On' mean and could it help in this case?
Thanks for your help in advance!
I'm trying to solve a DAE system of the following form:
M=diag([1 1 1 1 1 1 0 0 0 0]);
options=odeset('Mass',M);
[t,sol]=ode15s(@fun,tspan,x0,options)
function d_dt=fun(t,x)
c1=... some expression
c2=...
c3=...
c4=...
c5=...
c6=...
res7=c7+c8
res8=c1*c7
res9=parameter/(c1+c2+c3)*c7
res10=parameter/(c1+c2+c3)*c8
d_dt=[c1 c2 c3 c4 c5 c6 res7 res8 res9 res10 ]
I get the error message:
###################################################################
??? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> daeic12 at 62
F = UM' * f;
Error in ==> ode15s at 395
[y,yp,f0,dfdy,nFE,nPD,Jfac] = daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,...
###################################################################
So question 1:
What is this error about???
question 2:
What does the option 'Vectorized', 'On' mean and could it help in this case?
Thanks for your help in advance!