Skip to content

Commit f464f58

Browse files
committed
Add back accidentally removed tests
1 parent d8ec38e commit f464f58

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/sdesystem.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,3 +584,33 @@ end
584584
@test μμmod atol=2σ
585585
@test σ > σmod
586586
end
587+
588+
@variables t
589+
D = Differential(t)
590+
sts = @variables x(t) y(t) z(t)
591+
ps = @parameters σ ρ
592+
@brownian β η
593+
s = 0.001
594+
β *= s
595+
η *= s
596+
597+
eqs = [D(x) ~ σ * (y - x) + x * β,
598+
D(y) ~ x *- z) - y + y * β + x * η,
599+
D(z) ~ x * y - β * z + (x * z) * β]
600+
@named sys1 = System(eqs, t)
601+
sys1 = structural_simplify(sys1)
602+
603+
drift_eqs = [D(x) ~ σ * (y - x),
604+
D(y) ~ x *- z) - y,
605+
D(z) ~ x * y]
606+
607+
diffusion_eqs = [s*x 0
608+
s*y s*x
609+
(s * x * z)-s * z 0]
610+
611+
sys2 = SDESystem(drift_eqs, diffusion_eqs, t, sts, ps, name = :sys1)
612+
@test sys1 == sys2
613+
614+
prob = SDEProblem(sys1, sts .=> [1.0, 0.0, 0.0],
615+
(0.0, 100.0), ps .=> (10.0, 26.0))
616+
solve(prob, LambaEulerHeun(), seed = 1)

0 commit comments

Comments
 (0)