Skip to content

Saving and loading

All of the types native to HarmonicBalance.jl can be saved into a .jld2 file using save and loaded using load. Most of the saving/loading is performed using the package JLD2.jl, with the addition of reinstating the symbolic variables in the HarmonicBalance namespace (needed to parse expressions used in the plotting functions) and recompiling stored functions (needed to evaluate Jacobians). As a consequence, composite objects such as Result can be saved and loaded with no loss of information.

The function export_csv saves a .csv file which can be plot elsewhere.

# HarmonicBalance.saveFunction.
julia
save(filename, object)

Saves object into .jld2 file filename (the suffix is added automatically if not entered). The resulting file contains a dictionary with a single entry.

source


# HarmonicBalance.loadFunction.
julia
load(filename)

Loads an object from filename. For objects containing symbolic expressions such as HarmonicEquation, the symbolic variables are reinstated in the HarmonicBalance namespace.

source


# HarmonicBalance.export_csvFunction.
julia
export_csv(filename, res, branch)

Saves into filename a specified solution branch of the Result res.

source