필터 지우기
필터 지우기

Help using ode45 to solve 3rd order ODE

조회 수: 19 (최근 30일)
AJD
AJD 2020년 11월 6일
댓글: Ameer Hamza 2020년 11월 6일
I'm having trouble figuring out how to use the ode45 funciton in MATLAB to solve the following 3rd order ODE:
F''' + F*F'' = 0
With initial conditions F(0) = 0, F'(0) = 1, F''(inf) = 0, and F''(0) = -0.6276.
I am new to the ode45 function, and any help would be greatly appreciated

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 11월 6일
Convert your 3rd order ODE into a system of 3-first order ODEs
IC = [0; 1; -0.6276];
tspan = [0 10];
[t, y] = ode45(@odefun, tspan, IC);
plot(t, y);
legend({'$F$', '$\dot{F}$', '$\ddot{F}$'}, 'FontSize', 16, 'Interpreter', 'latex', 'Location', 'best')
function dFdt = odefun(t, F)
dFdt = zeros(3, 1);
dFdt(1) = F(2);
dFdt(2) = F(3);
dFdt(3) = -F(1)*F(3);
end
  댓글 수: 2
David Goodmanson
David Goodmanson 2020년 11월 6일
Hi AJD,
Ameer's answer, while correct, does not say anything about the fact that you have a third order differential equation and four boundary conditions. That's one too many conditions, and overspecifies the problem. So you had better hope that if you use the three initial conditions at t=0, the answer will automatically end up with f''(inf) = 0. Fortunately, it does.
Ameer Hamza
Ameer Hamza 2020년 11월 6일
Correct. This was just a coincidence. This equation can only have 3 boundary conditions.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by