Utforskning: tidevann
Background
Tidal oscillations originate from the gravitational interactions between the Earth and other celestial bodies, especially the Sun and the Moon. variations in the sun and the moon position relative to the Earth, give rise to periodic motions with different frequencies. You can think of the total tides as the sum of many waves with slightly different frequencies (\(\omega\)), amplitudes (\(A\)) and phases (\(\phi\)). Consider the following sine wave equation and Figure 1 below:
$$y_1 = A_1 \cdot \sin(\omega_1 \cdot x - \phi_1) \text{ (blue)}$$ $$y_2 = A_2 \cdot \sin(\omega_2 \cdot x - \phi_2) \text{ (green)}$$
Figure 1: Comparison of different sine waves. Source: pngkey.com.
\(A\): this is the magnitude of the wave. If you keep all the other parameters fixed but change the amplitude (\(A_1 = 1, A_2 = 0.5\)), you will obtain the waves in the top-left panel in Figure 1.
\(\omega\): this is the frequency (which is the inverse of the period: \(T = \frac{1}{f}\)) of the wave. It represents how many cycles of the signal are present in a given amount of time (say 1 second). If a signal Y1 has higher frequency (or lower period) than Y2, it means that Y1 presents more crests and troughs than Y2. Using the equation above, if you fix the other parameters but change the frequency \((\omega_1 = 2\pi, \omega_2 = 4\pi)\), you will get the waves in the bottom-left panel in Figure 1. Since is twice , you get the double amount of crests and troughs per unit of time.
\(\phi\): this is the phase of the wave. It represents the ‘position’ of the wave features (crest, throughs, ascending og descending motion) in time or space. For example, if you take a pure sine wave \(y=\sin(x)\) (where \(\phi=0)\), the crest occurs when \(x\) takes the values \(\pi, 2\pi, 4\pi, 6\pi\), and so forth. If you change \(\phi\) to \(\frac{2}{\pi}\) (so that \(y = \sin(x - \frac{\pi}{2})\)), you will shift your signal by this angle, so the crest will now occur when \(x\) takes the values \(\frac{\pi}{2}, (2\pi + \frac{\pi}{2}), (4\pi + \frac{\pi}{2}), (6\pi + \frac{\pi}{2})\), and so on. Two waves are said to be in phase, if their crests and troughs are occur at the same \(x\)-values. If there is an offset between them, they are out of phase. Going back to our \(y_1\) and \(y_2\) signals, keeping the other parameters constant but considering \(\phi_1 = 0\) and \(\phi_2 = \frac{\pi}{6}\) give us the waves in the top-right panel in Figure 1. These waves are out of phase.
The bottom-right panel in Figure 1 shows our \(y_1\) and \(y_2\) waves when all the changes made before are applied at once.
These single waves are often referred to as tidal constituents, and their frequencies/periods are known accurately from astronomical calculations. Although we are aware of hundreds of constituents, we usually only need about ten of them to describe more than 90% of the observed tidal variation.
The tides are visible through changes in the sea surface height SSH. When we make observations of SSH as a function of time (\(t\)), we measure a combination of the local mean sea level (\(H\)) and the influence of tides \(\text{Ti}(t)\). In addition, there could be influence from meteorological forcing \(\text{M}(t)\), such as wind/storms.
In this example, we will investigate some properties of tides and compare a pure tidal signal to observed sea level measurements.
Data
The amplitudes and phases of tidal constituents vary from place to place, due to interference with land masses (the waves will have to travel around the land masses). Table 1 provides amplitudes, periods and phases for 6 components (M2, S2, N2,K2, O1 and K1) obtained at Kartverket from sea level observations in Stavanger.
Component | Amplitude[cm] | Period[hours] | Phase[deg] |
---|---|---|---|
M2 | 15.85 | 12.42 | 0.33 |
S2 | 6.68 | 12.00 | 6.18 |
N2 | 2.59 | 12.66 | 1.00 |
K2 | 1.19 | 11.97 | 0.33 |
O1 | 1.50 | 25.82 | 5.85 |
K1 | 5.44 | 23.93 | 5.44 |
Table 1: data for 6 tidal constituents.
- M2: Principal semi-diurnal lunar component;
- S2: Principal semi-diurnal solar component;
- N2: Larger lunar elliptic component;
- K2: Lunisolar semi-diurnal component;
- O1: Principal diurnal lunar component;
- K1: Diurnal declination component;
For more information about tides, check the compendium developed by Prof. Helge Drange here.
Task 1
Given the values in Table 1, we create the dictionary comps
containing the tidal components as keys and amplitude, period and phase as their corresponding values. (It is important to remember to keep the same order in every entry.)
# comps = {'m2':[A, Pd, Ph], 's2':[], ... }
comps = {
'm2':[15.85, 12.42, 0.33],
's2':[6.68, 12.00, 6.18],
'n2':[2.59, 12.66, 1.00],
'k2':[1.19, 11.97, 0.33],
'o1':[1.50, 25.82, 5.85],
'k1':[5.44, 23.93, 5.44],
}
Task 2
Create the dictionary tides, with the same keys as comps but with empty lists as entries.
# tides = {'m2':[], 's2':[]...}
tides = {'m2':[], 's2':[], 'n2':[], 'k2':[], 'o1':[], 'k1':[]}
Task 3
Create the function elev
that takes as arguments the name of the tidal component and its wave parameters. By using a cosine function, we calculate the SSH associated to each of the components for 45 days. Then we save the calculated tidal elevation in the corresponding key within the tides dictionary.
Tip 1: Period must be converted to radians. The period in radians, \(\text{T}_{\text{rad}}\), is given by
$$\text{T}_{\text{rad}} = \frac{2\pi}{\text{T}_d}$$
where \(\text{T}_d\) is the period in degrees.
Tip 2: Import the math module and use the cosine function.
from math import cos, pi
comps = {
'm2':[15.85, 12.42, 0.33],
's2':[6.68, 12.00, 6.18],
'n2':[2.59, 12.66, 1.00],
'k2':[1.19, 11.97, 0.33],
'o1':[1.50, 25.82, 5.85],
'k1':[5.44, 23.93, 5.44],
}
tides = {'m2':[], 's2':[], 'n2':[], 'k2':[], 'o1':[], 'k1':[]}
def elev(td, period, amplitude, phase, time):
omega = (2*pi/period) # convert period to rad
# calculate sea level elevation with a cosine wave equation
ssh = [amplitude * cos(omega * t - phase) for t in time]
return ssh
times = range(45*24+1) # 45 days, 24 h/day (+1 hour to end at day 45)
for td in tides.keys():
ssh = elev(td, comps[td][1], comps[td][0], comps[td][2], times)
tides[td].extend(ssh)
print(tides)
The dictionary tides
now looks like this:
{'m2': [14.99477114, 15.60544637, ..., 13.05302602],
's2': [6.64446987, 5.41025202, ..., 6.64446987],
'n2': [1.39938297, 2.26833165, ..., 1.53678411],
'k2': [1.12579039, 1.16746723, ..., 0.55324662],
'o1': [1.36144992, 1.169624, ..., 1.19659995],
'k1': [ 3.61807615, 2.43964282, ..., -0.5402215 ]}
Plotting
Let’s sum up all of the components and make a plot:
import matplotlib.pyplot as plt
...
ssh = []
for i in range(len(tides['m2'])):
s = sum([tides[td][i] for td in tides.keys()])
ssh.append(s)
plt.plot(ssh);
labels = [round(i * 45 / (24*45+1)) for i in range(24*45+1)]
# change xticks to days
plt.xticks(times[0:-1:24*7], labels[0:-1:24*7], rotation=45);
plt.xlabel('Days')
plt.ylabel('SSH (cm)')
plt.show()
We get the following plot:
PS: The signal presents a clear 14 days period modulation. Why does this happen?
Lastly, let’s plot two components (M2 and S2) for 15 days and check how they look like when they are superimposed. To do this, we sum the two components of interest using the variable sum_tides.
...
#sum_tides = tide1 + tide2
sum_tides = [tides['m2'][i] + tides['s2'][i] for i in range(len(tides['m2']))]
fig, (ax0, ax1, ax2) = plt.subplots(nrows=3, ncols=1,
sharex=True, sharey=True)
ax0.plot(tides['m2'][0:15*24+1]) #m2 component
ax0.set_title('m2')
ax1.plot(tides['s2'][0:15*24+1], 'k-') #o1 component
ax1.set_title('s2')
ax2.plot(sum_tides[0:15*24+1], 'r') #superimposed component
ax2.set_title('m2+s2')
# change xticks to days
plt.xticks(times[0:15*24+1:24], labels[0:15*24+1:24], rotation=45);
plt.xlabel('Days')
ax1.set_ylabel('SSH (cm)')
plt.show()
This gives us the following plot: