Hi! I’m getting a very confusing bug while attempting to solve a stiff SDE using SKenCarp. I’ve included a minimal example below. ImplicitEM, an alternative solver, works just fine, but SKenCarp appears to do something funky with the noise_rate_prototype matrix. The error message that arises – “DimensionMismatch: all inputs to eachindex must have the same indices” – is the same as in this GitHub issue, but the situation is different. I would appreciate any and all advice – thank you!! See below also for details on the code.
The first argument in SplitSDEProblem is the stiff component of the drift; the second argument is the non-stiff component; the third is the non-stiff diffusion. The fourth argument gives the initial conditions, and the fifth the time span. Finally, noise_rate_prototype is a matrix defining the shape and format of the diffusion. In this case, the diffusion should be 2x2 and no terms should be fixed at 0.
import StochasticDiffEq as SDE
prob = SDE.SplitSDEProblem((du, u, p, t) -> du .= 1.0,
(du, u, p, t) -> du .= 1.0,
(du, u, p, t) -> du .= 1.0,
zeros(2), (0.0, 10.0),
noise_rate_prototype = ones(2, 2))
sol = SDE.solve(prob, SDE.SKenCarp(autodiff = SDE.AutoFiniteDiff()))
# sol = SDE.solve(prob, SDE.ImplicitEM(autodiff = SDE.AutoFiniteDiff()))