From 63ddf19a727707a00c2afc8dbe27bb3432ddec67 Mon Sep 17 00:00:00 2001 From: Hossein Pourbozorg Date: Sun, 1 Sep 2024 21:35:02 +0330 Subject: [PATCH 1/4] update for new `AlgorithmInterpretation` --- src/DifferentialEquations.jl | 1 + src/sde_default_alg.jl | 5 +++-- test/default_sde_alg_test.jl | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/DifferentialEquations.jl b/src/DifferentialEquations.jl index 1db63371..e5b45b3f 100644 --- a/src/DifferentialEquations.jl +++ b/src/DifferentialEquations.jl @@ -21,6 +21,7 @@ using LinearAlgebra import DiffEqBase: solve @reexport using LinearSolve using NonlinearSolve +import SciMLBase include("default_solve.jl") include("default_arg_parsing.jl") diff --git a/src/sde_default_alg.jl b/src/sde_default_alg.jl index a03167ac..1cf4cefa 100644 --- a/src/sde_default_alg.jl +++ b/src/sde_default_alg.jl @@ -20,9 +20,10 @@ function default_algorithm( if is_stratonovich if is_stiff || prob.f.mass_matrix !== I - alg = ImplicitRKMil(autodiff = false, interpretation = :Stratonovich) + alg = ImplicitRKMil(autodiff = false, + interpretation = SciMLBase.AlgorithmInterpretation.Stratonovich) else - alg = RKMil(interpretation = :Stratonovich) + alg = RKMil(interpretation = SciMLBase.AlgorithmInterpretation.Stratonovich) end end diff --git a/test/default_sde_alg_test.jl b/test/default_sde_alg_test.jl index 8296222c..688818a9 100644 --- a/test/default_sde_alg_test.jl +++ b/test/default_sde_alg_test.jl @@ -1,4 +1,5 @@ using DifferentialEquations, Test +import SciMLBase f_additive(u, p, t) = @. p[2] / sqrt(1 + t) - u / (2 * (1 + t)) σ_additive(u, p, t) = @. p[1] * p[2] / sqrt(1 + t) @@ -18,7 +19,8 @@ sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:additive]) @test sol.alg isa SOSRA sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:Stratonovich]) -@test StochasticDiffEq.alg_interpretation(sol.alg) == :Stratonovich +@test SciMLBase.alg_interpretation(sol.alg) == + SciMLBase.AlgorithmInterpretation.Stratonovich @test sol.alg isa RKMil f = (du, u, p, t) -> du .= 1.01u From 266a77188ca1af4691c45171cb0aafcbac91a320 Mon Sep 17 00:00:00 2001 From: Hossein Pourbozorg Date: Sun, 1 Sep 2024 21:41:43 +0330 Subject: [PATCH 2/4] no caps according to docs --- src/sde_default_alg.jl | 2 +- test/default_sde_alg_test.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sde_default_alg.jl b/src/sde_default_alg.jl index 1cf4cefa..e71c0757 100644 --- a/src/sde_default_alg.jl +++ b/src/sde_default_alg.jl @@ -13,7 +13,7 @@ function default_algorithm( end is_stiff = :stiff ∈ alg_hints - is_stratonovich = :Stratonovich ∈ alg_hints + is_stratonovich = :stratonovich ∈ alg_hints if is_stiff || prob.f.mass_matrix !== I alg = ImplicitRKMil(autodiff = false) end diff --git a/test/default_sde_alg_test.jl b/test/default_sde_alg_test.jl index 688818a9..46819e82 100644 --- a/test/default_sde_alg_test.jl +++ b/test/default_sde_alg_test.jl @@ -18,7 +18,7 @@ sol = solve(prob, dt = 1 / 2^(3)) sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:additive]) @test sol.alg isa SOSRA -sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:Stratonovich]) +sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:stratonovich]) @test SciMLBase.alg_interpretation(sol.alg) == SciMLBase.AlgorithmInterpretation.Stratonovich @test sol.alg isa RKMil @@ -45,5 +45,5 @@ sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:stiff]) sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:additive]) @test sol.alg isa SOSRA -sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:Stratonovich]) +sol = solve(prob, dt = 1 / 2^(3), alg_hints = [:stratonovich]) @test sol.alg isa LambaEulerHeun From 97c55b80eb6854df87b3d1e9daed05dbae942846 Mon Sep 17 00:00:00 2001 From: Hossein Pourbozorg Date: Mon, 2 Sep 2024 01:40:23 +0330 Subject: [PATCH 3/4] update SciMLBase compat --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6cae09c7..228b5020 100644 --- a/Project.toml +++ b/Project.toml @@ -34,7 +34,7 @@ NonlinearSolve = "3" OrdinaryDiffEq = "6.53" RecursiveArrayTools = "3" Reexport = "1.0" -SciMLBase = "2" +SciMLBase = "2.51" SteadyStateDiffEq = "2" StochasticDiffEq = "6.61" Sundials = "4.19" From aed8d4827e852abda5d708ed6f2def541301764d Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 1 Sep 2024 22:43:37 -0400 Subject: [PATCH 4/4] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 228b5020..93449217 100644 --- a/Project.toml +++ b/Project.toml @@ -36,7 +36,7 @@ RecursiveArrayTools = "3" Reexport = "1.0" SciMLBase = "2.51" SteadyStateDiffEq = "2" -StochasticDiffEq = "6.61" +StochasticDiffEq = "6.69" Sundials = "4.19" julia = "1.9"