Current behavior
ExaModels provides @register_univariate and @register_bivariate for registering custom scalar operators with user-supplied derivatives. There is no equivalent for functions of 3 or more scalar arguments.
New feature
A @register_multivariate(f, n, grad!, hess!) macro (or equivalent) that registers an n-argument scalar function with explicitly provided gradient and Hessian:
# f(x₁, ..., xₙ) -> scalar
# grad!(g, x₁, ..., xₙ) fills the n-vector of partial derivatives
# hess!(H, x₁, ..., xₙ) fills the n×n lower-triangular Hessian
Personal Motivation
My primary use case is embedding external physics "black-box" simulators (e.g., MuJoCo MJX, Dojo) into ExaModels problems: x_{t+1} - f(x_t, u_t) = 0 with available Jacobians and Hessians.
Current behavior
ExaModels provides
@register_univariateand@register_bivariatefor registering custom scalar operators with user-supplied derivatives. There is no equivalent for functions of 3 or more scalar arguments.New feature
A
@register_multivariate(f, n, grad!, hess!)macro (or equivalent) that registers ann-argument scalar function with explicitly provided gradient and Hessian:Personal Motivation
My primary use case is embedding external physics "black-box" simulators (e.g., MuJoCo MJX, Dojo) into ExaModels problems:
x_{t+1} - f(x_t, u_t) = 0with available Jacobians and Hessians.