-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrivals.jl
48 lines (40 loc) · 1.77 KB
/
rivals.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
rivals!(du, u, p, t)
In-place definition of the Rivals system.
See also [`rivals`](@ref).
"""
function rivals!(du, u, p, t)
x, y = u
ϵ, α₁, α₂, β₁, β₂ = p
du[1] = x * (x - α₁) * (1 - x) - β₁ * x * y
return du[2] = ϵ * (y * (y - α₂) * (1 - y) - β₂ * x * y)
end
"""
rivals(u, p, t)
Out-of-place definition of the Rivals system.
See also [`rivals!`](@ref).
"""
function rivals(u, p, t)
x, y = u
ϵ, α₁, α₂, β₁, β₂ = p
dx = x * (x - α₁) * (1 - x) - β₁ * x * y
dy = ϵ * (y * (y - α₂) * (1 - y) - β₂ * x * y)
return SA[dx, dy]
end
# """
# rivals_ϵσ(ϵ,σ)
# A shortcut command for returning a CoupledSDEs of the Rivals system in a default setup with multiplicative isotropic noise.
# This setup fixes the parameters α₁ = 0.1, α₂ = 0.3, β₁ = 0.18, β₂ = 0.1 and leaves the value of the time-scale parameter ϵ as a function argument. The prescribed noise process is multiplicative and isotropic: the variables are peturbed by independently drawn identical Gaussian white noise realisations (with standard deviation σ - the other function argument) that are multiplied by the variables' current value.
# """
# function rivals_ϵσ(ϵ, σ) # a convenient two-parameter version of the FitzHugh Nagumo system
# # defining the CoupledSDEs
# f(u,p,t) = rivals(u,p,t);
# α₁ = 0.1; α₂ = 0.3; β₁ = 0.18; β₂ = 0.1; # standard parameters without ϵ (time-scale separation parameter)
# pf_wo_ϵ = [α₁, α₂, β₁, β₂]; # parameter vector without ϵ
# dim = 2;
# g(u,p,t) = multiplicative_idx(u,p,t,[true,true]);
# pg = nothing;
# Σ = [1 0; 0 1];
# process = "WhiteGauss";
# CoupledSDEs(f, vcat([ϵ], pf_wo_ϵ), dim, σ, g, pg, Σ, process)
# end;