Time and Temperature

Part 1. Background

Answers to questions in Part 1:

a  =  ?;
b =  ?;
c  =  ?;
t0  =  ?;

Part 2. Fitting to Sunlight Data

Enter the data with the following commands:

month  =  {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
          12};
sunrise  =  {7.43, 7.27, 6.77, 6.03, 5.38, 5.00, 5.05, 5.38, 5.78, 
          6.18, 6.63, 7.13};
sunset  =  {17.22, 17.72, 18.18, 18.63, 19.05, 19.45, 19.60, 19.33, 
          18.72, 17.98, 17.33, 17.03};

Use the sunrise and sunset data to calculate hours of daylight.

daylight  =  ?;

Use the following commands to generate a scatter plot of the data.

sunData  =  Thread[{month, daylight}];
sunPlot  =  
        ListPlot[sunData, 
          PlotStyle -> {RGBColor[1, 0, 0], PointSize[0.015]}, 
          AxesLabel -> {"month", "daylight"}];

Enter your coefficients here, and add a plot of a sinusoidal function to your data plot.

a  =  ?;
b =  ?;
c  =  ?;
t0  =  ?;
h[t_] :=  
        a  +  b*Sin[c*(t - t0)];
sinePlot  =  
        Plot[h[t], {t, 1, 12}, PlotStyle -> RGBColor[0, 0, 1],  
          DisplayFunction -> Identity];
Show[sunPlot, sinePlot,  
        DisplayFunction -> $DisplayFunction];

Here are the plots of the sunrise and sunset data.  Choose one for fitting with a sinusoidal function.

sunriseData  =  Thread[{month, sunrise}];  
    sunsetData  =  Thread[{month, sunset}];
sunrisePlot  =  
        ListPlot[sunriseData, 
          PlotStyle -> {RGBColor[1, 0, 0], 
              PointSize[0.015]}];
sunsetPlot  =  
        ListPlot[sunsetData, 
          PlotStyle -> {RGBColor[1, 0, 0], 
              PointSize[0.015]}];

Enter your best estimates of the coefficients.

a  =  ?;
b =  ?;
c  =  ?;
t0  =  ?;
s[t_] :=  a + b*Sin[c*(t - t0)];
sinePlot2  =  
        Plot[s[t], {t, 1, 12}, PlotStyle -> RGBColor[0, 0, 1],  
          DisplayFunction -> Identity];
Show[sunrisePlot, sinePlot2,  
        DisplayFunction -> $DisplayFunction];

Answers to the rest of the Part 2 questions:

Part 3. Fitting to Temperature Data

Enter the following commands to construct the Kalamazoo temperature data and plot the data.

Kzoo  =  {24, 27, 36, 49, 60, 69, 73, 72, 65, 54, 40, 
          29};
KzooData  =  Thread[{month, Kzoo}];
KzooPlot  =  
        ListPlot[KzooData, 
          PlotStyle -> {RGBColor[1, 0, 0], PointSize[0.015]}, 
          AxesLabel -> {"month", "temp"}];

Estimate the coefficients for a function T(t) to fit this data.Then plot T(t) on the data.

a  =  ?;
b  = ?;
c  =  ?;
t0  =  ?;
T[t_] :=  a + b*Sin[c*(t - t0)]
sinePlot3  =  
        Plot[T[t], {t, 1, 12},  PlotStyle -> RGBColor[0, 0, 1],  
          DisplayFunction -> Identity];
Show[KzooPlot, sinePlot3,  
        DisplayFunction -> $DisplayFunction];

Enter and plot the Helsinki data.

Helsinki  =  {-6, -6, -3.5, 4, 7, 14, 16.5, 15, 10.5, 
          6, 0.5, -2.5};
HelData  =  Thread[{month, Helsinki}]
HelPlot  =  
        ListPlot[HelData, 
          PlotStyle -> {RGBColor[1, 0, 0], PointSize[0.015]}, 
          AxesLabel -> {"month", "temp"}];

Fit a sinusoidal function to the Helsinki data.

a  =  ?;
b  =  ?;
c  =  ?;
t0  =  ?;
T[t_] :=  
        a  +  b*Sin[c*(t - t0)];
sinePlot3  =  
        Plot[T[t], {t, 1, 12}, PlotStyle -> RGBColor[0, 0, 1],  
          DisplayFunction -> Identity];
Show[HelPlot, sinePlot3,  
        DisplayFunction -> $DisplayFunction];

Enter your computations and answers for your selected community in the input cell below.

Part 4. Summary