-
-
Notifications
You must be signed in to change notification settings - Fork 232
Closed
Description
Here's an MWE:
using ModelingToolkit
@variables beta, alpha, delta
@variables x1, x2, x3
# expression
tmp = beta * (alpha * exp(x1) * x2 ^ (alpha - 1) + 1 - delta) / x3
# derivative w.r.t. x1 and x2
t1 = ModelingToolkit.gradient(tmp, [x1, x2])
# notice that there are one() functions even after running simplify_constants
julia> t1
2-element Array{Operation,1}:
beta * x2 ^ (alpha - 1) * alpha * exp(x1) * (one(beta * ((alpha * exp(x1) * x2 ^ (alpha - 1) + 1) - delta)) / x3)
beta * alpha * exp(x1) * (alpha - 1) * x2 ^ ((alpha - 1) - 1) * (one(beta * ((alpha * exp(x1) * x2 ^ (alpha - 1) + 1) - delta)) / x3)
# AND HERE GOES THE ERROR MESSAGE
julia> ModelingToolkit.gradient(t1[1], [beta])
ERROR: MethodError: no method matching derivative(::typeof(one), ::Tuple{Operation}, ::Val{1})
Metadata
Metadata
Assignees
Labels
No labels