Skip to content

Commit

Permalink
✅ Lyapunov exp of Lorentz sys + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianmarco Ducci committed Oct 25, 2020
1 parent f41da7a commit a58c46f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions multiflap/lorentz_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@

x = [10., 10., 3.6]

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

t_f = 100
n = 10000

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

print(lambda_t)
3 changes: 2 additions & 1 deletion multiflap/ms_package/lyapunov_exponents.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ def get_lyapunov_exponent(self):
fx_pert = integration_pert[-1, :]
d_j = fx_pert - fx
norm_d_j = np.linalg.norm(d_j)

# Re-scaling the flow separation
lambda_local[i] = np.log(norm_d_j/norm_d)
x = fx
x_pert = x + (d_j*(norm_d/norm_d_j))

lambda_t = np.sum(lambda_local)/(self.n*self.delta_time)
print(lambda_t)
return lambda_t

0 comments on commit a58c46f

Please sign in to comment.