Skip to content

Commit 43ad5e9

Browse files
committed
change coupled sde example to use trajectory
1 parent f169386 commit 43ad5e9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

docs/src/CoupledSDEs.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ Lyapunov spectrum of a `CoupledSDEs` in the absence of noise, here exemplified b
3535
FitzHugh-Nagumo model, can be computed by typing:
3636

3737
```julia
38-
using DynamicalSystems
38+
using DynamicalSystemsBase, StaticArrays
39+
using DynamicalSystemsBase: idfunc
3940

4041
function fitzhugh_nagumo(u, p, t)
4142
x, y = u
@@ -47,8 +48,8 @@ function fitzhugh_nagumo(u, p, t)
4748
return SA[dx, dy]
4849
end
4950

50-
sys = CoupledSDEs(fitzhugh_nagumo, idfunc, zeros(2), [1.,3.,1.,1.,1.,0.], 0.1)
51-
ls = lyapunovspectrum(CoupledODEs(sys), 10000)
51+
sde = CoupledSDEs(fitzhugh_nagumo, idfunc, zeros(2), [1.,3.,1.,1.,1.,0.], 0.1)
52+
tr = trajectory(sde, 10)
5253
```
5354

5455
## Available noise processes

src/core_systems/continuous_time_sde.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ end
183183
184184
Converts a [`CoupledSDEs`](@ref) into [`CoupledODEs`](@ref).
185185
"""
186-
function CoupledODEs(sys::CoupledSDEs; diffeq=DEFAULT_STOCH_DIFFEQ, t0=0.0)
186+
function CoupledODEs(sys::CoupledSDEs; diffeq=DEFAULT_DIFFEQ, t0=0.0)
187187
return CoupledODEs(
188188
sys.integ.f, SVector{length(sys.integ.u)}(sys.integ.u), sys.p0; diffeq=diffeq, t0=t0
189189
)
@@ -262,7 +262,7 @@ Identity function for a diffusion function `g` of `CoupledSDEs` (out-of-place).
262262
Equivalent to `(u, p, t) -> ones(length(u))`,
263263
"""
264264
function idfunc(u, p, t)
265-
return typeof(u)(ones(eltype(u), length(u)))
265+
return SVector{length(u)}(ones(eltype(u), length(u)))
266266
end;
267267

268268
"""

0 commit comments

Comments
 (0)