This is a mutable struct which doesn’t concretely type its fields. This makes w.all_X not type stable, which then makes integrate(x,dt) dynamically dispatch. Instead, use a type parameter
mutable struct Wrapper{T<:X}
all_X::Array{T,1}
end
and it’ll be much better.
Another thing to mention is that the way you are writing the functions you are assuming the differential equations are all independent. This is not true in general nor is it true in most cases (though it may be for your case, I don’t know), so you should be cautious about this approach unless it’s for a very specific purpose.