Open prbzrg opened 1 year ago
To construct an ODEProblem
, we use prob = ODEProblem(fun::ODEFunction, u0, tspan, p)
, the ODE solver Tsit5()
should be called when we want to solve this ODEProblem
.
For detailed usage, please refer to https://docs.sciml.ai/DiffEqDocs/stable/getting_started/
but
ODEProblem{false}(fode, ones(1), (0.0, 1.0), ones(1), Tsit5())
and
ODEProblem(fode, ones(1), (0.0, 1.0), ones(1), Tsit5())
both work.
but
ODEProblem{false}(fode, ones(1), (0.0, 1.0), ones(1), Tsit5())
and
ODEProblem(fode, ones(1), (0.0, 1.0), ones(1), Tsit5())
Yeah, but I think both of them are incorrect usages, you can use this:
julia> ODEProblem{false, SciMLBase.FullSpecialize}(fode, ones(1), (0.0, 1.0), ones(1))
ODEProblem with uType Vector{Float64} and tType Float64. In-place: false
timespan: (0.0, 1.0)
u0: 1-element Vector{Float64}:
1.0
Alright, should we add a warning to them? So it would be clear that solver should be given to solve function, not the problem definition.
I mean, if you want to add it sure. I would be surprised if anyone attempts this: this has never been the documented syntax.
Oh, it's a bug:
julia> pb = ODEProblem(fode, ones(1), (0.0, 1.0), ones(1), Tsit5())
ODEProblem with uType Vector{Float64} and tType Float64. In-place: false
timespan: (0.0, 1.0)
u0: 1-element Vector{Float64}:
1.0
julia> pb.problem_type
Tsit5(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!, thread = static(false),)
julia> pb2 = ODEProblem{false}(fode, ones(1), (0.0, 1.0), ones(1), Tsit5())
ODEProblem with uType Vector{Float64} and tType Float64. In-place: false
timespan: (0.0, 1.0)
u0: 1-element Vector{Float64}:
1.0
julia> pb2.problem_type
Tsit5(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!, thread = static(false),)
Accepting solver as problem type is definitely a bug that must be fixed. How can I help?
I think it must work, Am I missing something?