Skip to content

Commit 3539901

Browse files
committed
Test symbolic indexing of DDE with multivariate variable
1 parent e2ca4b2 commit 3539901

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/dde.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ prob = SDDEProblem(hayes_modelf, hayes_modelg, [1.0], h, tspan, pmul;
7676
constant_lags = (pmul[1],));
7777
sol = solve(prob, RKMil(), seed = 100)
7878

79-
@variables x(..) delx(t)
8079
@parameters a=-4.0 b=-2.0 c=10.0 α=-1.3 β=-1.2 γ=1.1
80+
@variables x(..)
81+
@variables delx(t, a, b, c, α, β, γ) # equivalent to just delx(t)
8182
@brownians η
8283
τ = 1.0
8384
eqs = [D(x(t)) ~ a * x(t) + b * x(t - τ) + c +* x(t) + γ) * η, delx ~ x(t - τ)]
@@ -88,6 +89,8 @@ eqs = [D(x(t)) ~ a * x(t) + b * x(t - τ) + c + (α * x(t) + γ) * η, delx ~ x(
8889
@test equations(sys) == [D(x(t)) ~ a * x(t) + b * x(t - τ) + c]
8990
@test isequal(ModelingToolkit.get_noise_eqs(sys), [α * x(t) + γ;;])
9091
prob_mtk = SDDEProblem(sys, [x(t) => 1.0 + t], tspan; constant_lags = (τ,));
92+
@test prob_mtk[delx] isa Float64
93+
@test prob_mtk[x(t - τ)] isa Float64
9194
@test_nowarn sol_mtk = solve(prob_mtk, RKMil(), seed = 100)
9295

9396
prob_sa = SDDEProblem(

0 commit comments

Comments
 (0)