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!