MATLAB Answers

Using ode15s to solve daes and lsqcurvefit to fit a curve

조회 수: 1(최근 30일)
Dursman Mchabe
Dursman Mchabe 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?

  댓글 수: 0

로그인 to comment.

답변 수 (0)

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by