homework4_1


In [ ]:
import numpy as np
import matplotlib.pyplot as plt
from oceans.sw_extras.waves import Waves

In [ ]:
T = 20  # Period in seconds.
h = np.linspace(0.1, 450, 100)  # Depth vector from 0 to 450 meters.

w = Waves(T, h)  # Compute the wave caracteristics.
a = w.Ks * 2.33  # Compute amplidute with a shoaling coefficient "Ks."

In [ ]:
fig, ax = plt.subplots()
ax.plot(h, a)
ax.set_xlabel(r'$h$ [m]')
ax.set_ylabel(r'$a$ [cm]')
_ = ax.set_title(r'$a$ as a function of $h$')