zdas04
Mechanical
- Jun 25, 2002
- 10,274
I've got a series of a dozen equations (MathCad V11) that are needed to compute the pressure at the bottom of a column that has a mixture of gases and liquids. Of course the pressure at each point in the column is a function of the pressure at the next higher point and the pressure gradient (the gradient changes continiously and is not a linear function of depth).
I've gone through and written all the equations for each depth and it is just horrible to find where you are (calcs at every 100 ft down to 3,000 ft). Also, the file needs to be able change ultimate depth that is just too hard with this technique.
When I backed up and said this is just an array and I should be able to do this in one iteration with subscripts I had to define my pressure array first (since many of the equations need pressure and MathCad reads top to bottom) with arbitrary values. When I got through the 12th equation and had enough information to actually solve for pressure, it sorta worked (the arbitrary values were replaced with pressures calculated from the arbitraty values), but every cell had the calcs based on the arbitraty value and they all were the same.
Then I tried a solve block with all 12 equations defined in the "Given" section and then repeated all 12 equations(with CNTL =) in the "Guess" section. This gave me [2.32] in every element of the array (the square brakets are in the cells).
I'm sure that something this vanilla is simply operator error on my part, but I've gotten so close to it that I just can't see a way to solve it.
David
I've gone through and written all the equations for each depth and it is just horrible to find where you are (calcs at every 100 ft down to 3,000 ft). Also, the file needs to be able change ultimate depth that is just too hard with this technique.
When I backed up and said this is just an array and I should be able to do this in one iteration with subscripts I had to define my pressure array first (since many of the equations need pressure and MathCad reads top to bottom) with arbitrary values. When I got through the 12th equation and had enough information to actually solve for pressure, it sorta worked (the arbitrary values were replaced with pressures calculated from the arbitraty values), but every cell had the calcs based on the arbitraty value and they all were the same.
Then I tried a solve block with all 12 equations defined in the "Given" section and then repeated all 12 equations(with CNTL =) in the "Guess" section. This gave me [2.32] in every element of the array (the square brakets are in the cells).
I'm sure that something this vanilla is simply operator error on my part, but I've gotten so close to it that I just can't see a way to solve it.
David