Error in Ode23 line 114

조회 수: 12 (최근 30일)
JYOTI PRAKASH BEHERA
JYOTI PRAKASH BEHERA 2020년 11월 9일
답변: Stephan 2020년 11월 9일
Error in odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
error in [tsol,hsol] =ode23(@(t,h) TnkODE(t,h), [0 2000],[5 5]);
Please Help
The code::
[tsol,hsol] =ode23(@(t,h) TnkODE(t,h), [0 2000],[5 5]);
function Diff=TnkODE(t,h)
h1=h(1); h2=h(2); % given values F0=3 Beta1=0.75, Beta2=1 A1=A2=0.5 are used futher in the equation
Diff(1)=6- 1.5*(h1-h2)^0.5 ; % h1'= F0/A1 - [(4/A1) (h1-h2)^.5]
Diff(2)=1.5*(h1-h2)^0.5 - 2*(h2)^0.5; % h2'= [(Beta1/A2) (h1-h2)^.5 ]- (Beta2/A2)h2^0.5
end

채택된 답변

Stephan
Stephan 2020년 11월 9일
[tsol,hsol] =ode23(@(t,h) TnkODE(t,h), [0 2000],[5 5]);
plot(tsol,hsol)
function Diff=TnkODE(~,h)
h1=h(1); h2=h(2); % given values F0=3 Beta1=0.75, Beta2=1 A1=A2=0.5 are used futher in the equation
Diff = zeros(2,1);
Diff(1)=6- 1.5*(h1-h2).^0.5 ; % h1'= F0/A1 - [(4/A1) (h1-h2)^.5]
Diff(2)=1.5*(h1-h2).^0.5 - 2*(h2).^0.5; % h2'= [(Beta1/A2) (h1-h2)^.5 ]- (Beta2/A2)h2^0.5
end

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by