11using  ModelingToolkit, DelayDiffEq, Test
2+ using  SymbolicIndexingInterface:  is_markovian
23using  ModelingToolkit:  t_nounits as t, D_nounits as D
34
45p0 =  0.2 ;
@@ -39,6 +40,7 @@ eqs = [D(x₀) ~ (v0 / (1 + beta0 * (x₂(t - tau)^2))) * (p0 - q0) * x₀ - d0
3940       D (x₂ (t)) ~  (v1 /  (1  +  beta1 *  (x₂ (t -  tau)^ 2 ))) *  (1  -  p1 +  q1) *  x₁ -  d2 *  x₂ (t)]
4041@mtkbuild  sys =  System (eqs, t)
4142@test  ModelingToolkit. is_dde (sys)
43+ @test  ! is_markovian (sys)
4244prob =  DDEProblem (sys,
4345    [x₀ =>  1.0 , x₁ =>  1.0 , x₂ (t) =>  1.0 ],
4446    tspan,
@@ -81,6 +83,7 @@ sol = solve(prob, RKMil())
8183eqs =  [D (x (t)) ~  a *  x (t) +  b *  x (t -  τ) +  c +  (α *  x (t) +  γ) *  η]
8284@mtkbuild  sys =  System (eqs, t)
8385@test  ModelingToolkit. is_dde (sys)
86+ @test  ! is_markovian (sys)
8487@test  equations (sys) ==  [D (x (t)) ~  a *  x (t) +  b *  x (t -  τ) +  c]
8588@test  isequal (ModelingToolkit. get_noiseeqs (sys), [α *  x (t) +  γ])
8689prob_mtk =  SDDEProblem (sys, [x (t) =>  1.0  +  t], tspan; constant_lags =  (τ,));
@@ -106,8 +109,10 @@ eqs = [osc1.jcn ~ osc2.delx,
106109@named  coupledOsc =  System (eqs, t)
107110@named  coupledOsc =  compose (coupledOsc, systems)
108111@test  ModelingToolkit. is_dde (coupledOsc)
112+ @test  ! is_markovian (coupledOsc)
109113@named  coupledOsc2 =  System (eqs, t; systems)
110114@test  ModelingToolkit. is_dde (coupledOsc2)
115+ @test  ! is_markovian (coupledOsc2)
111116for  coupledOsc in  [coupledOsc, coupledOsc2]
112117    local  sys =  structural_simplify (coupledOsc)
113118    @test  length (equations (sys)) ==  4 
0 commit comments