(to keep it simple) where x_dot is a Fun
This works fine with Vode, but breaks at compilation with Dopri or Radau.
Why is that ? How to proceed ?
Actually what I need to compute is a Jacobian,
but I only need it for a subsystem of the whole system,
which makes it impossible to pass it as a 'Jacobian' for the integrator.
(what is done in Tutorial_SymbolicJac.py for example)
Alas, aux functions cannot return multiple values unless they are one of the specialized ones for Jacobian or Mass Matrix. Although the code compiles for vode, you are not using the Field function inside of the specs and you would not be syntactically allowed to index the return result, even with Vode.
You are also not making an auxiliary variable that records the value of Field throughout an integration, so there's little benefit in making a C version of the function anyway. You might be best off just making a python version of the function that you call whenever you need it outside of the Generator. Otherwise, I would create all the entries of the vector symbolically and making individual aux fns for each that will work inside your PyDSTool specs. Sorry there's not inherent vectorized support!
Does that help, though?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to define a function
(to keep it simple) where x_dot is a Fun
This works fine with Vode, but breaks at compilation with Dopri or Radau.
Why is that ? How to proceed ?
Actually what I need to compute is a Jacobian,
but I only need it for a subsystem of the whole system,
which makes it impossible to pass it as a 'Jacobian' for the integrator.
(what is done in Tutorial_SymbolicJac.py for example)
My minimal example :
Thanks in advance,
Benjamin
Alas, aux functions cannot return multiple values unless they are one of the specialized ones for Jacobian or Mass Matrix. Although the code compiles for vode, you are not using the Field function inside of the specs and you would not be syntactically allowed to index the return result, even with Vode.
You are also not making an auxiliary variable that records the value of Field throughout an integration, so there's little benefit in making a C version of the function anyway. You might be best off just making a python version of the function that you call whenever you need it outside of the Generator. Otherwise, I would create all the entries of the vector symbolically and making individual aux fns for each that will work inside your PyDSTool specs. Sorry there's not inherent vectorized support!
Does that help, though?