neurophysik / jitcdde

Just-in-time compilation for delay differential equations
Other
57 stars 14 forks source link

Example Kuramoto model does not include time delay when omega=1 gets changed to random omegas #14

Closed wjadvos closed 5 years ago

wjadvos commented 5 years ago

Thanks for making this package, it is exactly what I need for my master's thesis on explosive synchronisation in the Kuramoto model.

I have the following problem: when I use your example code on the Kuramoto model (https://github.com/neurophysik/jitcdde/blob/master/examples/kuramoto_network.py) and only do the following changes: fix tau to a fixed number (say 5) and take omega from a distribution.

I get the following warning "differential equation does not include a delay term", although in the code there is still written a delay term (tau is a fixed non-zero number, this also happens when I keep tau a random distribution)

from jitcdde import jitcdde, y, t
from numpy import pi, arange, random, max
from symengine import sin

n = 100
ω = random.uniform(0,1,n)
c = 0
q = 0.05
A = random.choice( [1,0], size=(n,n), p=[q,1-q] )

def kuramotos():
    for i in range(n):
        yield ω [i]+ c/(n-1)*sum(
                    sin(y(j,t-5)-y(i))
                    for j in range(n)
                    if A[j,i]
                    )

I = jitcdde(kuramotos,n=n,verbose=False)
I.set_integration_parameters(rtol=0,atol=1e-5)

I.constant_past( random.uniform(0,2*pi,n), time=0.0 )
I.integrate_blindly( max(τ) , 0.1 )

for time in I.t + arange(0,400,0.2):
    print(*I.integrate(time) % (2*pi)) 
Wrzlprmft commented 5 years ago

In your example, you set c=0. As a result the entire coupling term vanishes (and since this is a symbolic computation it really is completely gone) and your differential equation is reduced to ẏᵢ = ωᵢ. As this does not include a delay term, you get the warning.

wjadvos commented 5 years ago

Oh yes, thanks for the clarification