hgrecco / numbakit-ode

Leveraging numba to speed up ODE integration
Other
68 stars 3 forks source link

What should be the signature of the rhs #6

Open hgrecco opened 4 years ago

hgrecco commented 4 years ago

There are two right-hand side functions

  1. user_rhs: provided by the user to the Solver
  2. step_rhs: provided by the Solver to step

There are (at least) 3 different signatures:

def simple(t: float, y: ndarray_1d) -> ndarray_1d:
    pass

def with_args(t: float, y: ndarray_1d, *args) -> ndarray_1d:
    pass

def with_p(t: float, y: ndarray_1d, p: ndarray) -> ndarray_1d:
    pass
  1. Might not need recompilation of step (in the future)
    • simple
    • with_p (if p is always the same, i.e. a 1d vector)
  2. Provide greater flexibility
    • with_args
    • with_p