Hi, I was trying to simulate a physical system consisting of heterogeneous subpart sizes (i.e. arrays), so I use RecursiveArrayTools
. Consider the following MWE:
julia> using DifferentialEquations
julia> function foo(du, u, p, t)
end
foo (generic function with 1 method)
julia> u0 = ArrayPartition(rand(5), ArrayPartition(rand(5), rand(5)));
julia> prob = ODEProblem(foo, u0, (0.0, 1.0));
julia> integrator = init(prob, Tsit5())
ERROR: ArgumentError: reducing over an empty collection is not allowed
Stacktrace:
[1] _empty_reduce_error() at ./reduce.jl:216
When u0
is a nested ArrayPartition
, it will pop this error up, which is in the call of ODE_DEFAULT_NORM
. I am confused as to where is the empty array ever come from? Could anyone help me figure this out? Or if this solution construction is not recommended?
Thanks in advance!