@@ -127,6 +127,7 @@ introduced in [1] to study diffusion and chaos thresholds.
127127The *total* dimension of the system
128128is `2M`. The maps are coupled through `Γ`
129129and the `i`-th map has a nonlinear parameter `ks[i]`.
130+ The first `M` parameters are the `ks`, the `M+1`th parameter is `Γ`.
130131
131132The first `M` entries of the state are the angles, the last `M` are the momenta.
132133
@@ -151,7 +152,7 @@ function coupledstandardmaps(M::Int, u0 = 0.001rand(2M);
151152 J[i+ M, i+ M] = 1
152153 end
153154 sparseJ = sparse (J)
154- p = (ks, Γ)
155+ p = vcat (ks, Γ)
155156 csm (sparseJ, u0, p, 0 )
156157 return DDS (csm, u0, p, csm, sparseJ)
157158end
@@ -161,7 +162,7 @@ struct CoupledStandardMaps{N}
161162 idxsp1:: SVector{N, Int}
162163end
163164function (f:: CoupledStandardMaps{N} )(xnew:: AbstractVector , x, p, n) where {N}
164- ks, Γ = p
165+ ks = view (p, 1 : N); Γ = p[ end ]
165166 @inbounds for i in f. idxs
166167
167168 xnew[i+ N] = mod2pi (
@@ -171,12 +172,12 @@ function (f::CoupledStandardMaps{N})(xnew::AbstractVector, x, p, n) where {N}
171172
172173 xnew[i] = mod2pi (x[i] + xnew[i+ N])
173174 end
174- return nothing
175+ return xnew
175176end
176177function (f:: CoupledStandardMaps{M} )(
177178 J:: AbstractMatrix , x, p, n) where {M}
178179
179- ks, Γ = p
180+ ks = view (p, 1 : M); Γ = p[ end ]
180181 # x[i] ≡ θᵢ
181182 # x[[idxsp1[i]]] ≡ θᵢ+₁
182183 # x[[idxsm1[i]]] ≡ θᵢ-₁
@@ -328,6 +329,6 @@ function arnoldcat(u0 = rand(2))
328329end # Should give Lyapunov exponents [2.61803, 0.381966]
329330function arnoldcat_eom (u, p, n)
330331 x,y = u
331- return SVector {2} (2 x + y, x + y)
332+ return SVector {2} (( 2 x + y) % 1.0 , ( x + y) % 1 )
332333end
333334arnoldcat_jacob (u, p, n) = @SMatrix [2 1 ; 1 1 ]
0 commit comments