Skip to content

Commit 3b837cc

Browse files
authored
fix some ODEs (#12)
* fix some ODEs * bump version --------- Co-authored-by: awage <>
1 parent dec9b5f commit 3b837cc

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PredefinedDynamicalSystems"
22
uuid = "31e2f376-db9e-427a-b76e-a14f56347a14"
33
repo = "https://github.com/JuliaDynamics/PredefinedDynamicalSystems.jl.git"
4-
version = "1.0.2"
4+
version = "1.0.3"
55

66
[deps]
77
DynamicalSystemsBase = "6e36e845-645a-534a-86f2-f5d4aa5a06b4"

src/continuous_famous_systems.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ function magnetic_pendulum(u = [sincos(0.12553*2π)..., 0, 0];
700700
γ = 1.0, d = 0.3, α = 0.2, ω = 0.5, N = 3, γs = fill(γ, N))
701701
m = MagneticPendulum([SVector(cos(2π*i/N), sin(2π*i/N)) for i in 1:N])
702702
p = MagneticPendulumParams(γs, d, α, ω)
703-
return ContinuousDynamicalSystem(m, u, p)
703+
return CoupledODEs(m, u, p)
704704
end
705705

706706
"""
@@ -716,7 +716,7 @@ Famous excitable system which emulates the firing of a neuron, with rule
716716
More details in the [Scholarpedia](http://www.scholarpedia.org/article/FitzHugh-Nagumo_model) entry.
717717
"""
718718
function fitzhugh_nagumo(u = 0.5ones(2); a=3.0, b=0.2, ε=0.01, I=0.0)
719-
ds = ContinuousDynamicalSystem(fitzhugh_nagumo_rule, u, [a, b, ε, I])
719+
ds = CoupledODEs(fitzhugh_nagumo_rule, u, [a, b, ε, I])
720720
end
721721
function fitzhugh_nagumo_rule(x, p, t)
722722
u, w = x
@@ -741,7 +741,7 @@ It is noteworthy because its strange attractor is multifractal with fractal dime
741741
Chaos Theory and Applications 2(2),1-3, 2020
742742
"""
743743
more_chaos_example(u = [0.0246, 0.79752, 0.3535866]) =
744-
ContinuousDynamicalSystem(more_chaos_rule, u, nothing)
744+
CoupledODEs(more_chaos_rule, u, nothing)
745745
function more_chaos_rule(u, p, t)
746746
x, y, z = u
747747
dx = y
@@ -772,8 +772,8 @@ See discussion in Section 4.4.3 of "Elegant Chaos" by J. C. Sprott.
772772
Thomas, R. (1999). *International Journal of Bifurcation and Chaos*,
773773
*9*(10), 1889-1905.
774774
"""
775-
thomas_cyclical(u0 = [1.0, 0, 0]; b = 0.2) = ContinuousDynamicalSystem(thomas_rule, u0, [b])
776-
labyrinth(u0 = [1.0, 0, 0]) = ContinuousDynamicalSystem(thomas_rule, u0, [0.0])
775+
thomas_cyclical(u0 = [1.0, 0, 0]; b = 0.2) = CoupledODEs(thomas_rule, u0, [b])
776+
labyrinth(u0 = [1.0, 0, 0]) = CoupledODEs(thomas_rule, u0, [0.0])
777777

778778
function thomas_rule(u, p, t)
779779
x,y,z = u
@@ -805,7 +805,7 @@ between the boxes (polar and equatorial ocean basins) and ``\\eta_i`` are parame
805805
Stommel, Thermohaline convection with two stable regimes of flow. Tellus, 13(2)
806806
"""
807807
function stommel_thermohaline(u = [0.3, 0.2]; η1 = 3.0, η2 = 1, η3 = 0.3)
808-
ds = ContinuousDynamicalSystem(stommel_thermohaline_rule, u, [η1, η2, η3],
808+
ds = CoupledODEs(stommel_thermohaline_rule, u, [η1, η2, η3],
809809
stommel_thermohaline_jacob)
810810
end
811811
function stommel_thermohaline_rule(x, p, t)
@@ -854,7 +854,7 @@ bsn, att = basins_of_attraction((xg, yg, zg), ds; mx_chk_att=4)
854854
Lorenz-84 low-order atmospheric circulation model, Chaos 18, 033121 (2008)
855855
"""
856856
function lorenz84(u = [0.1, 0.1, 0.1]; F=6.846, G=1.287, a=0.25, b=4.0)
857-
return ContinuousDynamicalSystem(lorenz84_rule, u, [F, G, a, b])
857+
return CoupledODEs(lorenz84_rule, u, [F, G, a, b])
858858
end
859859
@inline @inbounds function lorenz84_rule(u, p, t)
860860
F, G, a, b = p
@@ -901,7 +901,7 @@ bsn, att = basins_of_attraction((xg, yg), pmap)
901901
Int. Jour. Bifurcation and Chaos 24, 1450009 (2014)
902902
"""
903903
function lorenzdl(u = [0.1, 0.1, 0.1]; R=4.7)
904-
return ContinuousDynamicalSystem(lorenzdl_rule, u, R,
904+
return CoupledODEs(lorenzdl_rule, u, R,
905905
lorenzdl_rule_jacob)
906906
end
907907
@inline @inbounds function lorenzdl_rule(u, p, t)
@@ -941,7 +941,7 @@ The equations are:
941941
function coupled_roessler(u0=[1, -2, 0, 0.11, 0.2, 0.1];
942942
ω1 = 0.18, ω2 = 0.22, a = 0.2, b = 0.2, c = 5.7, k1 = 0.115, k2 = 0.0)
943943
p = [ω1, ω2, a, b, c, k1, k2]
944-
return ContinuousDynamicalSystem(coupled_roessler_f, u0, p)
944+
return CoupledODEs(coupled_roessler_f, u0, p)
945945
end
946946
function coupled_roessler_f(u,p,t)
947947
ω1, ω2, a, b, c, k1, k2 = p
@@ -973,7 +973,7 @@ function kuramoto(D = 25, u0 = range(0, 2π; length = D);
973973
K = 0.3, ω = range(-1, 1; length = D))
974974
p = KuramotoParams(K, ω)
975975
@warn "The kuramoto implementation does NOT have a Jacobian function!"
976-
return ContinuousDynamicalSystem(kuramoto_f, u0, p, (J,z0, p, n) -> nothing)
976+
return CoupledODEs(kuramoto_f, u0, p)
977977
end
978978
using Statistics: mean
979979
function kuramoto_f(du, u, p, t)
@@ -1671,7 +1671,7 @@ function multispecies_competition(option = 1)
16711671
p = CompetitionDynamicsParameters(option)
16721672
N = size(p.Ks, 2)
16731673
u0 = [[0.1 for i=1:N]; [S for S in p.Ss]]
1674-
ds = ContinuousDynamicalSystem(multispecies_competition_rule!, u0, p, (J, x, p, t) -> nothing)
1674+
ds = CoupledODEs(multispecies_competition_rule!, u0, p)
16751675
return ds
16761676
end
16771677

0 commit comments

Comments
 (0)