In [ ]:
import numpy as np

# Constants.
x, y = 0, 0
n0 = 0.5
g = 9.8
rho = 1025
K = 0.02
l = 0.014
k = 0.014
w = 0.43
H = 100

X, t = np.linspace(1, 21, 200), np.linspace(1, 21, 200)

Equations:


In [ ]:
N = n0 * np.cos((k * x) + (l * y) - (w * t))
P0 = (rho * g * n0) / (np.cosh(K * H)) * np.cosh(K * (0 + H)) * np.cos((k * x) + (l * y)-(w * t))
U0 = ((k * g * n0) / w  * (np.cosh(K * H))) * np.cosh(K * (0 + H)) * np.cos((k * x) + (l * y)-(w * t))
V0 = ((l * g * n0) / w  * (np.cosh(K * H))) * np.cosh(K * (0 + H)) * np.cos((k * x) + (l * y)-(w * t))
W0 = ((k * g * n0) / w  * (np.cosh(K * H))) * np.sinh(K * (0 + H)) * np.sin((k * x) + (l * y)-(w * t))

P10 = (rho * g * n0) / (np.cosh(K * H)) * np.cosh(K * (-10 + H)) * np.cos((k * x) + (l * y)-(w * t))
U10 = ((k * g * n0) / w  * (np.cosh(K * H))) * np.cosh(K * (-10 + H)) * np.cos((k * x) + (l * y)-(w * t))
V10 = ((l * g * n0) / w  * (np.cosh(K * H))) * np.cosh(K * (-10 + H)) * np.cos((k * x) + (l * y)-(w * t))
W10 = ((k * g * n0) / w  * (np.cosh(K * H))) * np.sinh(K * (-10 + H)) * np.sin((k * x) + (l * y)-(w * t))

P50 = (rho * g * n0) / (np.cosh(K * H)) * np.cosh(K * (-50 + H)) * np.cos((k * x) + (l * y)-(w * t))
U50 = ((k * g * n0) / w  * (np.cosh(K * H))) * np.cosh(K * (-50 + H)) * np.cos((k * x) + (l * y)-(w * t))
V50 = ((l * g * n0) / w  * (np.cosh(K * H))) * np.cosh(K * (-50 + H)) * np.cos((k * x) + (l * y)-(w * t))
W50 = ((k * g * n0) / w  * (np.cosh(K * H))) * np.sinh(K * (-50 + H)) * np.sin((k * x) + (l * y)-(w * t))

P100 = (rho * g * n0) / (np.cosh(K * H)) * np.cosh(K * (-100 + H)) * np.cos((k * x) + (l * y)-(w * t))
U100 = ((k * g * n0) / w  * (np.cosh(K * H))) * np.cosh(K * (-100 + H)) * np.cos((k * x) + (l * y)-(w * t))
V100 = ((l * g * n0) / w  * (np.cosh(K * H))) * np.cosh(K * (-100 + H)) * np.cos((k * x) + (l * y)-(w * t))
W100 = ((k * g * n0) / w  * (np.cosh(K * H))) * np.sinh(K * (-100 + H)) * np.sin((k * x) + (l * y)-(w * t))

In [ ]:
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot(N)
ax.set_ylabel(r'$\eta$ [m]')
ax.set_xlabel('Time [s]')

fig, ax = plt.subplots()
ax.plot(X, U0, X, U10, X, U50, X, U100)
ax.set_ylabel(r'U [m s$^{-1}$]')
ax.set_xlabel('Time [s]')
ax.legend(('0 m', '10 m', '50 m', '100 m'))

fig, ax = plt.subplots()
ax.plot(X, V0, X, V10, X, V50, X, V100)
ax.set_ylabel(r'V [m s$^{-1}$]')
ax.set_xlabel('Time [s]')
ax.legend(('0 m', '10 m', '50 m', '100 m'))

fig, ax = plt.subplots()
ax.plot(X, W0, X, W10, X, W50, X, W100)
ax.set_ylabel(r'W [m s$^{-1}$]')
ax.set_xlabel('Time [s]')
ax.legend(('0 m', '10 m', '50 m', '100 m'))

fig, ax = plt.subplots()
ax.plot(X, P0, X, P10, X, P50, X, P100)
ax.set_ylabel('Pressure [Pa]')
ax.set_xlabel('Time [s]')
_ = ax.legend(('0 m', '10 m', '50 m', '100 m'))