For many practical pharmacometric models the integrate_ode function is pretty limiting as it only solves the ODE system at given times but cannot modify the system at those times. A more generic function would require events, which pair an event time and some used-defined function that modifies the state of the ODE at that time, for example
This new function then concatenates the vector of observation times and the
event times, removes duplicates, and orders the unique times. The solver is
run to each time, with the resulting state saved if an observation if necessary
and then input to the event functor if necessary.
Thoughts? This would require introducing a type with a method which would
be new to the language. Maybe just having an add_event function with an
event_table and function as arguments?
Issue by betanalpha Thursday May 21, 2015 at 12:40 GMT Originally opened as https://github.com/stan-dev/stan/issues/1454
For many practical pharmacometric models the
integrate_ode
function is pretty limiting as it only solves the ODE system at given times but cannot modify the system at those times. A more generic function would require events, which pair an event time and some used-defined function that modifies the state of the ODE at that time, for exampleThese events would then be collected into a dynamically-sized vector of events,
which would be passed into a new integrate function,
This new function then concatenates the vector of observation times and the event times, removes duplicates, and orders the unique times. The solver is run to each time, with the resulting state saved if an observation if necessary and then input to the event functor if necessary.
Thoughts? This would require introducing a type with a method which would be new to the language. Maybe just having an
add_event
function with anevent_table
and function as arguments?