f=@(t,y) 4*exp(0.8*t)-0.5*y; tspan = [0 4]; y0 = 2; h = 1; [t,y] = ode_euler(f,tspan,y0,h)

2 ビュー (過去 30 日間)
reda kriker
reda kriker 2019 年 10 月 5 日
回答済み: Pavel Osipov 2019 年 10 月 5 日
f=@(t,y) 4*exp(0.8*t)-0.5*y;
tspan = [0 4];
y0 = 2;
h = 1;
[t,y] = ode_euler(f,tspan,y0,h)
why this code is not working
  1 件のコメント
darova
darova 2019 年 10 月 5 日
Any chance you can show euler function?

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

採用された回答

Pavel Osipov
Pavel Osipov 2019 年 10 月 5 日
tspan = [0 4];
y0 = 2;
[t1,y1] = ode45(@(t,y) 4*exp(0.8*t)-0.5*y,tspan,y0,h);
figure('name','Reda','color','w');
plot(t1,y1, 'r-','LineWidth',2);grid on;
xlabel('Time');ylabel('Solution y(Time)');
title('And you instead of a blanket substitute solver Euler');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by