Skip to content

Commit 073e645

Browse files
committed
Add test
1 parent 26fc511 commit 073e645

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/derivatives.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,13 @@ isequal(ModelingToolkit.derivative(Operation(+, [x*y, y, z]), 1), 1)
7272
Expression[ModelingToolkit.Constant(1) ModelingToolkit.Constant(0)
7373
Differential(t)(x) ModelingToolkit.Constant(1)
7474
ModelingToolkit.Constant(0) ModelingToolkit.Constant(0)])
75+
76+
# issue 252
77+
@variables beta, alpha, delta
78+
@variables x1, x2, x3
79+
80+
# expression
81+
tmp = beta * (alpha * exp(x1) * x2 ^ (alpha - 1) + 1 - delta) / x3
82+
# derivative w.r.t. x1 and x2
83+
t1 = ModelingToolkit.gradient(tmp, [x1, x2])
84+
@test_nowarn ModelingToolkit.gradient(t1[1], [beta])

0 commit comments

Comments
 (0)