Hi,
I’m trying to solve an ODE with variables of different types using an ArrayPartition. I have tried several solvers but they all get stuck on performing similar(ArrayPartition, Type).
The code executed in the ODE solving stack is:
atmp = similar(u, uEltypeNoUnits)
recursivefill!(atmp, false)
where u
is the initial condition.
For example, I have several different variables making my u
look like:
using RecursiveArrayTools
var1 = 0:0.01:1
var2 = 0.0,
var3 = sin.(0:0.01:pi)
init = ArrayPartition(var1,var2,var3)
Using a simple ArrayPartition with the same types I can use similar, for example with:
a = [1.0,2.0,3.0]
b = [4.0,5.0]
c = [a,b]
d = ArrayPartition(c...)
similar(d,Float64)
But I can’t see how to do this with something that looks like init
above.
Alternatively, is there a solver that works with ArrayPartitions with different types ‘out of the box’?
Many thanks!