Skip to content

Commit e01456a

Browse files
Remove Derivative export
Should only used when explicitly extending to new functions.
1 parent 1fae6e6 commit e01456a

File tree

5 files changed

+4
-24
lines changed

5 files changed

+4
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ t = Parameter(:t)
269269
x = Unknown(:x, dependents = [t])
270270
y = Unknown(:y, dependents = [t])
271271
z = Unknown(:z, dependents = [t])
272-
D = Differential(t) # Default of first derivative, Derivative(t,1)
272+
D = Differential(t)
273273
σ = Parameter()
274274
ρ = Parameter()
275275
β = Parameter()

src/differentials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ function calculate_jacobian(eqs,vars)
7979
Expression[Differential(vars[j])(eqs[i]) for i in 1:length(eqs), j in 1:length(vars)]
8080
end
8181

82-
export Differential, Derivative, expand_derivatives, @Deriv, calculate_jacobian
82+
export Differential, expand_derivatives, @Deriv, calculate_jacobian

test/basic_variables_and_operations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using Test
33

44
@Param t σ ρ β
55
@Unknown x(t) y(t) z(t)
6-
@Deriv D'~t # Default of first derivative, Derivative(t,1)
6+
@Deriv D'~t
77
@Const c=0
88

99
# Default values

test/derivatives.jl

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ dcsch = D(csch(t))
1515
# Chain rule
1616
dsinsin = D(sin(sin(t)))
1717
@test expand_derivatives(dsinsin) == cos(sin(t))*cos(t)
18-
# Binary
19-
dpow1 = Derivative(^, (x, y), Val(1))
20-
dpow2 = Derivative(^, (x, y), Val(2))
21-
@test dpow1 == y*x^(y-1)
22-
@test dpow2 == x^y*log(x)
2318

2419
d1 = D(sin(t)*t)
2520
d2 = D(sin(t)*cos(t))
@@ -45,18 +40,3 @@ jac = ModelingToolkit.calculate_jacobian(sys)
4540
@Unknown a(t) b(a)
4641
@test D(b) Constant(0)
4742

48-
49-
# Regression test for PR #84
50-
let
51-
# Define some variables
52-
@Param t σ ρ β
53-
@Unknown x(t) y(t) z(t)
54-
55-
f(x,y,z) = z*x+y
56-
# This used to seg fault, now raises MethodError
57-
@test_throws MethodError Derivative(f, x, 1)
58-
@Deriv D'~t
59-
op = expand_derivatives(D(f(x,y,z)))
60-
op.args[1].args[2].name == :z
61-
op.args[1].args[2].diff.x.name == :t
62-
end

test/system_construction.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using Test
44
# Define some variables
55
@Param t σ ρ β
66
@Unknown x(t) y(t) z(t)
7-
@Deriv D'~t # Default of first derivative, Derivative(t,1)
7+
@Deriv D'~t
88
@Const c=0
99

1010
# Define a differential equation

0 commit comments

Comments
 (0)