Skip to content

Commit 40f3e53

Browse files
test: test symbolic indexing of DDE solutions
1 parent 5e6b3ee commit 40f3e53

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/dde.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ prob2 = DDEProblem(sys,
5050
constant_lags = [tau])
5151
sol2_mtk = solve(prob2, alg, reltol = 1e-7, abstol = 1e-10)
5252
@test sol2_mtk.u[end] sol2.u[end]
53+
@test_nowarn sol2_mtk[[x₀, x₁, x₂(t)]]
54+
@test_nowarn sol2_mtk[[x₀, x₁, x₂(t - 0.1)]]
5355

5456
using StochasticDelayDiffEq
5557
function hayes_modelf(du, u, h, p, t)
@@ -107,3 +109,8 @@ for coupledOsc in [coupledOsc, coupledOsc2]
107109
@test length(equations(sys)) == 4
108110
@test length(unknowns(sys)) == 4
109111
end
112+
sys = structural_simplify(coupledOsc)
113+
prob = DDEProblem(sys, [], (0.0, 10.0); constant_lags = [sys.osc1.τ, sys.osc2.τ])
114+
sol = solve(prob, MethodOfSteps(Tsit5()))
115+
@test_nowarn sol[[sys.osc1.delx, sys.osc2.delx]]
116+
@test sol[sys.osc1.delx] sol(sol.t .- 0.01; idxs = sys.osc1.x)

0 commit comments

Comments
 (0)