diabayes.solver.ODESolver.solve_forward#

ODESolver.solve_forward(t: Float[Array, 'Nt'], y0: Variables, params: RSFParams | CNSParams, friction_constants: RSFConstants | CNSConstants, block_constants: SpringBlockConstants | InertialSpringBlockConstants, method: str = 'RK45', interpolate_time: bool = True) Variables[source]#

Solve a forward problem using SciPy’s solve_ivp routine. While this routine doesn’t propagate any gradients, it is much faster to initialise and to perform a single forward run. Hence for playing around with different parameters, it is preferred over a JITed JAX implementation.

Parameters:
  • t (Float[Array, "Nt"]) – A vector of time samples where a solution is requested.

  • y0 (Variables) – The initial values (fricton and state) wrapped in a Variables container.

  • params (_Params) – The (invertible) parameters that govern the dynamics, wrapped in a Params container.

  • friction_constants (_Constants) – A container object containing the friction constants

  • block_constants (_BlockConstants) – A container object containing the block constants

  • method (str) – The solver used by SciPy’s solve_ivp. Default: RK45

  • interpolate_time (bool) – Whether to interpolate the result to the user-provided time samples (True), or to use the samples from the adaptive ODE solver (False). Default: True

Returns:

result – Solution time series of friction and state

Return type:

Variables