def setUp(self): DDE_orig = jitcdde_lyap(f, n_lyap=len(lyap_controls)) filename = DDE_orig.save_compiled(overwrite=True) self.DDE = jitcdde_lyap(n=6, module_location=filename, delays=[delay], n_lyap=len(lyap_controls)) self.DDE.add_past_point(-delay, np.random.random(6), np.random.random(6)) self.DDE.add_past_point(0.0, np.random.random(6), np.random.random(6)) self.DDE.set_integration_parameters(**test_parameters)
def setUp(self): DDE_orig = jitcdde_lyap(f, n_lyap=len(lyap_controls)) filename = DDE_orig.save_compiled(overwrite=True) print(filename) self.DDE = jitcdde_lyap( n=6, module_location=filename, delays=[delay], n_lyap=len(lyap_controls) ) self.DDE.add_past_point(-delay, np.random.random(6), np.random.random(6)) self.DDE.add_past_point(0.0, np.random.random(6), np.random.random(6)) self.DDE.set_integration_parameters(**test_parameters)
def setUp(self): self.DDE = jitcdde_lyap(f, n_lyap=len(lyap_controls)) self.DDE.add_past_point(-delay, np.random.random(6), np.random.random(6)) self.DDE.add_past_point(0.0, np.random.random(6), np.random.random(6)) self.DDE.set_integration_parameters(**test_parameters) self.DDE.compile_C(omp=True, chunk_size=15)
Note that `integrate` does not only return local Lyapunov exponents but also the length of the time interval to which they apply (which differs from the time spanned by the `integrate` command and may even be zero). This length should be used to weigh the local Lyapunov exponents for statistical processing, like in line 31. """ if __name__ == "__main__": from jitcdde import jitcdde_lyap, y, t import numpy from scipy.stats import sem τ = 15 n = 10 β = 0.25 γ = 0.1 f = [ β * y(0,t-τ) / (1 + y(0,t-τ)**n) - γ*y(0) ] n_lyap = 4 DDE = jitcdde_lyap(f, n_lyap=n_lyap) DDE.constant_past([1.0]) DDE.step_on_discontinuities(max_step=1.0) data = [] lyaps = [] weights = [] for time in numpy.arange(DDE.t, DDE.t+10000, 10): state, lyap, weight = DDE.integrate(time) data.append(state) lyaps.append(lyap) weights.append(weight) numpy.savetxt("timeseries.dat", data)
def setUp(self): self.DDE = jitcdde_lyap(f, n_lyap=len(lyap_controls)) self.DDE.add_past_point(-delay, np.random.random(6), np.random.random(6)) self.DDE.add_past_point(0.0, np.random.random(6), np.random.random(6)) self.DDE.set_integration_parameters(**test_parameters) self.DDE.compile_C(omp=True,chunk_size=15)