Problem statement
Cody Problem 54750 involved determining the length of a stream affected by a spill of a contaminant. Any municipalities within that reach would want to know when water from the river would be safe to drink—for example, below the U.S. Environmental Protection Agency’s maximum contaminant level (MCL). As in CP 54750, the spill of mass M will be assumed instantaneous at position and time and mixed over the cross section (with area A). Then if the flow is steady and the geometry of the flow does not change downstream, the concentration can be computed with
where is the mean velocity of the river, Q is the discharge or volumetric flow rate, and K is a dispersion coefficient, which describes spreading by several mechanisms.
Write a function that returns the dates and times (given as datetimes) between which the water is unsafe to drink (i.e., the concentration exceeds the MCL) at position x downstream of the spill. Round the times to the nearest second. If the concentration does not exceed the MCL, return 'The MCL is not exceeded.' Please note that the MCL is given in mg/L, whereas other variables are given in SI units.
Details
Many empirical formulas are available for the dispersion coefficient. For this problem, use the formula of Seo and Cheong (1998):
where B is the width of the channel (assumed rectangular here), H is the water depth, and is the shear velocity, which is related to the shear stress on the wetted perimeter of the channel. In steady uniform flow, the component of the fluid’s weight down the slope will balance the friction on the channel bed, and the shear velocity can be computed as
where is the gravitational acceleration, is the longitudinal slope of the channel, is the hydraulic radius, and P is the wetted perimeter. For a rectangular channel, .
In addition to assuming steady uniform flow and an unchanging channel, ignore any reaction, decay, or loss of the chemical; this assumption provides a conservative estimate of the time range. In practice, one would include a factor of safety that accounts for uncertainty in the parameters. Nevertheless, the calculations here would form a basis for the advice to the city.

### Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Jun 01, 2024

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!