# Saving output of ODE simulations

**URL:** https://discourse.julialang.org/t/saving-output-of-ode-simulations/93884
**Category:** New to Julia
**Created:** [February 1, 2023, 7:35pm UTC](https://discourse.julialang.org/t/saving-output-of-ode-simulations/93884 "2023-02-01T19:35:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yoshi/32/38259_2.png) [@yoshi](https://discourse.julialang.org/u/yoshi)
#### Post date: [February 1, 2023, 7:35pm UTC](https://discourse.julialang.org/t/saving-output-of-ode-simulations/93884/1 "2023-02-01T19:35:52Z")

</div>

I’m trying to save the outputs of solve from the differentialEquations package.

After running my simulation `sim`, I run load JLD. Then run `save("temp.jld","sim",sim)`.

However, when I load again (after I’ve loaded the relevant libraries) I receive an error:

```julia
error parsing type string SciMLBase.EnsembleSolution{Core.Float64,4,Core.Array{SciMLBase.ODESolution{Core.Float64,3,Core.Array{Core.Array{Core.Float64,2},1},Core.Nothing,Core.Nothing,Core.Array{Core.Float32,1},Core.Array{Core.Array{Core.Array{Core.Float64,2},1},1},SciMLBase.ODEProblem{Core.Array{Core.Float64,2},Core.Tuple{Core.Float32,Core.Float32},true,SciMLBase.NullParameters,SciMLBase.ODEFunction{true,SciMLBase.FullSpecialize,#f,LinearAlgebra.UniformScaling{Core.Bool},Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,SciMLBase.#DEFAULT_OBSERVED,Core.Nothing,Core.Nothing},Base.Pairs{Core.Symbol,Union(),Core.Tuple{},Core.NamedTuple{(),Core.Tuple{}}},SciMLBase.StandardODEProblem},OrdinaryDiffEq.Tsit5{OrdinaryDiffEq.#trivial_limiter!,OrdinaryDiffEq.#trivial_limiter!,Static.False},OrdinaryDiffEq.InterpolationData{SciMLBase.ODEFunction{true,SciMLBase.FullSpecialize,#f,LinearAlgebra.UniformScaling{Core.Bool},Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,Core.Nothing,SciMLBase.#DEFAULT_OBSERVED,Core.Nothing,Core.Nothing},Core.Array{Core.Array{Core.Float64,2},1},Core.Array{Core.Float32,1},Core.Array{Core.Array{Core.Array{Core.Float64,2},1},1},OrdinaryDiffEq.Tsit5Cache{Core.Array{Core.Float64,2},Core.Array{Core.Float64,2},Core.Array{Core.Float64,2},OrdinaryDiffEq.Tsit5ConstantCache{Core.Float64,Core.Float32},OrdinaryDiffEq.#trivial_limiter!,OrdinaryDiffEq.#trivial_limiter!,Static.False}},DiffEqBase.DEStats},1}}
Error encountered while load FileIO.File{FileIO.DataFormat{:JLD}, String}("temp.jld").

Fatal error:
ERROR: syntax: incomplete: premature end of input
Stacktrace:
 [1] top-level scope
   @ none:1
Stacktrace:
 [1] handle_error(e::ErrorException, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
   @ FileIO ~/.julia/packages/FileIO/DtNtF/src/error_handling.jl:61
 [2] handle_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, action::String)
   @ FileIO ~/.julia/packages/FileIO/DtNtF/src/error_handling.jl:56
 [3] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ FileIO ~/.julia/packages/FileIO/DtNtF/src/loadsave.jl:228
 [4] action
   @ ~/.julia/packages/FileIO/DtNtF/src/loadsave.jl:196 [inlined]
 [5] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ FileIO ~/.julia/packages/FileIO/DtNtF/src/loadsave.jl:185
 [6] action
   @ ~/.julia/packages/FileIO/DtNtF/src/loadsave.jl:185 [inlined]
 [7] load(::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ FileIO ~/.julia/packages/FileIO/DtNtF/src/loadsave.jl:113
 [8] load(::String)
   @ FileIO ~/.julia/packages/FileIO/DtNtF/src/loadsave.jl:109
 [9] top-level scope
   @ REPL[2]:1

```

I’m not sure how to interpret this. Do people have ideas? I’m thinking that I haven’t saved all the variables in my workspace. But my workspace is big, is there a way to save the entire workspace without explicitly naming the variables? I don’t see an example in the [documentation](https://github.com/JuliaIO/JLD.jl).

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [February 2, 2023, 2:11am UTC](https://discourse.julialang.org/t/saving-output-of-ode-simulations/93884/2 "2023-02-02T02:11:01Z")

</div>

That is mentioned here: [I/O: Saving and Loading Solution Data · DifferentialEquations.jl](https://docs.sciml.ai/DiffEqDocs/stable/features/io/#JLD2-and-BSON.jl)
