using DynamicalSystems, GLMakie, OrdinaryDiffEq
function rotor_1( u, params, t)
# @inbounds begin
θ1,pθ1,θ2,pθ2 = u
k,l = params
r = (sqrt(abs(2 + l^2 - 2*l*(cos(θ1)- cos(θ2)) - 2*cos(θ2-θ1))))
h = exp(-k*r) * (1+k*r) / r^3;
du1 = pθ1;
du2 = (h*(sin(θ1-θ2)+l*sin(θ1)))
du3 = pθ2;
du4 = (h*(sin(θ2-θ1)-l*sin(θ2)))
# end
return SVector{4}(du1,du2,du3,du4)
end
k = 2. #exponential factor
l = 1.5 #seperation distance
params = [k, l]
u0=[pi,0.0,-pi,0.] #indeed a fixed point of the system
diffeq = (alg = Vern7(), reltol = 1e-10, abstol = 1e-10 , atol=1e-10,rtol=1e-10)
rotor_system = CoupledODEs(rotor_1, u0, params; diffeq, t0 = 0.0)
Points, t = trajectory(rotor_system, 8000.0; Ttr = 0.0, Δt =0.1)
lines(t,columns(Points)[1]) # contradicts the results after time steps 100
this is my system as it depends on sin(θ2-θ1) and one obvious thing is
julia> sin(pi-0) + sin(0)
1.2246467991473532e-16
so this was causing Fixed points & Periodicity · ChaosTools.jl to not find the exact ones and misinterpreting the results.
I believe this has to do with floating error not the julia or dynamicalsystems.ji itself but how to tackle it?
I have looked into ~/.julia/packages/PredefinedDynamicalSystems/Af98t/src/continuous_famous_systems.jl
but couldn’t find one that has 2 angle parameters inside trignometric function.
Any help is much appreciated