Skip to content

Commit 454162c

Browse files
committed
CoupledSDEs test's
1 parent a27b135 commit 454162c

File tree

8 files changed

+83
-503
lines changed

8 files changed

+83
-503
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Dierckx = "0.5.3"
4545
DiffEqNoiseProcess = "5.22"
4646
DocStringExtensions = "0.9.3"
4747
Documenter = "^1.4.1"
48-
DynamicalSystemsBase = "3.11"
48+
DynamicalSystemsBase = "3.11.1"
4949
ExplicitImports = "1.9"
5050
Format = "1"
5151
ForwardDiff = "0.10.36"

src/CoupledSDEs.jl

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

src/CoupledSDEs_utils.jl

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

src/CriticalTransitions.jl

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module CriticalTransitions
22

33
# Base
44
using Statistics: Statistics, mean
5-
using LinearAlgebra: LinearAlgebra, I, norm, dot, tr #, Diagonal, tr
5+
using LinearAlgebra: LinearAlgebra, I, norm, dot, tr
66
using StaticArrays: StaticArrays, SVector
77

88
# Core
@@ -22,7 +22,7 @@ using StochasticDiffEq:
2222
using DynamicalSystemsBase:
2323
DynamicalSystemsBase,
2424
#ContinuousTimeDynamicalSystem,
25-
CoupledODEs,
25+
# CoupledODEs,
2626
CoupledSDEs,
2727
#StateSpaceSets,
2828
#dimension,
@@ -56,15 +56,9 @@ using Reexport: @reexport
5656
@reexport using StochasticDiffEq
5757
@reexport using DiffEqNoiseProcess
5858

59-
StochasticSystemsBase = Base.get_extension(DynamicalSystemsBase, :StochasticSystemsBase)
60-
covariance_matrix = StochasticSystemsBase.covariance_matrix
61-
diffusion_matrix = StochasticSystemsBase.diffusion_matrix
62-
6359
include("extention_functions.jl")
6460
include("utils.jl")
6561
include("system_utils.jl")
66-
#include("CoupledSDEs.jl")
67-
#include("CoupledSDEs_utils.jl")
6862
include("io.jl")
6963
include("trajectories/simulation.jl")
7064
include("trajectories/transition.jl")
@@ -79,13 +73,9 @@ using .CTLibrary
7973

8074
# Core types
8175
export CoupledSDEs,
82-
idfunc!,
83-
idfunc,
84-
add_noise_strength,
85-
#noise_process,
86-
#covariance_matrix,
87-
#noise_strength,
88-
CoupledODEs
76+
noise_process,
77+
covariance_matrix,
78+
diffusion_matrix
8979

9080
# Methods
9181
export equilib, basins, basinboundary, basboundary

src/system_utils.jl

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1+
StochasticSystemsBase = Base.get_extension(DynamicalSystemsBase, :StochasticSystemsBase)
2+
covariance_matrix = StochasticSystemsBase.covariance_matrix
3+
diffusion_matrix = StochasticSystemsBase.diffusion_matrix
4+
5+
"""
6+
StochSystem
7+
8+
An alias to [`CoupledSDEs`](@ref).
9+
This was the name these systems had in CriticalTransitions.jl before v0.3
10+
"""
11+
const StochSystem = CoupledSDEs
12+
113
"""
214
$(TYPEDSIGNATURES)
315
4-
Returns the deterministic drift ``f(x)`` of the CoupledSDEs `sys` at state `x`. For time-
5-
dependent systems, the time can be specified as a keyword argument `t` (by default `t=0`).
16+
Fetches the stochastic process ``\\mathcal{N}`` specified in the intergrator of `sys`. Returns the type `DiffEqNoiseProcess.NoiseProcess`.
17+
"""
18+
function noise_process(sys::CoupledSDEs)
19+
return sys.integ.W
20+
end
21+
22+
"""
23+
$(TYPEDSIGNATURES)
24+
25+
Returns the deterministic drift ``f(x)`` of the CoupledSDEs `sys` at state `x`. For time-dependent systems, the time can be specified as a keyword argument `t` (by default `t=0`).
626
"""
727
function drift(sys::CoupledSDEs{IIP}, x; t=0) where {IIP}
828
f = dynamic_rule(sys)
@@ -24,4 +44,4 @@ dependent systems, the time can be specified as a keyword argument `t` (by defau
2444
function div_drift(sys::CoupledSDEs, x; t=0)
2545
b(x) = drift(sys, x; t)
2646
return tr(ForwardDiff.jacobian(b, x))
27-
end;
47+
end;

0 commit comments

Comments
 (0)