Skip to content

Commit 275cfe1

Browse files
add diffeq to project.toml
1 parent 9431771 commit 275cfe1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

test/downstream/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
BoundaryValueDiffEq = "764a87c0-6b3e-53db-9096-fe964310641d"
33
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
4+
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
45
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
56
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
67
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"

test/downstream/ensemble_diffeq.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using DifferentialEquations
22

3-
f(u, p, t) = 1.01 * u
4-
u0 = 1 / 2
5-
tspan = (0.0, 1.0)
6-
prob = ODEProblem(f, u0, tspan)
7-
ensemble_prob = EnsembleProblem(prob, prob_func = (prob, i, repeat) -> remake(prob, u0 = rand()))
8-
sim = solve(ensemble_prob, EnsembleThreads(), trajectories = 10, dt = 0.1)
3+
prob = ODEProblem((u, p, t) -> 1.01u, 0.5, (0.0, 1.0))
4+
function prob_func(prob, i, repeat)
5+
remake(prob, u0 = rand() * prob.u0)
6+
end
7+
ensemble_prob = EnsembleProblem(prob, prob_func = prob_func)
8+
sim = solve(ensemble_prob, Tsit5(), EnsembleThreads(), trajectories = 10)
9+
@test sim isa EnsembleSolution

0 commit comments

Comments
 (0)