DifferentialEquations.jl
DifferentialEquations.jl copied to clipboard
Problem with SplitODEProblem in more than one dimension
Hi,
It seems that there is an issue solving a SplitODEProblem with initial conditions of type u0::Array{Float64,2}.
I get the error :
BoundsError: attempt to access 200-element view(::Array{Float64,2}, :, 1) with eltype Float64 at index [Base.OneTo(40000)] when solving.
Here is a reduced example:
using DifferentialEquations
using DiffEqOperators
# nonlocal function
function f1(du,u,p,t)
du .= u
end
M = 200; #number of points on the grid
X = collect(range(-10.,10.,length=M)) #grid
dX = X[2] - X[1] #discretization step
Δ_X1 = DiffEqArrayOperator(Array(CenteredDifference{1}(2, 2, dX, M))[:,2:end-1])
tend = 1.
tspan = (0.0,tend)
u0 = exp.(.-X.^2 .-X'.^2) #2D grid
prob = SplitODEProblem(Δ_X1,f1,u0,tspan)
sol = solve(prob)
What could possibly go wrong? 😳 All the best
sol = solve(prob,Tsit5()) is fine. It looks like IterativeSolvers.jl is having issues with the matrix-free form... @YingboMa could you look into this?