Open baggepinnen opened 2 years ago
In the example below, the unknown derivative of the registered function fun is completely ignored in the jacobian,
fun
using Symbolics @variables t x[1:2] @register fun(x::Symbolics.Arr, t) xp = fun(x, x[1]) ex = [xp^2] Symbolics.jacobian(ex, [x]) julia> Symbolics.jacobian(ex, [x]) 1×1 Matrix{Num}: 0
However, if I do the same thing with scalars, it produces the desired results.
@variables x @register fun(x) xp = fun(x) ex = [xp^2] Symbolics.jacobian(ex, [x]) julia> Symbolics.jacobian(ex, [x]) 1×1 Matrix{Num}: 2fun(x)*Differential(x)(fun(x))
┆Issue is synchronized with this Trello card by Unito
This issue can currently be worked around by the manual registering of https://github.com/JuliaSymbolics/Symbolics.jl/pull/445/files#diff-e7ba25de6eb72839907438ab2ca39a49fdd7025e031c7b6c95ad1a6842e1e613R74-R84
In the example below, the unknown derivative of the registered function
fun
is completely ignored in the jacobian,However, if I do the same thing with scalars, it produces the desired results.
┆Issue is synchronized with this Trello card by Unito