Skip to content

Instantly share code, notes, and snippets.

View profConradi's full-sized avatar
🎯
Focusing

Simone Conradi profConradi

🎯
Focusing
View GitHub Profile
@profConradi
profConradi / chladni.py
Last active May 6, 2024 20:58
Chladni Square Plate Normal Modes Simulation
def energy(z, n, m, L):
return np.cos(n* np.pi *np.real(z) / L) *np.cos(m *np.pi*np.imag(z) / L) - np.cos(m*np.pi*np.real(z)/ L) *np.cos(n* np.pi *np.imag(z) / L)
class ChladniPlate:
def __init__(self, n, m, L=1, n_particles=10000):
self.L = L
self.n_particles = n_particles
self.n = n
self.m = m
@profConradi
profConradi / Liapunov_exponent.py
Created February 18, 2024 19:02
Liapunov exponent
n_points = 3000
n_iter = 500
delta = 0.00001
a, b = np.meshgrid(np.linspace(np.pi/2, 3*np.pi/2, n_points), np.linspace(0, np.pi, n_points))
x = np.zeros(a.shape, dtype=np.float64)
y = np.zeros(a.shape, dtype=np.float64)
x_delta = np.zeros(a.shape, dtype=np.float64)+delta
y_delta = np.zeros(a.shape, dtype=np.float64)