Hi,
I’m trying to use integrator interface of DiffEq.jl for discrete problem.
Is it possible?
Also, I wonder if “FunctionMap
” in this page means the default solver of discrete problem.
For example, trying to make an integrator seems fail to me
julia> function dynamics!(du, u, p, t)
du .= 0.99*u
end
dynamics! (generic function with 2 methods)
julia> prob = DiscreteProblem(dynamics!, [1, 2.0], (0, 10))
DiscreteProblem with uType Vector{Float64} and tType Int64. In-place: true
timespan: (0, 10)
u0: 2-element Vector{Float64}:
1.0
2.0
julia> init(prob, FunctionMap)
ERROR: MethodError: no method matching __init(::DiscreteProblem{Vector{Float64}, Tuple{Int64, Int64}, true, SciMLBase.NullParameters, DiscreteFunction{true, typeof(dynamics!), Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::Type{FunctionMap})
Closest candidates are:
__init(::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, ::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}) at /Users/jinrae/.julia/packages/OrdinaryDiffEq/Zi9Zh/src/solve.jl:9
__init(::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, ::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}, ::Any) at /Users/jinrae/.julia/packages/OrdinaryDiffEq/Zi9Zh/src/solve.jl:9
__init(::Union{SciMLBase.AbstractDAEProblem, SciMLBase.AbstractODEProblem}, ::Union{OrdinaryDiffEqAlgorithm, OrdinaryDiffEq.DAEAlgorithm}, ::Any, ::Any) at /Users/jinrae/.julia/packages/OrdinaryDiffEq/Zi9Zh/src/solve.jl:9
...
Stacktrace:
[1] init_call(_prob::DiscreteProblem{Vector{Float64}, Tuple{Int64, Int64}, true, SciMLBase.NullParameters, DiscreteFunction{true, typeof(dynamics!), Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, args::Type; merge_callbacks::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ DiffEqBase ~/.julia/packages/DiffEqBase/OPDgm/src/solve.jl:28
[2] init_call(_prob::DiscreteProblem{Vector{Float64}, Tuple{Int64, Int64}, true, SciMLBase.NullParameters, DiscreteFunction{true, typeof(dynamics!), Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, args::Type)
@ DiffEqBase ~/.julia/packages/DiffEqBase/OPDgm/src/solve.jl:15
[3] init(prob::DiscreteProblem{Vector{Float64}, Tuple{Int64, Int64}, true, SciMLBase.NullParameters, DiscreteFunction{true, typeof(dynamics!), Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, args::Type; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ DiffEqBase ~/.julia/packages/DiffEqBase/OPDgm/src/solve.jl:43
[4] init(prob::DiscreteProblem{Vector{Float64}, Tuple{Int64, Int64}, true, SciMLBase.NullParameters, DiscreteFunction{true, typeof(dynamics!), Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, args::Type)
@ DiffEqBase ~/.julia/packages/DiffEqBase/OPDgm/src/solve.jl:33
[5] top-level scope
@ REPL[21]:1