DifferentialEquations.jl icon indicating copy to clipboard operation
DifferentialEquations.jl copied to clipboard

Problem with SplitODEProblem in more than one dimension

Open vboussange opened this issue 5 years ago • 1 comments

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

vboussange avatar Apr 21 '20 09:04 vboussange

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?

ChrisRackauckas avatar Apr 22 '20 05:04 ChrisRackauckas