Skip to content

Commit e23075f

Browse files
Merge pull request #2279 from ErikQQY/qqy/refactor_sde
Refactor SDEProblem constructor
2 parents 9376247 + e371f0f commit e23075f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ PrecompileTools = "1"
8585
RecursiveArrayTools = "2.3"
8686
Reexport = "0.2, 1"
8787
RuntimeGeneratedFunctions = "0.5.9"
88-
SciMLBase = "1.76.1"
88+
SciMLBase = "2.0.1"
8989
Setfield = "0.7, 0.8, 1"
9090
SimpleNonlinearSolve = "0.1.0"
9191
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0, 2"

src/systems/diffeqs/sdesystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ function DiffEqBase.SDEProblem{iip}(sys::SDESystem, u0map = [], tspan = get_tspa
583583
noise_rate_prototype = zeros(eltype(u0), size(noiseeqs))
584584
end
585585

586-
SDEProblem{iip}(f, f.g, u0, tspan, p; callback = cbs,
586+
SDEProblem{iip}(f, u0, tspan, p; callback = cbs,
587587
noise_rate_prototype = noise_rate_prototype, kwargs...)
588588
end
589589

@@ -648,7 +648,7 @@ function SDEProblemExpr{iip}(sys::SDESystem, u0map, tspan,
648648
tspan = $tspan
649649
p = $p
650650
noise_rate_prototype = $noise_rate_prototype
651-
SDEProblem(f, f.g, u0, tspan, p; noise_rate_prototype = noise_rate_prototype,
651+
SDEProblem(f, u0, tspan, p; noise_rate_prototype = noise_rate_prototype,
652652
$(kwargs...))
653653
end
654654
!linenumbers ? striplines(ex) : ex

test/sdesystem.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ f = eval(generate_diffusion_function(de)[1])
2525
@test f(ones(3), rand(3), nothing) == 0.1ones(3)
2626

2727
f = SDEFunction(de)
28-
prob = SDEProblem(SDEFunction(de), f.g, [1.0, 0.0, 0.0], (0.0, 100.0), (10.0, 26.0, 2.33))
28+
prob = SDEProblem(SDEFunction(de), [1.0, 0.0, 0.0], (0.0, 100.0), (10.0, 26.0, 2.33))
2929
sol = solve(prob, SRIW1(), seed = 1)
3030

31-
probexpr = SDEProblem(SDEFunction(de), f.g, [1.0, 0.0, 0.0], (0.0, 100.0),
31+
probexpr = SDEProblem(SDEFunction(de), [1.0, 0.0, 0.0], (0.0, 100.0),
3232
(10.0, 26.0, 2.33))
3333
solexpr = solve(eval(probexpr), SRIW1(), seed = 1)
3434

@@ -55,7 +55,7 @@ f(du, [1, 2, 3.0], [0.1, 0.2, 0.3], nothing)
5555
0.2 0.3 0.01*3]
5656

5757
f = SDEFunction(de)
58-
prob = SDEProblem(SDEFunction(de), f.g, [1.0, 0.0, 0.0], (0.0, 100.0), (10.0, 26.0, 2.33),
58+
prob = SDEProblem(SDEFunction(de), [1.0, 0.0, 0.0], (0.0, 100.0), (10.0, 26.0, 2.33),
5959
noise_rate_prototype = zeros(3, 3))
6060
sol = solve(prob, EM(), dt = 0.001)
6161

0 commit comments

Comments
 (0)