Solving 4th order ode using ode45

14 ビュー (過去 30 日間)
Elayarani M
Elayarani M 2020 年 9 月 15 日
コメント済み: Elayarani M 2020 年 9 月 26 日
How to solve the following 4th order ode using ode45 solver
  3 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2020 年 9 月 15 日
...and aren't you missing one boundary-value?
@madhan - perhaps just as "easy" to use shooting method to find a solution that trails of towads flat at infinity?
Elayarani M
Elayarani M 2020 年 9 月 16 日
Thank you. I will try with that method.

サインインしてコメントする。

採用された回答

Alan Stevens
Alan Stevens 2020 年 9 月 15 日
Here's some coding that basically solves the equation. I've no idea what the value of k should really be, but the constants chosen give a consistent result. The choice of f'''(0) is based on the original equation with the other x=0 values plugged in; where f''(0) is a chosen to give a seemingly reasonable result!
k = -0.002;
xspan = [0 100];
d2fdx20 = -1;
F0 = [0 1 d2fdx20 (1-k*(d2fdx20^2))/(1-2*k)];
[x, F] = ode45(@rates, xspan, F0, [], k);
f = F(:,1);
dfdx = F(:,2);
plot(x, f, x, dfdx),grid
xlabel('x'), ylabel('f and dfdx')
legend('f','dfdx')
function dFdx = rates(x,F,k)
f = F(1);
dfdx = F(2);
d2fdx2 = F(3);
d3fdx3 = F(4);
if x==0
d4fdx4 = 0;
else
d4fdx4 = (d3fdx3 +f.*d2fdx2 - dfdx.^2 - 2*k*dfdx.*d3fdx3 + k*d2fdx2.^2)./(k*f);
end
dFdx = [dfdx; d2fdx2; d3fdx3; d4fdx4];
end
  23 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2020 年 9 月 25 日
Did the numerical solution differ by much? If not then perhaps only numerical deviations? Since you have a non-linear ODE there might be many solutions (right?), have you gotten all analytically? If not then the numerical solution might be one of the other valid solutions.
Elayarani M
Elayarani M 2020 年 9 月 26 日
Thank you Bjorn Gustavsson. First I will try to get all analytic solution and then cross check with the numerical solution.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by