ode23s problem with input arguments

조회 수: 1 (최근 30일)
Matthew Tom
Matthew Tom 2019년 3월 2일
댓글: Asad Mirza 2019년 3월 2일
I always seem to have difficulty understanding how to arrange input arguments for a system with two differential equations.
The error codes that I am receiving are that I have
1) Too many input arguments
2) Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
3) Error in ode23s (line 121) = odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Thank you for the help and I wish to understand how to debug this error.

채택된 답변

Asad Mirza
Asad Mirza 2019년 3월 2일
편집: Asad Mirza 2019년 3월 2일
A very trivial mistake. ODE45 requires that the inputs to your function be both t and Y, even if you never plan on using t.
%This function computes the concentration of reactant A and temperature
%profile of an endothermic CSTR.
function r = CSTRHW4(t,Y)
%% stuff
end
Also it is highly suggested you do not use
clear all
Instead, just use the normal clear. Calling clear all decreases code performance, and is usually unnecessary. For more information, see the Tips section.

추가 답변 (1개)

Matthew Tom
Matthew Tom 2019년 3월 2일
Thank you so much for your time! I always feel obligated to correct those nitpicky error messages that are displayed, especially those that say, "the variable isn't being used."
  댓글 수: 1
Asad Mirza
Asad Mirza 2019년 3월 2일
Ah yes I know those well. Even though MATLAB is intelligent sometimes at the end of the day we have to make the judgement call on its suggestions. In this case it was one where ignoring MATLAB's suggestions would have saved you some time.
Glad to see your issue was fixed!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by