Effacer les filtres
Effacer les filtres

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 vues (au cours des 30 derniers jours)
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

Réponse acceptée

Pavel Osipov
Pavel Osipov le 5 Oct 2019
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');

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by