True story: For safety, I had put chlorine powder in my spa water and my guests were coming soon. But, when I used my water testing kit, I realized I had overchlorinated. I had thrown in about n times too much powder, and so I needed to dilute the water by adding fresh water, and fast. Would I better off first draining out some of the overchlorinated water and then filling the spa back up with fresh water and mixing, or would it be faster emptying and filling at the same time? The garden hose fills the spa at the same rate that the drain faucet at the bottom empties the spa. Assuming that the mixing of fresh water and chlorinated water is instantaneous and that the drain rate does not change with water height, which way is faster and how does the answer depend on n?
The completion time of draining some first and then refilling is the easier to calculate.
I assume that "n times too much powder" means having used n times as much powder, and use n as the initial concentration relative to the desired concentration.
Let r be the flow rate of one of the levelchanging items: drain or faucet, in units of pool volume to total fill or drain time. Defined this way it, of course, has the value 1 and so need not be considered a variable.
In the drainfirst/filllater scenario you want to get the water level down to 1/n of being full, thus requiring a time of (n1)/n. As the equivalent amount of unchlorinated water needs be added, taking the same amount of time, the total time used is 2*(n1)/n.
For the simultaneous drain/fill scenario, you want ultimately to remove n1 units of chlorine from the water. If the concentration remained at n, it would take 1 unit of time to get rid of it all (including all the water), but the concentration is decreasing, so the rate is not 1, but x/n, where x is the current concentration.
dx/dt = x/n
Here, x is the dependent variable, so we have a differential equation to solve.
Wolfram Alpha gives x = k*e^(t/n)
At t=0, x=n so k=n
We want x=1, so
1 = n * e^(t/n)
e^(t/n) = 1/n
t/n = ln(n)
t = n*ln(n)
That's how long the simultaneous drain/fill scenario takes, if I did my math right and used Wolfram Alpha correctly.
So which is better?
To see where the two methods yield the same overall time:
n * ln(n) = 2*(n1)/n
hmmmm...
A table shows the times cross around n = 1.5 or 1.6:
n simult. sequential
1.0 .000 .000
1.1 .105 .182
1.2 .219 .333
1.3 .341 .462
1.4 .471 .571
1.5 .608 .667
1.6 .752 .750
1.7 .902 .824
1.8 1.058 .889
1.9 1.220 .947
2.0 1.386 1.000
2.1 1.558 1.048
2.2 1.735 1.091
2.3 1.916 1.130
2.4 2.101 1.167
2.5 2.291 1.200
2.6 2.484 1.231
2.7 2.682 1.259
2.8 2.883 1.286
2.9 3.088 1.310
3.0 3.296 1.333
3.1 3.507 1.355
3.2 3.722 1.375
3.3 3.940 1.394
3.4 4.161 1.412
3.5 4.385 1.429
3.6 4.611 1.444
3.7 4.841 1.459
3.8 5.073 1.474
3.9 5.308 1.487
4.0 5.545 1.500
4.1 5.785 1.512
4.2 6.027 1.524
4.3 6.272 1.535
4.4 6.519 1.545
4.5 6.768 1.556
4.6 7.020 1.565
4.7 7.274 1.574
4.8 7.529 1.583
4.9 7.787 1.592
5.0 8.047 1.600
5.1 8.309 1.608
5.2 8.573 1.615
5.3 8.839 1.623
5.4 9.107 1.630
5.5 9.376 1.636
5.6 9.647 1.643
5.7 9.921 1.649
5.8 10.196 1.655
5.9 10.472 1.661
6.0 10.751 1.667
Finer detail gives:
1.597 .748 .748
At a concentration of 1.597 times the desired value, either technique would take a little less than 3/4 the time it would take to fill or drain the pool completely.
If I did the math right!

Posted by Charlie
on 20180627 12:03:59 