Skip to content

Some DifferentialEquations.jl solvers fail when using ArrayPartition #44

Description

@Sleort

Note the use of ArrayPartition below

julia> using DifferentialEquations,RecursiveArrayTools

julia> function lorenz(du,u,p,t)
           du[1] = 10.0*(u[2]-u[1])
           du[2] = u[1]*(28.0-u[3]) - u[2]
           du[3] = u[1]*u[2] - (8/3)*u[3]
       end
lorenz (generic function with 1 method)

julia> u0 = ArrayPartition([1.0,0.0],[0.0])
([1.0, 0.0], [0.0])

julia> tspan = (0.0,100.0)
(0.0, 100.0)

julia> prob = ODEProblem(lorenz,u0,tspan)
ODEProblem with uType ArrayPartition{Float64,Tuple{Array{Float64,1},Array{Float64,1}}} and tType Float64. In-place: true
timespan: (0.0, 100.0)
u0: [1.0, 0.0][0.0]

julia> sol = solve(prob,Tsit5());

julia> sol = solve(prob,AutoTsit5(Rosenbrock23()));
ERROR: MethodError: no method matching ldiv!(::LinearAlgebra.LU{Float64,Array{Float64,2}}, ::ArrayPartition{Float64,Tuple{Array{Float64,1},Array{Float64,1}}})
Closest candidates are:
  ldiv!(::LinearAlgebra.Transpose{#s561,#s560} where #s560<:LinearAlgebra.LowerTriangular where #s561, ::AbstractArray{T,1} where T) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/triangular.jl:1217
  ldiv!(::LinearAlgebra.Transpose{#s561,#s560} where #s560<:LinearAlgebra.LowerTriangular where #s561, ::AbstractArray{T,1} where T, ::AbstractArray{T,1} where T) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/triangular.jl:1201
  ldiv!(::LinearAlgebra.Transpose{#s561,#s560} where #s560<:LinearAlgebra.UnitLowerTriangular where #s561, ::AbstractArray{T,1} where T) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/triangular.jl:1235
  ...

(Everything works fine without ArrayPartition, i.e. u0 = [1.0, 0.0, 0.0])

I'm using DifferentialEquations v5.3.1, RecursiveArrayTools v0.18.3, and Julia 1.0.1 on Ubuntu 16.04.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions