Skip to content

Commit e581738

Browse files
authored
Merge pull request #145 from SciML/update_deps
Update for julia 1.5
2 parents c19a349 + 87afa3f commit e581738

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ os:
55
- linux
66

77
julia:
8-
- 1.3
98
- 1.4
9+
- 1.5
1010
- nightly
1111

1212
jobs:
@@ -15,7 +15,7 @@ jobs:
1515

1616
env:
1717
- GROUP=Standard
18-
#- GROUP=Integration
18+
- GROUP=Integration
1919

2020
notifications:
2121
email: false

Project.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,23 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2121
Compat = "2.2, 3.0"
2222
DSP = "0.6"
2323
DataInterpolations = "3.1"
24-
DiffEqBase = "6.41"
24+
DiffEqBase = "6.45"
2525
FiniteDifferences = "0.9.6, 0.10"
26-
ModelingToolkit = "3.14"
26+
ModelingToolkit = "3.17"
2727
ProximalOperators = "0.11"
28-
QuadGK = "2.3.1"
28+
QuadGK = "2.4"
2929
StatsBase = "0.32.0, 0.33"
30-
julia = "1.3"
30+
julia = "^1.3.0"
3131

3232
[extras]
33+
DiffEqFlux = "aae7a2af-3d4f-5e19-a356-7da93b79d9d0"
34+
DiffEqSensitivity = "41bf760c-e81c-5289-8e54-58b1f1f8abe2"
35+
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
36+
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
37+
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
3338
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
3439
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
3540
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3641

3742
[targets]
38-
test = ["OrdinaryDiffEq", "Test", "SafeTestsets"]
43+
test = ["DiffEqFlux", "DiffEqSensitivity", "Flux", "JLD2", "Optim", "OrdinaryDiffEq", "Test", "SafeTestsets"]

test/applications/partial_lotka_volterra.jl

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ function dudt_(u, p,t)
4949
end
5050

5151
prob_nn = ODEProblem(dudt_,u0, tspan, p)
52-
s = concrete_solve(prob_nn, Tsit5(), u0, p, saveat = solution.t)
52+
s = solve(prob_nn, Tsit5(), u0 = u0, p = p, saveat = solution.t)
5353

5454
function predict(θ)
55-
Array(concrete_solve(prob_nn, Vern7(), u0, θ, saveat = solution.t,
55+
Array(solve(prob_nn, Vern7(), u0 = u0, p = θ, saveat = solution.t,
5656
abstol=1e-6, reltol=1e-6))
5757
end
5858

@@ -119,19 +119,10 @@ opt = SR3()
119119
# Create the thresholds which should be used in the search process
120120
λ = exp10.(-10:0.05:-0.5)
121121
# Target function to choose the results from; x = L0 of coefficients and L2-Error of the model
122-
function eval_target(x)
123-
y = similar(x)
124-
if iszero(x[1])
125-
y[1] = convert(eltype(x), Inf)
126-
end
127-
y[2] = x[2]
128-
return y
129-
end
130-
131-
alg = GoalProgramming(x->norm(x, 2), eval_target)
122+
g(x) = x[1] < 1 ? Inf : norm(x, 2)
132123
@info "Start SINDy regression with unknown threshold"
133124
# Test on uode derivative data
134-
Ψ = SINDy(X[:, 2:end], Y[:, 2:end], basis, λ, opt = opt, maxiter = 10000, normalize = true, denoise = true, alg = alg) # Succeed
125+
Ψ = SINDy(X[:, 2:end], Y[:, 2:end], basis, λ, opt, g = g, maxiter = 10000, normalize = true, denoise = true) # Succeed
135126
= parameters(Ψ)
136127
@info "Build initial guess system"
137128
# The parameters are a bit off, so we reiterate another SINDy term to get closer to the ground truth
@@ -142,7 +133,7 @@ unknown_eq = ODEFunction(unknown_sys)
142133
b = Basis((u, p, t)->unknown_eq(u, ones(size(p̂)), t), u)
143134
# Test on uode derivative data
144135
@info "Refine the guess"
145-
Ψ = SINDy(X[:, 2:end], Y[:, 2:end],b, opt = SR3(0.1), maxiter = 1000) # Succeed
136+
Ψ = SINDy(X[:, 2:end], Y[:, 2:end],b, SR3(0.1), maxiter = 1000) # Succeed
146137
= parameters(Ψ)
147138

148139
@info "Checking equations"
@@ -162,7 +153,6 @@ end
162153
unknown_sys = ODESystem(Ψ)
163154
unknown_eq = ODEFunction(unknown_sys)
164155

165-
166156
# Build a ODE for the estimated system
167157
function approx(du, u, p, t)
168158
# Add SINDy Term

0 commit comments

Comments
 (0)