CSV is plain text. You can use dlmwrite from the DelimitedFiles standard library or, for greater performance, CSV.jl.
The MAT.jl package can write Matlab files, if you need that, but I wouldn’t recommend using that format except for interchange with Matlab. More generally, you can use HDF5.jl as a binary interchange format.
I tried the above. I’m not sure what’s the right way to access sol in the output @btime sol = solve($prob,QNDF()) .
I get the following error in the line df = DataFrame(sol)
ERROR: LoadError: UndefVarError: sol not defined
Stacktrace:
Suggestions on the right way to access the data present in the variable sol will be really helpful.
I think your code would work by putting the @btime macro to the rhs
sol = @btime solve($prob,QNDF())
However, if you have benchmarked the solvers already and if you only want to store the solution of the ODE solve and output a rough timing at the same time, then you could also use @time :