# Simulations of Kuramoto Model

#### Jakes

I'm trying to understand and computationally model the Kuramoto Model. This is a mathematical model used to describe synchronization (phase locking of a set of $N$ oscillators). The governing equations: $$\frac{d \theta_i}{dt} = \omega_i + \frac{K}{N}\sum_{j=1}^{N}\sin(\theta_j - \theta_i)~~~~~~~~i=1...N$$
where the system is composed of $N$ oscillators, with phases $\theta_i$ and coupling $K$.

As I understand, these phases $\theta_i$ refer to the respective phases of each oscillator. For an individual harmonic oscillator this would be $\phi$ in $$x(t) = A \cos(\omega t + \phi).$$

Consider this animation which shows various levels of phase locking by plotting the phases of the respective oscillators as a function of time.

Question: I'm trying to find a viable numerical scheme used to produce this type of animation. Would it be viable to use the transformation $$re^{i \psi} = \frac{1}{N} \sum_{j=1}^{N}e^{\theta_j}$$ which allows a reformulation of the governing equations to $$\frac{d \theta_i}{d t} = \omega_i - Kr \sin(\theta_i).$$ As described in the wiki entry Kuramoto model. Then using some initial phase values $\theta_i$, together with the reformulated governing equations, we could map out the evolution of each individual phase as in the animation. Is this a viable numeric scheme for producing the animation which shows phase locking?

#### donglebox

I haven't tried this ，Maybe the method mentioned here is wrong. Please forgive the bad grammar writing.

I will first set a circle track sequence, according to the size of the picture you want to draw, in the middle of the screen origin, take a point, set a suitable radius, and calculate all its plane coordinates. I will set a pixel size as a coordinate, and save these coordinates in an array.

Then, the size of this array can be used as a global number of track points, which is the first step to establish a working benchmark.

That is to say, no matter how long the time is, each ball travels at these coordinate points. According to the current speed and position of the ball, read the next position of this table.

Then, for each ball, set a step time, which represents the cycle period T or the actual time （ms） required for the ball to move one grid.
So that each ball moves one grid by different time intervals,

----For the ball rolling in non-uniform circular motion

In the whole circular motion, three segments of data, acceleration segment, deceleration segment and average speed segment need to be calculated,

You need to preset the starting point angle, the number of passing points in the acceleration section, the number of passing points in the deceleration section, and the number of passing points in the uniform motion.

The number of points in the variable speed segment is obtained, and then the time interval required for moving each point is calculated in turn. Store the value in the array corresponding to the ball.

Starting from the clock 12 o'clock (90 degrees), a table of relative transformation time is calculated separately for the variable-speed ball,
which means that the table of acceleration and deceleration time is calculated according to the highest speed and the lowest speed .
Each number in the table represents the actual time needed to move a pixel grid,
These time values gradually increase and decrease in the time table.

And the total length of this table is the same as the first table.

So, to plot the trajectory of this ball, you only need to read the (waiting time) value in the table every time,

After the specified ms time / or cycle.
Then read the next point of the global table,
Draw the next point of the ball on the screen.

If you want to specify the starting angle of the ball, you need to move the table data by several cells.

After that, you should be able to use the minimum and maximum speed of the ball as parameters that can be adjusted to calculate the relative transformation table at any time.
Next you can think about any little ball you want to roll
This method can also be used to draw the waveform.

When you're familiar with the approach, consider simplifying it in a way that seems simpler. For example, use variable return instead of waiting table.

topsquark