Skip to contents

The wrappers fix all but one argument of a problem function, as SciMLBase's differentiation helpers: UJacobianWrapper(f, t, p)(u) and UDerivativeWrapper(f, t, p)(u) are f(u, p, t), ParamJacobianWrapper(f, t, u)(p) is f(u, p, t), TimeGradientWrapper(f, u, p)(t) and TimeDerivativeWrapper(f, u, p)(t) are f(u, p, t), and JacobianWrapper(f, p)(u, t) is f(u, p, t). unwrapped_f(f) returns the R function of an ODEFunction (or f itself).

Usage

UJacobianWrapper(f, t, p)

UDerivativeWrapper(f, t, p)

ParamJacobianWrapper(f, t, u)

TimeGradientWrapper(f, u, p)

TimeDerivativeWrapper(f, u, p)

JacobianWrapper(f, p)

unwrapped_f(f)

has_jac(f)

has_tgrad(f)

has_paramjac(f)

has_jvp(f)

has_vjp(f)

has_vjp_p(f)

has_observed(f)

has_sys(f)

has_symbolic_idxs(f)

has_initialization_data(f)

has_initializeprob(f)

has_init(alg)

has_step(alg)

has_reinit(alg)

has_stats(alg)

has_lazy_interpolation(alg)

allows_arbitrary_number_types(alg)

allows_late_binding_tstops(alg)

allows_non_wiener_noise(alg)

allowscomplex(alg)

requires_additive_noise(alg)

isdenseplot(sol)

has_global_error(alg)

allowsconsjvp(alg)

allowsconsvjp(alg)

allowsfg(alg)

allowsfgh(alg)

requiresconsjvp(alg)

requiresconsvjp(alg)

requireslagh(alg)

supports_opt_cache_interface(alg)

is_diagonal_noise(prob)

isconcreteu0(prob, ...)

problem_type(prob)

last_step_failed(integ)

done(integ)

check_error(integ)

Arguments

f

A problem function (or problem).

t, p, u

Fixed arguments.

alg

An algorithm.

sol

A solution.

prob

A problem.

...

Unused.

integ

An integrator.

Value

A function, or a flag.

Details

Traits of problem functions: has_jac, has_tgrad, has_paramjac, has_jvp, has_vjp, has_vjp_p, has_observed, has_sys, has_symbolic_idxs, has_initialization_data, has_initializeprob. Traits of algorithms: has_init, has_step, has_reinit, has_stats, has_lazy_interpolation, allows_arbitrary_number_types, allows_late_binding_tstops, allows_non_wiener_noise, allowscomplex, requires_additive_noise, isdenseplot, has_global_error; and of optimizers allowsconsjvp, allowsconsvjp, allowsfg, allowsfgh, requiresconsjvp, requiresconsvjp, requireslagh, supports_opt_cache_interface. Of problems: is_diagonal_noise, isconcreteu0, problem_type. Of integrators: last_step_failed, done, check_error (the return code the integrator would stop with).

Examples

g <- UJacobianWrapper(function(u, p, t) -p * u, 0, 2)
g(3)
#> [1] -6
has_jac(ODEFunction(function(u, p, t) -u))
#> [1] FALSE