I am simulating an SDE using DifferentialEquations.jl and I am using DataFrames.jl to save the solution data.
I get a data frame with columns named timestamp, value1, value2 and value3.
I would like to use SDEFunction to be able to use the kwarg syms to able to name the elements rather than have value1, value2 and value3.
Further information is found here : SDE Problems
syms
: the symbol names for the elements of the equation. This should matchu0
in size. For example, ifu0 = [0.0,1.0]
andsyms = [:x, :y]
, this will apply a canonical naming to the values, allowingsol[:x]
in the solution and automatically naming values in plots.
And here Saving and Loading Solution Data
If we set syms in the DiffEqFunction, then those names will be used:
f = ODEFunction(f_2dlinear,syms=[:a,:b,:c,:d])
prob = ODEProblem(f,rand(2,2),(0.0,1.0));
sol1 =solve(prob,Euler();dt=1//2^(4));
df = DataFrame(sol1)
However I when I try using SDEFunction and try passing any information such as my function f (and g) it doesn’t work. Namely, as instructed I try passing
!(du,u,p,t)
ordu = f(u,p,t)
it returns an error. For instance, passing
du = f(u,p,t)
will give the following
ERROR: UndefVarError: u not defined