Skip to content

Commit c0d90fd

Browse files
Merge pull request #80 from SciML/ChrisRackauckas-patch-1
Explicit add the independent variable
2 parents e88590b + 3278845 commit c0d90fd

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
1010
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1111
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1212
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
13+
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1314

1415
[compat]
1516
DataStructures = "0.17, 0.18"
1617
DiffEqBase = "6.5"
1718
Latexify = "0.11, 0.12, 0.13, 0.14"
1819
ModelingToolkit = "4.0, 5"
1920
Reexport = "0.2, 1.0"
21+
SciMLBase = "1.3"
2022
julia = "1.3"
2123

2224
[extras]

src/ode_def_opts.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},curmod,ex::Expr,param
140140
Wfact_t::TWt
141141
paramjac::Nothing
142142
syms::Vector{Symbol}
143+
indepvar::Symbol
143144
colorvec::Nothing
144145
sys::S
145146
end
@@ -153,6 +154,6 @@ function ode_def_opts(name::Symbol,opts::Dict{Symbol,Bool},curmod,ex::Expr,param
153154
$full_wex
154155

155156
$name($fname,ParameterizedFunctions.LinearAlgebra.I,nothing,$tname,$jname,nothing,nothing,
156-
nothing,nothing,$Wname,$W_tname,nothing,$syms,nothing,$sys)
157+
nothing,nothing,$Wname,$W_tname,nothing,$syms,$(Meta.quot(depvar)),nothing,$sys)
157158
end |> esc
158159
end

test/runtests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ParameterizedFunctions, DiffEqBase
1+
using ParameterizedFunctions, DiffEqBase, SciMLBase
22
using Test, InteractiveUtils, Latexify
33

44
using SpecialFunctions
@@ -11,7 +11,7 @@ f_t = @ode_def SymCheck begin # Checks for error due to symbol on 1
1111
dy = -c*y + d*x*y*t^2
1212
end a b c d
1313

14-
@test DiffEqBase.__has_syms(f_t)
14+
@test SciMLBase.__has_syms(f_t)
1515

1616
f_t2 = @ode_def SymCheck2 begin # Checks for error due to symbol on 1
1717
dx = 1
@@ -62,10 +62,10 @@ f.jac(J,u,p,t)
6262
3.0 -1.0]
6363
@test f.jac(u, p, t) == [-1.5 -2.0; 3.0 -1.0]
6464

65-
@code_llvm DiffEqBase.has_jac(f)
65+
@code_llvm SciMLBase.has_jac(f)
6666

6767
println("Test booleans")
68-
@test DiffEqBase.has_jac(f) == true
68+
@test SciMLBase.has_jac(f) == true
6969

7070
println("Test difficult differentiable")
7171
NJ = @ode_def DiffDiff begin
@@ -95,7 +95,7 @@ f_t_noname = @ode_def begin # Checks for error due to symbol on 1
9595
dy = -c*y + d*x*y*t^2
9696
end a b c d
9797

98-
@test DiffEqBase.__has_syms(f_t_noname)
98+
@test SciMLBase.__has_syms(f_t_noname)
9999

100100
f = @ode_def begin
101101
dx = a*x - b*x*y

0 commit comments

Comments
 (0)