solve first-order ODE

16 ビュー (過去 30 日間)
Vicky Deng
Vicky Deng 2020 年 10 月 14 日
編集済み: madhan ravi 2020 年 10 月 14 日
Hi,
i tried to solve this first-order ode problem but it keeps show "Unable to find symbolic solution"
here is my code:
ode = diff(y,t) == sin( exp(y - t/2) - t^2/2 );cond = y(0) == 0;ySol(t) = dsolve(ode,cond)
ySol(10)
thanks a lot!

回答 (2 件)

madhan ravi
madhan ravi 2020 年 10 月 14 日
編集済み: madhan ravi 2020 年 10 月 14 日
ode = @(t, Y) sin( exp(Y - t/2) - t^2/2 )
ode45(ode, [0 2*pi], 0)

Ameer Hamza
Ameer Hamza 2020 年 10 月 14 日
編集済み: Ameer Hamza 2020 年 10 月 14 日
It means that MATLAB is unable to find a closed-form solution to your ODE. It might be the case that such a solution does not exist in terms of elementary functions. You need to use a numerical solution
IC = 0;
tspan = [0 10];
[t, y] = ode45(@odefun, tspan, IC);
plot(t, y, '-o')
function dydt = odefun(t, y)
dydt = sin(exp(y - t/2) - t^2/2);
end

カテゴリ

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