6767@noinline sink2! (x, v) = always! (ddt (x) - v)
6868function sinsink2! ()
6969 x = continuous ()
70+ initial! (x - 1.0 )
7071 sink2! (x, sin (x))
7172end
72- dae_sol = solve (DAECProblem (sinsink2!, ( 1 ,) .=> 1. ), DFBDF (autodiff= false ))
73- ode_sol = solve (ODECProblem (sinsink2!, ( 1 ,) .=> 1. ), Rodas5 (autodiff= false ))
73+ dae_sol = solve (DAECProblem (sinsink2!), DFBDF (autodiff= false ))
74+ ode_sol = solve (ODECProblem (sinsink2!), Rodas5 (autodiff= false ))
7475for sol in (dae_sol, ode_sol)
7576 @test all (map ((x,y)-> isapprox (x[], y, atol= 1e-2 ), sol[1 , :], 2 * acot .(exp .(- sol. t).* cot (1 / 2 ))))
7677end
8283
8384@noinline function (this:: sicm! )()
8485 x = continuous ()
86+ initial! (x - 1.0 )
8587 always! (ddt (x) - this. arg)
8688end
8789
@@ -94,8 +96,8 @@ function (this::sicm2!)()
9496 sicm! (this. a)(); sicm! (this. b)();
9597 return nothing
9698end
97- dae_sol = solve (DAECProblem (sicm2! (1. , 1. ), ( 1 , 2 ) .=> 1. ), DFBDF (autodiff= false ))
98- ode_sol = solve (ODECProblem (sicm2! (1. , 1. ), ( 1 , 2 ) .=> 1. ), Rodas5 (autodiff= false ))
99+ dae_sol = solve (DAECProblem (sicm2! (1. , 1. )), DFBDF (autodiff= false ))
100+ ode_sol = solve (ODECProblem (sicm2! (1. , 1. )), Rodas5 (autodiff= false ))
99101for (sol, i) in Iterators. product ((dae_sol, ode_sol), 1 : 2 )
100102 @test all (map ((x,y)-> isapprox (x[], y, atol= 1e-2 ), sol[i, :], 1. .+ sol. t))
101103end
0 commit comments