Skip to content

Commit dc284af

Browse files
MasonProtterChrisRackauckas
authored andcommitted
depend directly on DiffEqNoiseProcess
1 parent 033f0cd commit dc284af

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
1212
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
1313
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
1414
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
15+
DiffEqNoiseProcess = "77a26b50-5914-5dd7-bc55-306e6241c503"
1516
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
1617
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
1718
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
@@ -56,12 +57,10 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
5657
[weakdeps]
5758
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
5859
DeepDiffs = "ab62b9b5-e342-54a8-a765-a90f495de1a6"
59-
DiffEqNoiseProcess = "77a26b50-5914-5dd7-bc55-306e6241c503"
6060

6161
[extensions]
6262
MTKBifurcationKitExt = "BifurcationKit"
6363
MTKDeepDiffsExt = "DeepDiffs"
64-
MTKDiffEqNoiseProcess = "DiffEqNoiseProcess"
6564

6665
[compat]
6766
AbstractTrees = "0.3, 0.4"
@@ -74,6 +73,7 @@ DataStructures = "0.17, 0.18"
7473
DeepDiffs = "1"
7574
DiffEqBase = "6.103.0"
7675
DiffEqCallbacks = "2.16, 3"
76+
DiffEqNoiseProcess = "5"
7777
DiffRules = "0.1, 1.0"
7878
Distributed = "1"
7979
Distributions = "0.23, 0.24, 0.25"

ext/MTKDiffEqNoiseProcess.jl

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/ModelingToolkit.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ using DiffEqCallbacks
2222
using Graphs
2323
import ExprTools: splitdef, combinedef
2424
import OrderedCollections
25+
using DiffEqNoiseProcess: DiffEqNoiseProcess, WienerProcess
2526

2627
using SymbolicIndexingInterface
2728
using LinearAlgebra, SparseArrays, LabelledArrays

src/systems/diffeqs/sdesystem.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,6 @@ function SDEFunctionExpr(sys::SDESystem, args...; kwargs...)
615615
SDEFunctionExpr{true}(sys, args...; kwargs...)
616616
end
617617

618-
function scalar_noise end # defined in ../ext/MTKDiffEqNoiseProcess.jl
619-
620618
function DiffEqBase.SDEProblem{iip, specialize}(
621619
sys::SDESystem, u0map = [], tspan = get_tspan(sys),
622620
parammap = DiffEqBase.NullParameters();
@@ -636,7 +634,7 @@ function DiffEqBase.SDEProblem{iip, specialize}(
636634
if noiseeqs isa AbstractVector
637635
noise_rate_prototype = nothing
638636
if is_scalar_noise
639-
noise = scalar_noise()
637+
noise = WienerProcess(0.0, 0.0, 0.0)
640638
else
641639
noise = nothing
642640
end
@@ -721,14 +719,18 @@ function SDEProblemExpr{iip}(sys::SDESystem, u0map, tspan,
721719
if noiseeqs isa AbstractVector
722720
noise_rate_prototype = nothing
723721
if is_scalar_noise
724-
noise = scalar_noise()
722+
noise = WienerProcess(0.0, 0.0, 0.0)
723+
else
724+
noise = nothing
725725
end
726726
elseif sparsenoise
727727
I, J, V = findnz(SparseArrays.sparse(noiseeqs))
728728
noise_rate_prototype = SparseArrays.sparse(I, J, zero(eltype(u0)))
729+
noise = nothing
729730
else
730731
T = u0 === nothing ? Float64 : eltype(u0)
731732
noise_rate_prototype = zeros(T, size(get_noiseeqs(sys)))
733+
noise = nothing
732734
end
733735
ex = quote
734736
f = $f

0 commit comments

Comments
 (0)