Tuesday, September 27, 2011

Exercise 2.2 - Modeling a Toilet

A note on my nomenclature: This is exercise 3.2 from the text; it also happens to be 3.2 online, but online it's part of the art of modeling chapter, and in the text it's part of the math chapter. Following the online order, I'm calling the math chapter ch. 2, but since I'm working from the text for the math chapter (and only the math chapter) I'm calling this ex. 2.2. Whatever.

The model, as I downloaded it, needed to be broken before it could be fixed. First, I deleted the "/dt" from the outflow equation. Second, I changed the flush's if statement to be "if Use>0.995..." because I wasn't getting many flushes with the 0.999 threshold. Third, I deleted the seed from the random function ["RANDOM(0,1,14)" -> "RANDOM(0,1)"] in the parameter "use" to get different random flushings on each run. Doing that gives the following with dt = 0.5:

Q: Can you reformulate the model in such a way that the stock would be drained out properly under any computational method and any time step DT? As you may have noticed, when we switch to other methods, the outflow starts to deplete the stock, but then, apparently, does not have enough time to take it all out. How can this be fixed?

To get the tank to empty no matter what the dt, I just cranked up the outflow. Since tank is defined as a non-negative reservoir, this has no consequences. I made the outflow 1000 x tank, which should work up to a dt of 0.001. The result is:

No comments:

Post a Comment