フィルターのクリア

To know the units of t span used in ode45 command

5 ビュー (過去 30 日間)
Saraswathi S
Saraswathi S 2021 年 7 月 22 日
コメント済み: Saraswathi S 2021 年 7 月 22 日
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 件のコメント
James Tursa
James Tursa 2021 年 7 月 22 日
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
Saraswathi S 2021 年 7 月 22 日
Thank you so much Sir

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

採用された回答

Yongjian Feng
Yongjian Feng 2021 年 7 月 22 日
You can type this in the matlab command line window:
help ode45
to get help for ode45 function.
The first input argument is a function handler. This is the function that tells you what t means. In other words, whatever unit of t is used in the function handler, it is also used in the tspan.
Does it make sense?
Thanks,
Yongjian
  1 件のコメント
Saraswathi S
Saraswathi S 2021 年 7 月 22 日
Yes, Thank you so much Sir

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

その他の回答 (1 件)

Steven Lord
Steven Lord 2021 年 7 月 22 日
There is no unit inherent to the t variable used by ode45. Just implement your ODE function correctly for your time units.
If you're solving a physics problem and using standard gravity you should formulate it in seconds.
If you were modeling a predator-prey system using the Lotka-Volterra equations then your time units would probably be years.
  1 件のコメント
Saraswathi S
Saraswathi S 2021 年 7 月 22 日
Okay Sir. Thank you so much.

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

カテゴリ

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