Accuracy of method of integration DifferentialEquations.jl

I have limit cycle in phase space, when i scale trajectory in phase space i see different lines.



This is due to the accuracy of the integration method or this is problem of CairoMakie?
Code:

function Res(u, p, t)
    du1 = -u[2]-u[3]
    du2 = u[1]+p[1]*u[2]
    du3 = p[2]*u[1]-p[3]*u[3]+u[1]*u[3]
    return SA[du1, du2, du3]
end;
t = 500; tstep = 0.0001; Tt = 1000
trange = range(0.0, t, step = tstep)
integ_set = (alg = Vern9(), adaptive = false, dt = tstep);
const b = 0.3; const c = 4.9
a = 0.08;
u0 = SA[0.1, 0.3, 0.5]
p = SA[a, b, c]
ds = CoupledODEs(Res, u0, p, diffeq = integ_set)
tr, _ = trajectory(ds, t, Δt = tstep; Ttr = Tt)

That’s just an accuracy thing. RK methods have drift. See:

https://docs.sciml.ai/DiffEqDocs/stable/examples/kepler_problem/

1 Like

Thank you
How can i fix this? I have another system where the situation is the same. I need increased accuracy , since there is a homoclinic and Shilnikov attractor. Also, when trying to build a Poincare mapping, I observe this drift

Use a symplectic integrator if it’s a symplectic system?

I do not know how to check if my system is such, but i think not
In early works, everyone used the Runge-Kutta integration method of 4 order

Which has this drift. And in general it’s fine. Its error is dependent on the size of dt. Lower the tolerance and it decreases. Vern9 with a low tolerance will be pretty small. But non-zero.

I have adaptive = false, dt = 0.001
I will try lower dt, thank you

Can you share additional reference where i can read about drift?

2 Likes