Setting up ODE Event Function

1 回表示 (過去 30 日間)
Jestoni Orcejola
Jestoni Orcejola 2020 年 8 月 13 日
回答済み: Alan Stevens 2020 年 8 月 13 日
Hi I am new to using the ODE function. One of the things I would like to do is trigger an event one a parameter has been met and then run another iteration.
For example, I have an object falling at an initial height, and once the object reach a certain height I want the object to fly back up. So here is my equation:
depth =v(1)
speed = [v(2); (rho*V*g/(m+V*rho))-(m*g/(m+V*rho))-((1/(2*m+V*rho)*Cd*A.*rho.*v(2).^2))];
How would I set this up?
Thanks

回答 (1 件)

Alan Stevens
Alan Stevens 2020 年 8 月 13 日
Search
ODE Event Location
in the Matlab documentation to see an example (similar to yours) of how to do it.

カテゴリ

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