# Matlab

This is based on problem number 20 out of section 3.2 from the Zill book, where we have a hemispherical pool being filled by a pipe at the bottom. From class, we discussed how we can form a differential equation for the height (or depth) of the water at time t taking into account both the rate of water flowing in and the rate of water being lost due to evaporation. The hemisphere has radius 10 feet (which is a pretty deep pool, if you think about it). As we saw, if the rate of evaporation is constantly 1% of the exposed surface area of the water in the pool, and water is flowing it at π cubic feet per minute, then dh dt = 1 20h − h 2 − .01 and the height of water in the pool never actually reaches 10 feet due to the limit of dh dt as h approaches 10. However, it seems unlikely that the evaporation rate stays the same as time goes by. If the pool was in direct sunlight during part of the day, more water would evaporate. If we started trying to fill the pool at 8 AM, the rate of evaporation would slowly increase as the sun rose in the sky, and then would likely decrease as the sun set. It’s also likely that the temperature of the air would have an effect on the evaporation rate. Starting from http://www.noaa.gov and looking for our ZIP code, it seems that the time of day when the humidity was at its lowest is about 3 PM. Let’s make the evaporation model a bit more sophisticated than saying it’s at a constant 1%: let’s have it range between a low of .5% and a high of 2%; let’s put the high value at 3 PM and the low at 3 AM, and assume that at least for a while, the temperatures and humidities repeat day to day. So at 8 AM we begin trying to fill the pool. Evaporation works against us at different rates during the day, predicted by a function we’ll call B(t) which we must construct. At 8AM when we begin this process, the pool 2 ft of water standing in it. Let’s increase the flow coming into the pool to 2π cubic feet per minute to try to overcome evaporation. 1. Can you create a sine or cosine wave that has a period of 1440 minutes (24 hours), and a maximum value of .02 occurring at 3 PM and a minimum value of .005 occurring at 3 AM? Depending on what time of day you want to be time t = 0, you might get different functions. MATLAB or Excel would not figure very prominently here unless you want to use it to graph your proposed function to verify that it has the desired properties. This will be what we call B(t). 2. Use your B(t) to modify the differential equation and create a new initial value problem dh dt = 2 20h − h 2 − B(t) h(0) = 2 The 2 in the numerator of the fraction is due to the fact that we’ve doubled the rate of flow from the original problem, and we’re replacing the constant .01 with the function B(t) to simulate changing evaporation rates throughout the day. We should have a short MATLAB M-file which uses Euler’s method to approximate solutions to a DE by this time; you may adapt this to our purposes, or use Excel, or create your own M-file. Keep in mind that the name of the M-file should match the label after function in the first line of the M-file, so be careful about changing the name of the sample file. To get full credit, I’d want to see a graph of the height of water t minutes after the pipe is opened, and a prediction on when the pool reaches a depth of 10 feet, or a discussion of why this cannot ever happen (depending on what your model shows). If you use Excel, do not print out the sheet but submit it in Canvas. If you edit or create an M-file, include that in your submission.