ODE discrete variable problem
古いコメントを表示
Hi all, I have a system of ODEs with a (non-negative) variable, V, that can be modelled continuously. All good up to here, but since V is actually a discrete variable, when its value is below 1 we crucially need it to be set to zero. Since the ODE solvers only output the complete solution of V at the end, and you can't manipulate the solution's values as the system is being integrated, I can't find a way to implement this condition. Any ideas? Many thanks,
Mark
回答 (1 件)
Bjorn Gustavsson
2011 年 7 月 26 日
0 投票
Maybe you can get by by using the events field sent to the ode-integrating function. That is what is used for example to calculate the trajectory of bouncing balls in ballode.m. Maybe you can use that to modify your solution and keep integrating or just terminate when V reaches 0 and restart the integration from that time with the modified solution as initial condition.
HTH
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!