Closed bbbales2 closed 4 years ago
It should be pretty simple to get this working in an experimental manner, without any checks. A bit of reordering of what is done for #451 and that should be it.
EDIT: The only real issue with the reduce_sum code is that it doesnt pickup the calls if they are used inside other function (reduce_sum + reduce_sum for example, as + is the top level function here). I didnt bother too much with it for now, as there were some perf. issues there. But I guess that is also not a huge need for odes for the first examples?
Could we get a prototype for the new ODE stuff similar to what we have for reduce_sum (https://github.com/stan-dev/stanc3/pull/451)? No need for super error checking and whatnot at this point. Just wanna start playing with ODEs in the new interface.
@rok-cesnovar, @rybern , whoever feels like putting it together.
The mission here is similar. Instead of the ODE signature:
with ode right hand side function:
we want (these names are all subject to change I just wanted something short for testing):
where the ode right hand side function looks like:
The real_tol/abs_tol/max_num_steps args are no longer optional with the new form.
The C++ signature of the new ode integrate function is:
An example C++ functor that will work with the new integrator signature is:
Here is an old Stan model (taken from Bob's Lotka-Volterra case study -- https://mc-stan.org/users/documentation/case-studies/lotka-volterra-predator-prey.html):
Here is code that should compile with the new interface:
Here is data for it (this pull has the branch that should run it, but I wouldn't be surprised if it fails -- it's not the most tested: https://github.com/stan-dev/math/pull/1641):