tmp (and some other variables) were changed before the use in the adaptive routine. Therefore, the stepping behavior did not agree with the oop version or the (similar) one from LambdaEM. I have now moved this part up. The variables k and dz have to be cached additionally in the alg cache. Otherwise, they are overwritten in the
z = OrdinaryDiffEq.nlsolve!(nlsolver, integrator, cache, repeat_step)
call.
gtmp2 and gtmp were identical because of the missing copy in the cache
Fixes the original issue https://github.com/SciML/StochasticDiffEq.jl/issues/481:
for oop
SDEProblem
s.In addition, there were some inconsistencies in the adaptive sub-routine. for oop problems:
dt
missing from the translation of https://github.com/SciML/StochasticDiffEq.jl/blob/b9806da512d1897cc5e8f9af37f4f15968d1f4cc/src/perform_step/lamba.jl#L23 to the Jacobian version.for in-place problems:
tmp
(and some other variables) were changed before the use in the adaptive routine. Therefore, the stepping behavior did not agree with the oop version or the (similar) one fromLambdaEM
. I have now moved this part up. The variablesk
anddz
have to be cached additionally in the alg cache. Otherwise, they are overwritten in thecall.
gtmp2
andgtmp
were identical because of the missingcopy
in the cache