Create Hybrid Systems
Datseris opened this issue · comments
Hybrid systems are a special type of dynamical system that switches between being continuous and discrete. An example could be the bouncing ball.
It will probably be a tiny bit tricky to implement them, but it has to be made as general as possible.
One need to have 2 equations of motion, one for continuous and one for discrete. Then a callback type function has to be created that will stop the ODE solving of DifferentialEquations
and switch to discrete evolution (until some other kind of callback stops or for a specified amount of steps... implementation will show the best way...).
DifferentialEquations
already does hybrid systems through its event handling interface (and the jump problems help here as well). In fact, the bouncing ball is the documentation example: http://docs.juliadiffeq.org/latest/features/callback_functions.html#ContinuousCallback-Examples-1
Yeap that was exactly what I was looking at when I wrote this issue. The bouncy ball.
One would most likely make a new type, subtype of ContinuousDynamicalSystem
that would work exactly like ContiniousDS
with simply an extra field called "callback" or something.
The this would allow pretty clear and straight forward communication with DiffEq, since to establish this the only thing necessary is to have a ODEProblem(ds::DynamicalSystem)
method.
Or you just add a callback keyword to your ContiniousDS
?
So that the field callback
would always exist but by default would be initialized in e.g. nothing
? Does the ODE handle nothing? How is the representation of missing callbacks?
It handles nothing by using no callbacks. That's the default.
Yeap. Awesome, this seems like the best idea! To add an extra field to ContinuousDS
!
But wait a moment. This does not allow the motion to turn fully discrete until another second callback, right?
I mean, a problem becoming fully discrete, then after some condition becomes continuous again?
This issue was moved to JuliaDynamics/DynamicalSystemsBase.jl#5