Help with step function
- April 7, 2016
- 2 replies
- 6043 views
I have a problem using a solve block with equations that change at a specific point in the solution. I've attached an example file (Mathcad Prime 3.1) showing the problem and how I've solved it. The scenario is two vessels connected in series. The first vessel is initially full of water while the second vessel is empty. At time = 0, a flow of a second fluid starts into vessel 1. The overflow from vessel 1 goes into vessel 2. When vessel 2 is filled, then the overflow from vessel 2 goes to a drain. I want to calculate the volume fraction of the second fluid in each vessel with time. The equation for the volume fraction in the second vessel changes once the vessel is filled (because it starts to drain.) The way I came up with to handle this is using the step function, but it does some strange things. I've included two solutions, the first showing the problem with the step function, the second showing my messy-looking way of handling the problem with the step function. I'm wondering if there is a better way to handle this.
thx
Mike

