Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Mar 17, 2020
1 parent 26fc511 commit 073e645
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/derivatives.jl
Expand Up @@ -72,3 +72,13 @@ isequal(ModelingToolkit.derivative(Operation(+, [x*y, y, z]), 1), 1)
Expression[ModelingToolkit.Constant(1) ModelingToolkit.Constant(0)
Differential(t)(x) ModelingToolkit.Constant(1)
ModelingToolkit.Constant(0) ModelingToolkit.Constant(0)])

# issue 252
@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])
@test_nowarn ModelingToolkit.gradient(t1[1], [beta])

0 comments on commit 073e645

Please sign in to comment.