-
Notifications
You must be signed in to change notification settings - Fork 1
Chaos Synchronization
Analyze chaos synchronization.
Use the Synchronization class to analyze chaos synchronization.
Set the data transmitted by the oscillator with .signal.
This class needs to define the sender and the receiver.
In many papers, they are referred to as Drive and Response, but in this library they are referred to as leading and supporting.
In addition to taking t and u as arguments, methods can receive data. Any name is available.
An example of class inheritance is shown with an example using coupling_oneway.
- o1
- o2
- N
- **params
Here is an example of the synchronization of the famous Lorenz oscillator.
First, create a Pecora that inherits from the Lorenz and the Synchronization.
Next, the synchronization is advanced by connecting the two oscillators with coupling_oneway.
The number of calculations is N.
Draw and check the trajectory and error during synchronization.
from hundun import Synchronization, coupling_oneway, Drawing
from hundun.equations import Lorenz
import numpy as np
class Pecora(Lorenz, Synchronization):
def signal(self):
self.signal_sent = self.u[0]
return self.u[0]
def leading(self, t, u):
s, r, b = self.s, self.r, self.b
x, y, z = u
x_dot = s*(y - x)
y_dot = r*self.signal_sent - y - self.signal_sent *z
z_dot = self.signal_sent *y - b*z
return x_dot, y_dot, z_dot
def supporting(self, t, u, signal_received):
x_rec = signal_received
s, r, b = self.s, self.r, self.b
x, y, z = u
x_dot = s*(y - x)
y_dot = r*x_rec - y - x_rec *z
z_dot = x_rec *y - b*z
return x_dot, y_dot, z_dot
o1 = Pecora.on_attractor()
o2 = Pecora.on_attractor()
o1, o2 = coupling_oneway(o1, o2, 1000)
d = Drawing.plot_a_and_b(o1.u_seq, o2.u_seq)
d.show()
d.close()
d = Drawing()
for i in range(3):
e = o1.u_seq[:, i]-o2.u_seq[:, i]
d[0,0].plot(np.log(np.abs(e)), label=f'$e_{i+1}$')
d[0,0].set_axis_label('step', 'error')
d[0,0].legend()
d.show()
d.close()

(1990) Pecora, Louis M. and Carroll, Thomas L.
DOI: 10.1103/PhysRevLett.64.821