3 ms·
Using the IterableTables interface, the DifferentialEquations.jl solutions are presented as tables and directly convert to dataframes: http://docs.juliadiffeq.
by ChrisRackauckas 8y ago
Using the IterableTables interface, the DifferentialEquations.jl solutions are presented as tables and directly convert to dataframes:
http://docs.juliadiffeq.org/latest/features/io.html#Tabular-Data:-IterableTables-1 http://docs.juliadiffeq.org/latest/features/io.html#Tabular-...
f_2dlinear = (du,u,p,t) -> du.=1.01u
prob = ODEProblem(f_2dlinear,rand(2,2),(0.0,1.0))
sol1 =solve(prob,Euler();dt=1//2^(4))
using DataFrames
df = DataFrame(sol1)
# Result
17×5 DataFrames.DataFrame
│ Row │ timestamp │ value 1 │ value 2 │ value 3 │ value 4 │
├─────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 1 │ 0.0 │ 0.110435 │ 0.569561 │ 0.918336 │ 0.508044 │
│ 2 │ 0.0625 │ 0.117406 │ 0.605515 │ 0.976306 │ 0.540114 │
...