hgrecco/numbakit-ode

What should be the signature of the rhs

Opened this issue · 0 comments

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