Upload 16 files
Browse files
generator.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The included pre-generated Mackey-Glass time series were generated on
|
| 2 |
+
# an M1 machine using the following script. Note that due to the reliance
|
| 3 |
+
# of jitcdde on lower-level solvers, this script may not produce the same
|
| 4 |
+
# results on different machines. (Tested on various x64 and M1 architectures,
|
| 5 |
+
# with consistent library versions.)
|
| 6 |
+
# Thus it is recommended to use the pre-generated time series.
|
| 7 |
+
|
| 8 |
+
# generates mackey-glass time series using jitcdde
|
| 9 |
+
from jitcdde import jitcdde, y, t
|
| 10 |
+
import numpy as np
|
| 11 |
+
import csv
|
| 12 |
+
|
| 13 |
+
def generator(tau, lyap_time, initial_condition):
|
| 14 |
+
# MG parameters
|
| 15 |
+
beta = 0.2
|
| 16 |
+
gamma = 0.1
|
| 17 |
+
n = 10
|
| 18 |
+
|
| 19 |
+
# total time to integrate, 50 lyapunov times
|
| 20 |
+
total_time = lyap_time*50
|
| 21 |
+
|
| 22 |
+
# number of steps to integrate: 50 lyap_times, 75 steps each, plus one to eval
|
| 23 |
+
steps = 50 * 75 + 1
|
| 24 |
+
|
| 25 |
+
f = [beta*y(0,t-tau)/(1+y(0,t-tau)**n)-gamma*y(0)]
|
| 26 |
+
DDE = jitcdde(f)
|
| 27 |
+
|
| 28 |
+
# shrink integration parameters
|
| 29 |
+
DDE.set_integration_parameters(atol=1e-17, rtol=1e-17, min_step=1e-17)
|
| 30 |
+
|
| 31 |
+
DDE.constant_past([initial_condition])
|
| 32 |
+
DDE.step_on_discontinuities()
|
| 33 |
+
|
| 34 |
+
# generate
|
| 35 |
+
data = []
|
| 36 |
+
for time in np.linspace(DDE.t, DDE.t+total_time, steps):
|
| 37 |
+
data.append(DDE.integrate(time)[0])
|
| 38 |
+
|
| 39 |
+
return np.array(data)
|
| 40 |
+
|
| 41 |
+
if __name__ == '__main__':
|
| 42 |
+
taus = []
|
| 43 |
+
lyap_times = []
|
| 44 |
+
initial_conditions = []
|
| 45 |
+
|
| 46 |
+
# read csv
|
| 47 |
+
with open('mackey_glass_parameters.csv', newline='') as csvfile:
|
| 48 |
+
reader = csv.reader(csvfile, delimiter=',')
|
| 49 |
+
for row in reader:
|
| 50 |
+
# skip header
|
| 51 |
+
if row[0] == 'tau':
|
| 52 |
+
continue
|
| 53 |
+
taus.append(int(row[0]))
|
| 54 |
+
lyap_times.append(int(row[1]))
|
| 55 |
+
initial_conditions.append(float(row[2]))
|
| 56 |
+
|
| 57 |
+
# generate
|
| 58 |
+
for tau, lyap_time, initial_condition in zip(taus, lyap_times, initial_conditions):
|
| 59 |
+
data = generator(tau, lyap_time, initial_condition)
|
| 60 |
+
assert(len(data) == 50*75+1)
|
| 61 |
+
np.save('mg_{}.npy'.format(tau), data)
|
| 62 |
+
|
mackey_glass_parameters.csv
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tau,lyapunov_time,initial_condition
|
| 2 |
+
17,197,0.7206597
|
| 3 |
+
18,138,0.7744313
|
| 4 |
+
19,315,0.7783468
|
| 5 |
+
20,131,0.9225991
|
| 6 |
+
21,191,0.9479431
|
| 7 |
+
22,119,0.5455960
|
| 8 |
+
23,106,0.8622247
|
| 9 |
+
24,97,0.3259660
|
| 10 |
+
25,98,0.8297825
|
| 11 |
+
26,104,1.0033490
|
| 12 |
+
27,112,0.6491406
|
| 13 |
+
28,119,1.0957495
|
| 14 |
+
29,131,0.9256179
|
| 15 |
+
30,139,0.2713639
|
mg_17.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5a38b38eca91667c120a3fbbe1a27859ef6071c521a03753ef1cace39d3ce745
|
| 3 |
+
size 30136
|
mg_18.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f43853cdd3e862c30b0836e07a57a438a6f415d8f0afa91ab850f9a6d84d298b
|
| 3 |
+
size 30136
|
mg_19.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1de21d6bf519d0286b618b3563a60f00e220e641815b491d1d524eacd6f67afd
|
| 3 |
+
size 30136
|
mg_20.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:699311e052410184db0f123335eb25bb076bd6beccd32e00fa981690dbc391f6
|
| 3 |
+
size 30136
|
mg_21.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11087f595ca3e964a236f944e246ad2ebe227896177d5652d03fba8c21d0469e
|
| 3 |
+
size 30136
|
mg_22.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49d214dd59611ae1573ff37d215b2a61d53721b770a8143b8eb2331e9a6a9a12
|
| 3 |
+
size 30136
|
mg_23.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01d0069db4cedcd060979af2e984e708ec2f4c9a6d2f716185a70682c1e97379
|
| 3 |
+
size 30136
|
mg_24.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd5f911a0c5348f5cd56bc3c2081d8eac8a551d0a7d9d9f462634b08491b8d2a
|
| 3 |
+
size 30136
|
mg_25.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:661bb643eafa49282cb82e432b40abb167d8047a39a348e009b8cd5478e6fb4f
|
| 3 |
+
size 30136
|
mg_26.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cde16f2fec2621e54f678c86c06c80f86ddff6ec636e2541ffb0e071647da838
|
| 3 |
+
size 30136
|
mg_27.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0196d4820df10c6cea0de1e107c764b0e5efcb4ef055059d45a142b02a35c119
|
| 3 |
+
size 30136
|
mg_28.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed680acfb0b08f6f2fd3a26332a9fa1ceeb064fd36c72279898b4814fbdf1692
|
| 3 |
+
size 30136
|
mg_29.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b34f4e1a69f54605106e89da941160b29dd3762a28274c2b2ba8cc4741cc8cd0
|
| 3 |
+
size 30136
|
mg_30.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ddd5311028f66cf54b67e3529eb765f4472ef75476f5cd65081b340132f026a
|
| 3 |
+
size 30136
|