Skip to content

Commit a58c46f

Browse files
author
Gianmarco Ducci
committed
✅ Lyapunov exp of Lorentz sys + cleanup
1 parent f41da7a commit a58c46f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

multiflap/lorentz_main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@
2727

2828
x = [10., 10., 3.6]
2929

30+
# Creating the object containing the eqs
3031
mymodel = Lorentz(a=10, b=28, c=8/3)
3132

3233
t_f = 100
3334
n = 10000
3435

36+
# calling the LyapunovExponents class
3537
lambda_t = LyapunovExponents(x, n, t_f, mymodel).get_lyapunov_exponent()
3638

3739
print(lambda_t)

multiflap/ms_package/lyapunov_exponents.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ def get_lyapunov_exponent(self):
8383
fx_pert = integration_pert[-1, :]
8484
d_j = fx_pert - fx
8585
norm_d_j = np.linalg.norm(d_j)
86+
87+
# Re-scaling the flow separation
8688
lambda_local[i] = np.log(norm_d_j/norm_d)
8789
x = fx
8890
x_pert = x + (d_j*(norm_d/norm_d_j))
8991

9092
lambda_t = np.sum(lambda_local)/(self.n*self.delta_time)
91-
print(lambda_t)
9293
return lambda_t

0 commit comments

Comments
 (0)