@@ -44,17 +44,22 @@ sol = solve(prob, Rodas5(), initializealg = ShampineCollocationInit())
44
44
# Initialize on ODEs
45
45
# https://github.com/SciML/ModelingToolkit.jl/issues/2508
46
46
47
- function testsys (du,u,p, t)
47
+ function testsys (du, u, p, t)
48
48
du[1 ] = - 2
49
49
end
50
- function initsys (du,u, p)
50
+ function initsys (du, u, p)
51
51
du[1 ] = - 1 + u[1 ]
52
52
end
53
53
nlprob = NonlinearProblem (initsys, [0.0 ])
54
54
initprobmap (nlprob) = nlprob. u
55
55
sol = solve (nlprob)
56
56
57
57
_f = ODEFunction (testsys; initializeprob = nlprob, initializeprobmap = initprobmap)
58
+ prob = ODEProblem (_f, [0.0 ], (0.0 , 1.0 ))
59
+ sol = solve (prob, Tsit5 ())
60
+ @test SciMLBase. successful_retcode (sol)
61
+ @test sol[1 ] == [1.0 ]
62
+
58
63
prob = ODEProblem (_f, [0.0 ], (0.0 ,1.0 ))
59
64
sol = solve (prob, Tsit5 (), dt = 1e-10 )
60
65
@test SciMLBase. successful_retcode (sol)
@@ -66,4 +71,4 @@ sol = solve(prob, Rodas5P(), dt = 1e-10)
66
71
@test SciMLBase. successful_retcode (sol)
67
72
@test sol[1 ] == [1.0 ]
68
73
@test sol[2 ] ≈ [0.9999999998 ]
69
- @test sol[end ] ≈ [- 1.0 ]
74
+ @test sol[end ] ≈ [- 1.0 ]
0 commit comments