@@ -17,13 +17,15 @@ using StochasticDiffEq, OrdinaryDiffEq, NonlinearSolve, SymbolicIndexingInterfac
1717 prob = ODEProblem (f, [1.0 , 1.0 ], (0.0 , 1.0 ))
1818 integ = init (prob)
1919 u0, _, success = SciMLBase. get_initial_values (
20- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
20+ prob, integ, f, SciMLBase. CheckInit (),
21+ Val (SciMLBase. isinplace (f)); abstol = 1e-10 )
2122 @test success
2223 @test u0 == prob. u0
2324
2425 integ. u[2 ] = 2.0
2526 @test_throws SciMLBase. CheckInitFailureError SciMLBase. get_initial_values (
26- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
27+ prob, integ, f, SciMLBase. CheckInit (),
28+ Val (SciMLBase. isinplace (f)); abstol = 1e-10 )
2729 end
2830 end
2931
@@ -43,18 +45,21 @@ using StochasticDiffEq, OrdinaryDiffEq, NonlinearSolve, SymbolicIndexingInterfac
4345 prob = DAEProblem (f, [1.0 , 0.0 ], [1.0 , 1.0 ], (0.0 , 1.0 ), 1.0 )
4446 integ = init (prob, DImplicitEuler ())
4547 u0, _, success = SciMLBase. get_initial_values (
46- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
48+ prob, integ, f, SciMLBase. CheckInit (),
49+ Val (SciMLBase. isinplace (f)); abstol = 1e-10 )
4750 @test success
4851 @test u0 == prob. u0
4952
5053 integ. u[2 ] = 2.0
5154 @test_throws SciMLBase. CheckInitFailureError SciMLBase. get_initial_values (
52- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
55+ prob, integ, f, SciMLBase. CheckInit (),
56+ Val (SciMLBase. isinplace (f)); abstol = 1e-10 )
5357
5458 integ. u[2 ] = 1.0
5559 integ. du[1 ] = 2.0
5660 @test_throws SciMLBase. CheckInitFailureError SciMLBase. get_initial_values (
57- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
61+ prob, integ, f, SciMLBase. CheckInit (),
62+ Val (SciMLBase. isinplace (f)); abstol = 1e-10 )
5863 end
5964 end
6065
@@ -86,13 +91,15 @@ using StochasticDiffEq, OrdinaryDiffEq, NonlinearSolve, SymbolicIndexingInterfac
8691 prob = SDEProblem (f, [1.0 , 1.0 , - 1.0 ], (0.0 , 1.0 ))
8792 integ = init (prob, ImplicitEM ())
8893 u0, _, success = SciMLBase. get_initial_values (
89- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
94+ prob, integ, f, SciMLBase. CheckInit (),
95+ Val (SciMLBase. isinplace (f)); abstol = 1e-10 )
9096 @test success
9197 @test u0 == prob. u0
9298
9399 integ. u[2 ] = 2.0
94100 @test_throws SciMLBase. CheckInitFailureError SciMLBase. get_initial_values (
95- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
101+ prob, integ, f, SciMLBase. CheckInit (),
102+ Val (SciMLBase. isinplace (f)); abstol = 1e-10 )
96103 end
97104 end
98105end
@@ -138,11 +145,13 @@ end
138145 prob, integ, fn, SciMLBase. OverrideInit (), Val (false ))
139146 end
140147
148+ abstol = 1e-10
149+ reltol = 1e-10
141150 @testset " Solves" begin
142151 @testset " with explicit alg" begin
143152 u0, p, success = SciMLBase. get_initial_values (
144153 prob, integ, fn, SciMLBase. OverrideInit (),
145- Val (false ); nlsolve_alg = NewtonRaphson ())
154+ Val (false ); nlsolve_alg = NewtonRaphson (), abstol, reltol )
146155
147156 @test u0 ≈ [2.0 , 2.0 ]
148157 @test p ≈ 1.0
152161 end
153162 @testset " with alg in `OverrideInit`" begin
154163 u0, p, success = SciMLBase. get_initial_values (
155- prob, integ, fn, SciMLBase. OverrideInit (nlsolve = NewtonRaphson ()),
164+ prob, integ, fn,
165+ SciMLBase. OverrideInit (; nlsolve = NewtonRaphson (), abstol, reltol),
156166 Val (false ))
157167
158168 @test u0 ≈ [2.0 , 2.0 ]
170180 _integ = init (_prob; initializealg = NoInit ())
171181
172182 u0, p, success = SciMLBase. get_initial_values (
173- _prob, _integ, _fn, SciMLBase. OverrideInit (), Val (false ))
183+ _prob, _integ, _fn, SciMLBase. OverrideInit (), Val (false ); abstol, reltol )
174184
175185 @test u0 ≈ [1.0 , 1.0 ]
176186 @test p ≈ 1.0
182192 _integ = ProblemState (; u = integ. u, p = parameter_values (integ), t = integ. t)
183193 u0, p, success = SciMLBase. get_initial_values (
184194 prob, _integ, fn, SciMLBase. OverrideInit (),
185- Val (false ); nlsolve_alg = NewtonRaphson ())
195+ Val (false ); nlsolve_alg = NewtonRaphson (), abstol, reltol )
186196
187197 @test u0 ≈ [2.0 , 2.0 ]
188198 @test p ≈ 1.0
199209
200210 u0, p, success = SciMLBase. get_initial_values (
201211 prob, integ, fn, SciMLBase. OverrideInit (),
202- Val (false ); nlsolve_alg = NewtonRaphson ())
212+ Val (false ); nlsolve_alg = NewtonRaphson (), abstol, reltol )
203213 @test u0 ≈ [1.0 , 1.0 ]
204214 @test p ≈ 1.0
205215 @test success
213223
214224 u0, p, success = SciMLBase. get_initial_values (
215225 prob, integ, fn, SciMLBase. OverrideInit (),
216- Val (false ); nlsolve_alg = NewtonRaphson ())
226+ Val (false ); nlsolve_alg = NewtonRaphson (), abstol, reltol )
217227
218228 @test u0 ≈ [2.0 , 2.0 ]
219229 @test p ≈ 0.0
0 commit comments