@@ -358,7 +358,7 @@ D = Differential(t)
358
358
eqs = [D (x1) ~ - x1]
359
359
@named sys = ODESystem (eqs,t,[x1,x2],[])
360
360
@test_throws ArgumentError ODEProblem (sys, [1.0 ,1.0 ], (0.0 ,1.0 ))
361
- @test_nowarn ODEProblem (sys, [1.0 ,1.0 ], (0.0 ,1.0 ), check_length= false )
361
+ @test_nowarn ODEProblem (sys, [1.0 ,1.0 ], (0.0 ,1.0 ), check_length= false )
362
362
363
363
# check inputs
364
364
let
@@ -508,8 +508,8 @@ prob = ODEProblem(outersys, [sys.x=>1.0; collect(sys.ms).=>1:3], (0, 1.0))
508
508
509
509
# observed variable handling
510
510
@variables t x (t) RHS (t)
511
- @parameters τ
512
- D = Differential (t)
511
+ @parameters τ
512
+ D = Differential (t)
513
513
@named fol = ODESystem ([D (x) ~ (1 - x)/ τ]; observed= [RHS ~ (1 - x)/ τ])
514
514
@test isequal (RHS, @nonamespace fol. RHS)
515
515
RHS2 = RHS
@@ -589,14 +589,14 @@ eqs[end] = D(D(z)) ~ α*x - β*y
589
589
@named sys = ODESystem (eqs, t, us, ps; defaults= defs, preface= preface)
590
590
prob = ODEProblem (sys, [], (0.0 , 1.0 ))
591
591
sol = solve (prob, Euler (); dt= 0.1 )
592
-
592
+
593
593
@test c[1 ] == length (sol)
594
594
end
595
-
595
+
596
596
let
597
597
@parameters t
598
598
D = Differential (t)
599
- @variables x[1 : 2 ](t) = zeros (2 )
599
+ @variables x[1 : 2 ](t) = zeros (2 )
600
600
@variables y (t) = 0
601
601
@parameters k = 1
602
602
eqs= [
631
631
@test isapprox (sol[x[1 ]][end ], 2 , atol= 1e-3 )
632
632
633
633
# no initial conditions for D(x[1]) and D(x[2]) provided
634
- @test_throws ArgumentError prob = DAEProblem (sys, Pair[], Pair[], (0 , 50 ))
635
-
634
+ @test_throws ArgumentError prob = DAEProblem (sys, Pair[], Pair[], (0 , 50 ))
635
+
636
636
prob = ODEProblem (sys, Pair[x[1 ] => 0 ], (0 , 50 ))
637
637
sol = solve (prob, Rosenbrock23 ())
638
638
@test isapprox (sol[x[1 ]][end ], 1 , atol= 1e-3 )
650
650
tspan = (0.0 ,1.0 )
651
651
prob = ODEProblem (sys, u0map, tspan, pmap)
652
652
@test prob. p === Tuple ([(Dict (pmap))[k] for k in values (parameters (sys))])
653
- end
653
+ end
654
+
655
+ let
656
+ @variables t s (t) I (t) r (t)
657
+ @parameters N
658
+ @test_throws Any @named tmp = ODESystem ([s + I + r ~ N])
659
+ end
0 commit comments