Problem Set 6 Group

G6-1

Many of the groups used the same data, and all of the groups used more or less the same procedures.  Bravo!  Well done overall.  Here's the Buttermilk solution which had a nice presentation and solid analysis.  Buttermilk is Kaufman, Handler, Liau, Gray.

Our source of data is "http://www.maineharbors.com/novkit03.htm".  We imported the data for Kittery Point for the month of November in the year 2003.

AdjustedTideValues = 
      Import["C:\Documents and Settings\David\My \
Documents\AdjustedTideValues.csv", "CSV"]

ListPlot[AdjustedTideValues, PlotStyle -> PointSize[0.02], 
      PlotJoined -> True]

From the graph below, it is clear that we must find a function that represents the data points, for a set of the Fourier representation of the data points just doesn't work.

ListPlot[Abs[Fourier[AdjustedTideValues]], PlotJoined -> True, 
      PlotRange -> All]

The first step was to convert the data to a function in terms of sign and cosines.  The period of this representation was taken to be 28 days based on our knowledge that the height of the tides reaches a mazimum value once every lunar month.

trigpoly = 
        a[0] + (∑_(k = 1)^119)(a[k] 
                Cos[x*2  Pi/28]^k) + (∑_(k = 120)^239)(a[k] 
                Sin[x*2  Pi/28]^(k - 119));

The representation was of degree 120 in order for the function to pass through ever datapoint.  Below were are finding the 240 coefficients (a[0] through a[239]) that correspond to the function above.

FitAdjustedTideValues = 
        FindFit[AdjustedTideValues, trigpoly, Table[a[i], {i, 0, 239}], x, 
          MaxIterations -> 480];

Next we apply those coefficients to the function tripoly:

FinalFittedFunction = trigpoly /. FitAdjustedTideValues;

Below is a graph of our function overlayed with the datapoints.

Plot1 = 
      Plot[FinalFittedFunction, {x, 0, 28}, 
        Epilog -> 
          Prepend[Point /@ AdjustedTideValues, PointSize[0.02]]]

We take note that this representation is not entirely accurate.  The function was forced to pass through every nearly every point, but it does not inherently know that these datapoints serve as an envelope.  We accept this representation because the periodicity of the representation is very close to the periodicity of the data points.  

Next, we generate a table of values that are based on the fitted function:

data = Table[N[FinalFittedFunction], {x, 0, 30,  .1}];

We find the discrete Fourier transform of our data:

ListPlot[Abs[Fourier[data]], PlotJoined -> True, 
      PlotRange -> {{0, 70}, {0, 30}}]

This transformation from the time domain to the frequency domain gives us some interesting information.  Based on the fact that our function that fits the data is of the form Sin[28/2Pi x] and the 28 corresponds to a lunar month of 28 days, the peak at approximately 56 tells us that there exists periodicity every 12 hours.  This agrees with the empirical observation that the tide reaches a maximum height two times a day.  Moreover, we see a peak at 1, which we infer  corresponds to the fact that the tide reaches a global maximum height once a month.

FinalFittedFunction

The Fourier transform can also be interpreted as the sum of two waves with similar (but not identical) frequencies of oscillation. When two near-identical waves interfere, the result is a phenomenon we refer to as "beats", periodic pulsations that are related to the difference in the two waves' frequencies. In general, the frequency of the sum is the difference in frequencies of the two individual waves. So, the closer the frequencies of the two waves, the lower the frequency of the sum. Plot1 shows a beat pattern with a relatively low frequency (long wavelength). Looking more closely the characteristic peak of the Fourier transform, we noticed that two peaks actually exist between the values 50 to 70 on the horizontal axis. To show the connection between the beat phenomenon and our data, the following sums of sine waves were created:

Plot[
        Sin[x + 5] + Sin[x  .93 + 5] + 2, {x, 0, 
          200}];
Plot[
        Sin[x + 5] + Sin[x  .93 + 5], {x, 0, 
          200}];
Plot[Sin[x + 5] + Sin[x  .97 + 5], {x, 0, 200}];

Figure 1

Figure 2

Figure 3

data1 = 
        Table[N[Sin[x  .93 + 5] + Sin[x + 5]] + 2, {x, 0, 
            200,  .1}];
data2 = 
        Table[N[Sin[x  .93 + 5] + Sin[x + 5]], {x, 0, 
            200,  .1}];
data3 = 
        Table[N[Sin[x  .97 + 5] + Sin[x + 5]], {x, 0, 
            200,  .1}];

ListPlot[Abs[Fourier[data1]], PlotJoined -> True, 
        PlotRange -> {{0, 50}, {0, 20}}];
ListPlot[Abs[Fourier[data2]], PlotJoined -> True, 
        PlotRange -> {{0, 50}, {0, 20}}];
ListPlot[Abs[Fourier[data3]], PlotJoined -> True, 
      PlotRange -> {{0, 50}, {0, 20}}]

Figure 4

Figure 4: The Fourier transform of Figure 1 shows two closely spaced peaks corresponding to two waves of very close frequencies. Note the "wall" on the left side of the plot. This wall was also present in the Fourier transform of our data (see above).

Figure 5

Figure 5: The Fourier transform of Figure 2 (sum centered at y=0) does not show a wall. We deduce that the wall in the Fourier transform of our data appears because the data pattern  is centered near  y=5.

Figure 6

Figure 6: The closer the frequencies of the two waves, the longer the wavelenths of their sum. Here the frequencies are so close that the Fourier Transform shows only one peak at the approximate frequencies of the waves.