How do i solve non linear DE in matlab

9 ビュー (過去 30 日間)
Ashvin Bhat
Ashvin Bhat 2022 年 2 月 10 日
回答済み: Abraham Boayue 2022 年 2 月 11 日
  4 件のコメント
AndresVar
AndresVar 2022 年 2 月 11 日
編集済み: AndresVar 2022 年 2 月 11 日
you can try using
ySol(t) = dsolve(ode,cond,'implicit',true)
It gives the same solution as in wolfram alpha. It is a separable first order nonlinear ODE.
Also see you can try ode45 to get numerical solution:
Ashvin Bhat
Ashvin Bhat 2022 年 2 月 11 日
I got this, I don't understand how special cases is causing a problem here since its only a DE which has to be solved, analytical constraints maybe reasonable but since we have given a condition for the DE and have no arbitrary constants it shouldn't be a problem. Can you help me out with the ode45 part?

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

採用された回答

Abraham Boayue
Abraham Boayue 2022 年 2 月 11 日
%Here is the required ode45 code.
clear variables
close all
xspan = [0 10];
y0 = 1;
[t,y] = ode45(@(x,y)x.*y.^5+x.*cos(y), xspan, y0);
plot(t,y,'linewidth',2.5)
a = title('y(x) from ode45');
set(a,'fontsize',14);
a = ylabel('y');
set(a,'Fontsize',14);
ylim( [0 10]);
grid

その他の回答 (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