Skip to content

Commit

Permalink
Merge branch 'master' into hr/isinplace
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Sep 1, 2024
2 parents 80a26f2 + 68f47f8 commit 2d0b008
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SciMLBase"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
authors = ["Chris Rackauckas <[email protected]> and contributors"]
version = "2.50.6"
version = "2.51.4"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
8 changes: 7 additions & 1 deletion src/alg_traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ function alg_order(alg::AbstractODEAlgorithm)
error("Order is not defined for this algorithm")
end

EnumX.@enumx AlgorithmInterpretation Ito Stratonovich

"""
alg_interpretation(alg)
Integral interpolation for the SDE solver algorithm. SDEs solutions depend on the chosen definition of the stochastic integral. In the Ito calculus,
the left-hand rule is taken, while Stratonovich calculus uses the right-hand rule. Unlike in standard Riemannian integration, these integral rules do
not converge to the same answer. In the context of a stochastic differential equation, the underlying solution (and its mean, variance, etc.) is dependent
Expand All @@ -258,4 +262,6 @@ For more information, see https://oatml.cs.ox.ac.uk/blog/2022/03/22/ito-strat.ht
The expected solution statistics are dependent on this output. Solutions from solvers with different
interpretations are expected to have different answers on almost all SDEs without additive noise.
"""
function alg_interpretation end
function alg_interpretation(alg::AbstractSciMLAlgorithm)
error("Algorithm interpretation is not defined for this algorithm. It can be either `AlgorithmInterpretation.Ito` or `AlgorithmInterpretation.Stratonovich`")
end
2 changes: 1 addition & 1 deletion src/problems/dae_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Defines an implicit ordinary differential equation (ODE) or
differential-algebraic equation (DAE) problem.
Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/dae_types/
Documentation Page: [https://docs.sciml.ai/DiffEqDocs/stable/types/dae_types/](https://docs.sciml.ai/DiffEqDocs/stable/types/dae_types/)
## Mathematical Specification of an DAE Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/dde_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct StandardDDEProblem end
@doc doc"""
Defines a delay differential equation (DDE) problem.
Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/dde_types/
Documentation Page: [https://docs.sciml.ai/DiffEqDocs/stable/types/dde_types/](https://docs.sciml.ai/DiffEqDocs/stable/types/dde_types/)
## Mathematical Specification of a DDE Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/discrete_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const DISCRETE_OUTOFPLACE_DEFAULT = DiscreteFunction{false}((u, p, t) -> u)
@doc doc"""
Defines a discrete dynamical system problem.
Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/
Documentation Page: [https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/](https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/)
## Mathematical Specification of a Discrete Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/implicit_discrete_problems.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@doc doc"""
Defines a discrete dynamical system problem.
Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/
Documentation Page: [https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/](https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/)
## Mathematical Specification of a ImplicitDiscrete Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/integral_problems.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@doc doc"""
Defines an integral problem.
Documentation Page: https://docs.sciml.ai/Integrals/stable/
Documentation Page: [https://docs.sciml.ai/Integrals/stable/](https://docs.sciml.ai/Integrals/stable/)
## Mathematical Specification of an Integral Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/linear_problems.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@doc doc"""
Defines a linear system problem.
Documentation Page: https://docs.sciml.ai/LinearSolve/stable/basics/LinearProblem/
Documentation Page: [https://docs.sciml.ai/LinearSolve/stable/basics/LinearProblem/](https://docs.sciml.ai/LinearSolve/stable/basics/LinearProblem/)
## Mathematical Specification of a Linear Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/ode_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct StandardODEProblem end
@doc doc"""
Defines an ordinary differential equation (ODE) problem.
Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/
Documentation Page: [https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/](https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/)
## Mathematical Specification of an ODE Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/optimization_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@doc doc"""
Defines an optimization problem.
Documentation Page: https://docs.sciml.ai/Optimization/stable/API/optimization_problem/
Documentation Page: [https://docs.sciml.ai/Optimization/stable/API/optimization_problem/](https://docs.sciml.ai/Optimization/stable/API/optimization_problem/)
## Mathematical Specification of an Optimization Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/rode_problems.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@doc doc"""
Defines a random ordinary differential equation (RODE) problem.
Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/rode_types/
Documentation Page: [https://docs.sciml.ai/DiffEqDocs/stable/types/rode_types/](https://docs.sciml.ai/DiffEqDocs/stable/types/rode_types/)
## Mathematical Specification of a RODE Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/sdde_problems.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@doc doc"""
Defines a stochastic delay differential equation (SDDE) problem.
Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/sdde_types/
Documentation Page: [https://docs.sciml.ai/DiffEqDocs/stable/types/sdde_types/](https://docs.sciml.ai/DiffEqDocs/stable/types/sdde_types/)
## Mathematical Specification of a Stochastic Delay Differential Equation (SDDE) Problem
Expand Down
2 changes: 1 addition & 1 deletion src/problems/sde_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct StandardSDEProblem end
@doc doc"""
Defines an stochastic differential equation (SDE) problem.
Documentation Page: https://docs.sciml.ai/DiffEqDocs/stable/types/sde_types/
Documentation Page: [https://docs.sciml.ai/DiffEqDocs/stable/types/sde_types/](https://docs.sciml.ai/DiffEqDocs/stable/types/sde_types/)
## Mathematical Specification of a SDE Problem
Expand Down
18 changes: 18 additions & 0 deletions src/solutions/rode_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ struct RODESolution{T, N, uType, uType2, DType, tType, randType, P, A, IType, S,
seed::UInt64
end

function ConstructionBase.constructorof(::Type{O}) where {T, N, O <: RODESolution{T, N}}
RODESolution{T, N}
end

function ConstructionBase.setproperties(sol::RODESolution, patch::NamedTuple)
u = get(patch, :u, sol.u)
N = u === nothing ? 2 : ndims(eltype(u)) + 1
T = eltype(eltype(u))
patch = merge(getproperties(sol), patch)
return RODESolution{
T, N, typeof(patch.u), typeof(patch.u_analytic), typeof(patch.errors),
typeof(patch.t), typeof(patch.W), typeof(patch.prob), typeof(patch.alg), typeof(patch.interp),
typeof(patch.stats), typeof(patch.alg_choice)}(
patch.u, patch.u_analytic, patch.errors, patch.t, patch.W,
patch.prob, patch.alg, patch.interp, patch.dense, patch.tslocation, patch.stats,
patch.alg_choice, patch.retcode, patch.seed)
end

Base.@propagate_inbounds function Base.getproperty(x::AbstractRODESolution, s::Symbol)
if s === :destats
Base.depwarn("`sol.destats` is deprecated. Use `sol.stats` instead.", "sol.destats")
Expand Down

0 comments on commit 2d0b008

Please sign in to comment.