I have this script file. I originally planned to utilize my own ODE solver called RKF45 but convergence issues prevented that and I fell back on using ODEProblem and solve from DifferentialEquations. I had written my ODE function to utilize SVector, as that is what RKF45 uses, and I needed to do some rewriting to get my ODE function to work with DifferentialEquations. From solve, I get t and u where t is the t value vector and u is a solution Vector{SVector{4,Float64}} with 924 entries (corresponding to different values of t, the 4 elements of the SVector correspond to the 4 variables being integrated). My problem with this output is that I cannot seem to access individual columns, only individual elements or rows. The columns correspond to different integrated variables and I want to be able to access them so that I can plot them.
I have tried using SMatrix to convert u to a 924x4 SMatrix with Float64 elements with the code:
M = SMatrix{924,4,Float64}(u);
But this gave the error ERROR: DimensionMismatch: expected input array of length 3696, got length 924.
reinterpret to ‘forget’ we were grouping the Float64s in tuples of 4
reshape the resulting Vector{Float64} of length3696 = 924 \cdot 4 into a Matrix. Because the four floats in an SVector{4, Float64} are next to each other in memory, and Julia is column major, we need a 4 \times 924 matrix
You’re not supplying a dims(...) argument in reshape for the new size, which then seems to default to an empty tuple. Here you would need (4, length(u)) (or (4, :)).