ODE discrete variable problem
Mostrar comentarios más antiguos
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
Respuestas (1)
Bjorn Gustavsson
el 26 de Jul. de 2011
0 votos
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
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!