Using ode15s to solve daes and lsqcurvefit to fit a curve

1 vue (au cours des 30 derniers jours)
Dursman Mchabe
Dursman Mchabe le 12 Jan 2019
Hello everyone,
I am trying to use ode15s to solve 4 daes,and using lsqcurvefit to fit the curve. The attached code gives an error message:
Index exceeds the number of array elements (1).
Error in ODE15sMethod>f (line 67)
daes = [(c(1)./c(2)).*((1930.65./1000000)- (x(1,:) .*c(3) .*c(4) ./ 875000 )) - (x(1,:).* c(3).* c(4) - c(6).* ((x(2,:).* x(4,:).^2)./(x(4,:).^2 + c(7).* x(4,:) +
c(7).* c(8))))./((1./c(12)) + c(6)./((1 + c(9).* ((c(7).* c(6).* x(1,:).* c(3).* c(4) ./ x(3,:)) - ((x(2,:).* c(7).* x(4,:))./(x(4,:).^2 + c(7) .* x(4,:) + c(7)
.*c(8))))./2.85E-09.* ((c(6).* x(1,:).* c(3).* c(4)) - ((x(2,:).* x(4,:).^2)./(x(4,:).^2 + c(7).* x(4,:) + c(7).* c(8)))) + c(11).* ((c(8).* c(7).* c(6).* x(1,:).*
c(3).* c(4) ./ (x(3,:)).^2) - ((x(2,:).* c(7).* c(8))./(x(4,:).^2 + c(7) .* x(4,:) + c(7) .*c(8))))./ 2.85E-09.* ((c(6).* x(1,:).* c(3).* c(4)) - ((x(2,:).*
x(4,:).^2)./(x(4,:).^2 + c(7).* x(4,:) + c(7).* c(8))))).* c(13)))
Error in odearguments (line 90)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode15s (line 150)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in ODE15sMethod (line 17)
[t,y] = ode15s(@f,tspan,x0,options);
Which is self-explaining, I ran out of ideas on what can I modify. Does anyone have an idea?
Regards

Réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by