Numerical integration "backwards" for ODE45

36 vues (au cours des 30 derniers jours)
Amirah Algethami
Amirah Algethami le 19 Déc 2022
Commenté : Amirah Algethami le 19 Déc 2022
Hi There;
I should apply Backword integration for system of differential equation by ODE45 solver in Matlab, it seems easy for some people, I want an example to understand how to make Backword integration. your answer appreciated.
Best
AA

Réponse acceptée

Torsten
Torsten le 19 Déc 2022
fun = @(t,y) y;
tspan = [0 1];
y0 = 1;
[Tf,Yf] = ode45(fun,tspan,y0);
tspan = [1 0];
y0 = exp(1);
[Tb,Yb] = ode45(fun,tspan,y0);
plot(Tf,Yf,Tb,Yb)
  1 commentaire
Amirah Algethami
Amirah Algethami le 19 Déc 2022
thanks. more clear for me.

Connectez-vous pour commenter.

Plus de réponses (1)

Fabio Freschi
Fabio Freschi le 19 Déc 2022
  3 commentaires
Fabio Freschi
Fabio Freschi le 19 Déc 2022
@Torsten already reported an example. I still warn you to pay attention to integrate backwards because in some cases you may have numerica blowup
Amirah Algethami
Amirah Algethami le 19 Déc 2022
thanks , I hoping that not will happen with my equations.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by