In [ ]:
import numpy as np
twopi = 2.0 * np.pi
x = 0.0
No = 10
L = 200
K = 2 * np.pi / L
H = 10.
g = 9.8
w = np.sqrt(g * K ** 2 * H) # FIXME!
T = 2 * np.pi / w
t = twopi * np.linspace(0, T, 100)
In [ ]:
HoL = H/L
HoL
Using 10% of difference in $\delta k$ and $\delta \omega$.
In [ ]:
dk = 0.1 * K
dw = 0.1 * w
Using the equations from our notes:
$\eta_1 = \eta_o \cos[(K + \delta k)x - (\omega + \delta\omega)t]$
$\eta_2 = \eta_o \cos[(K - \delta k)x - (\omega - \delta\omega)t]$
In [ ]:
eta_1 = No * np.cos((K + dk) * x - (w + dw) * t)
eta_2 = No * np.cos((K - dk) * x - (w - dw) * t)
In [ ]:
import matplotlib.pyplot as plt
fig, (ax0, ax1) = plt.subplots(nrows=2, ncols=1, figsize=(8, 4), sharex=True)
ax0.plot(t, eta_1, 'g', label=r'\eta_1')
ax0.plot(t, eta_2, 'b', label=r'\eta_2')
_ = ax1.plot(t, eta_1 + eta_2, 'k', label=r'\eta_1 + \eta_2')