
Peter H. answered 12/04/20
Full Time Mechanical Engineer + Tutor
If we have a max and min temperature, we know the upper and lower bounds for our sine function. The range of this function is the difference between the values:
64° - 38° = 26°
Coincidentally, the average of the upper and lower temperatures is actually perfectly in between them at 51°.
To plot our sine function, we now know that the amplitude of the function is 26°/2 or 13°. The function is also zeroed at 51°. So far, we know the function must look something like this:
D(t) = 13sin(t) + 51
Before we commit to this answer, let's think about what the temperature would do from midnight until noon. Typically, temperature drops between there and will reach the minimum point. According to our equation so far, though, the temperature is rising. To fix this, let's throw a "-" sign in front to reverse the direction.
D(t) = -13sin(t) + 51
The last step is to figure out how long it takes to complete one full cycle. We know that from midnight to midnight is 24 hours. Convert that to the period in a sine function using (2π)/b = 24hr, we get b = (2π)/24 = π/12. Let's add that to our function.
D(t) = -13sin([π/12]*t) + 51
Does this make sense? Plug in some values to check. At t = 0, midnight, the value is 51°. At t = 6, 6A.M, the value is 38°. Awesome. Now we know the function is correct!
Hope this helped!