ODE of Vector of Matrices

The problem is that the ODE solver needs to have an object in which all elements are indexed linearly, i.e. a Vector of matrices is not possible immediately.
There is a good work workaround though, provided by the package RecursiveArrayTools
https://diffeq.sciml.ai/stable/features/diffeq_arrays/#ArrayPartitions

using RecursiveArrayTools
A = ArrayPartition(Matrix(1.0I,3,3),Matrix(1.0I,5,5))

where A.x[1] is your first matrix and so on.
this partition array is just a big vector under the hood and therefore you can use it for ODE’s.

1 Like