I am trying to solve the following differential equation using the python PyDDE package:
dy[i]/dt = w[i] + K/N * \sum{j=1toN} sin(y[j] -y[i]), where i = 1,2,3,4...N=50
Below is python code to solve this equation
from numpy import random, sin, arange, pi, array, zeros import PyDDE.pydde as p def odegrad(s, c, t): global N K = c[0] theta = s[0] w = random.standard_cauchy(N) for i in range(N): coup_sum = 0.0 for j in range(N): coup_sum += sin(theta[j] - theta[i]) theta[i] = w[i] + (K*coup_sum)/(float (N)) return array([theta])
I get the following error:
DDE error: something is wrong: is it possible that one of the supplied variables is of the wrong type?
DDE Error: Initialization of the Problem Failed!
DDE Error: DDE was not initialized correctly!
None
source share