Is it possible to terminate ode45 once a certain condition is met during integration?
7 ビュー (過去 30 日間)
古いコメントを表示
Hi, I'm working on a problem where I'm integrating a state position vector [x y z]'. and I want the output of the first line where my x value is below a certain tolerance. Is there a way to incorporate a line in my equations of motion that will tell the ode45 function to stop and give me the last calculated values?
0 件のコメント
回答 (1 件)
Babak
2013 年 3 月 20 日
to stop the integration you need to define an "event" function. Loop up ODE45 documentation and see how you can define the event function as an option to the ODE45 integrator.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!