I have enjoyed using ArrayPartitions to segregate information such as differential vs algebraic states when running DifferentialEquations. It worked great for what I used: one partition.
Now I am trying to segregate the state vector by the state vectors of subcomponents in the simulation. Unfortunately, when each state vector is about 8, and there are 10 components, DifferentialEquations seems to hang. I don’t have the same problem if the vectors are concatenated as one single vector (but I lose the partitioning):
using DifferentialEquations
using RecursiveArrayTools
X = [ fill(0.0, 8) for i in 1:20 ];
x = ArrayPartition(X...);
function xdot!(dx, x, p, time)
dx .= 0.0
end
f = ODEFunction(xdot!)
prob = ODEProblem(f, x, (0.0, 1.0))
sol = DifferentialEquations.solve(prob, saveat = [1.0])
Obviously I can concatenate, but it makes the code much less attractive. Any idea what’s going on?
One might suggest I use MTK, but I’m stuck with that as well: Maximum of matrix vector product for "large" matrices - #2 by ChrisRackauckas
Thanks for the help!