To know the units of t span used in ode45 command
Afficher commentaires plus anciens
I am using ODE45 command to solve 8 ordinary differential equations. My doubt is if im specifying tspan=[0 1000] , what will be the units of time like is it in seconds, minutes, hours?
code:
tspan=[0 1000];
yo=[1;2;3;4;5;6;7;8;9];
[tsol,ysol]=ode45(@filename,tspan,yo];
2 commentaires
James Tursa
le 22 Juil 2021
The units of tspan is dictated by how you formulate your differential equation in the function handle. ode45( ) doesn't assume or know anything about units.
Saraswathi S
le 22 Juil 2021
Réponse acceptée
Plus de réponses (1)
Steven Lord
le 22 Juil 2021
2 votes
There is no unit inherent to the t variable used by ode45. Just implement your ODE function correctly for your time units.
If you were modeling a predator-prey system using the Lotka-Volterra equations then your time units would probably be years.
1 commentaire
Saraswathi S
le 22 Juil 2021
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!