Skip to content

Commit c309693

Browse files
test: test remake for DDEProblem, SDDEProblem
1 parent 86d61b4 commit c309693

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/remake_tests.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ for T in containerTypes
2020
push!(probs, ODEProblem(fn, u0, tspan, T(p)))
2121
end
2222

23+
function ddelorenz!(du, u, h, p, t)
24+
du[1] = p[1] * (u[2] - u[1])
25+
du[2] = u[1] * (p[2] - u[3]) - u[2]
26+
du[3] = u[1] * u[2] - p[3] * u[3]
27+
end
28+
29+
function history(p, t)
30+
return u0 .- t
31+
end
32+
33+
fn = DDEFunction(ddelorenz!; sys)
34+
for T in containerTypes
35+
push!(probs, DDEProblem(fn, u0, history, tspan, T(p)))
36+
end
37+
2338
function residual!(resid, u, p, t)
2439
resid[1] = u[1] - 0.5
2540
resid[2] = u[2] - 0.5
@@ -38,6 +53,11 @@ for T in containerTypes
3853
push!(probs, SDEProblem(fn, u0, tspan, T(p)))
3954
end
4055

56+
fn = SDDEFunction(ddelorenz!, noise!; sys)
57+
for T in containerTypes
58+
push!(probs, SDDEProblem(fn, noise!, u0, history, tspan, T(p)))
59+
end
60+
4161
function loss(x, p)
4262
du = similar(x)
4363
lorenz!(du, u, p, 0.0)

0 commit comments

Comments
 (0)