Skip to main content
4-Participant
February 2, 2013
Solved

MathCad is solving incorrectly?

  • February 2, 2013
  • 7 replies
  • 17205 views

I am re-creating the appendix C of calculations to size a flare system, however I can't seem to get MathCad to correctly solve for my variable. I've swapped out units and values but I still don't get the correct answer.

I have uploaded the output from MathCad

However, the answer I am supposed to get is d=0.468 m. Not too sure how to make mathcad only give me the positive answer though.

Best answer by Werner_E

As Valery already pointed out that formula in your Appendix is not quite clean concerning units. The example given there is calculated dimensionless, as Valery has done.

I would correct the fact, that Ma2 has no unit by assigning the constant 3.23*10^(-5) the appropriate unit. I'm not sure about units of Z and esp. M !??

The reason you are not getting the answer you expect is, that qm and P2 are not using basic SI units. You may compensate by multiplying qm by 3600 (kg/s --> kg/hr) and dividing P2 through 1000 (Pa --> kPa). That way you have at a formula with a constant of 116.28 you may use with data of any units (as long as your worksheets units are set to SI units in preferences).

To get only the positive solution you would normally use the modifier "assume, d>0", but the symbolic engine does not know anything about units at all. Thats the reason you see kPa, m etc. in the symbolic result - the symbolic engine sees them as unknown variables. Because of that I had to use "assume, ALL>0" to make it work.

Hope it helps.

Flare1.png

BTW, is there a specific reason you are appending the literal subscript point to the names of all variables which do not use subscripts ("Z." instead of "Z", etc.)?

7 replies

24-Ruby IV
February 2, 2013

Sorry, we need the Mathcad sheet not only the picture!

1-Visitor
February 2, 2013

Are you missing DEL H in your calculation? You have it defined but not used.

Norm

12-Amethyst
February 2, 2013

I think you are using dimensional variables in an equation that already has a conversion unit.

See the attached.

Message was edited by: Harvey Hensley, corrected the formula but the results are as before

12-Amethyst
February 3, 2013

In the worksheet I attached in the reply above, I stated that k=1.4 for ideal gas. I should have said that k=1.4 for diatomic gas.

However, it appears that the problem has assumed k=1.

Please note that if you use the basic equation, not an equation that has assumed certain units and has hidden the gas law constant, you will get the correct answer.

25-Diamond I
February 2, 2013

What I see is a correct Mathcdad evaluation.

Why do expect somoethings else?

You will get better response if you attach the worksheet. You don't expect us to type in all that values, don't you?

I am re-creating the appendix C

????????? appendix of WHAT?

However, the answer I am supposed to get is d=0.468 m.

Sure not with the formula you have typed in the screensot, check it against the books

Not too sure how to make mathcad only give me the positive answer though.

What do you mean by that? You have neither used a solve block nor the symbolic solve. You have typed in the vector which gives you the negative result as one of its two elements yourself!?

NovaStark4-ParticipantAuthor
4-Participant
February 3, 2013

Ah sorry there, I was in a hurry and thought I was doing something wrong that could be easily seen from a screencap.

I was using API-521 for flare sizing calculation and using the values they gave. I attached the page in question.

I was not too sure how to correct the fact that Ma2 would have no units as it is mach number so I thought I'd have to multiply by the other units I inputted.

I will look more into the symbolic solve and solve block things, I only have a sort of basic understanding of mathcad. Essentially what I'd normally do it solve it as I did and then just copy the formula. I was not sure if there was a way to solve for 'd' such it would only give the positive value and not show the vector with the two solutions.

24-Ruby IV
February 3, 2013

I hope it help you - see please the picture and download the attached sheet.

Flare Sizing Calculation.png

NovaStark4-ParticipantAuthor
4-Participant
February 3, 2013

Thank you all. This was quite an eye opener! Seems I will need to understand these formulas a bit more before inputting them into MathCad. They will work if doing it by hand surely, but may require some modification wrt units in MathCad.

Also now agrees that for relative molecular mass , they meant molecular mass as they later calculaed vapor volume flow rate as:

q = (45360/3600)(22.4/46.1)(422/273) = 9.46 m^3/s

and I believe the 22.4 is the value for volume at STP, of 22.4 m^3/kmole

24-Ruby IV
February 3, 2013

Garrett Ramjattan wrote:

Thank you all.

and I believe the 22.4 is the value for volume at STP, of 22.4 m^3/kmole

You welcome!

22.4 is L/mole - one mole of an ideal gas need 22.4 liter - I remember it from school

25-Diamond I
February 3, 2013

Garrett,

I feel that Harvey gave the right answer, not me!

NovaStark4-ParticipantAuthor
4-Participant
February 3, 2013

Well both of you gave me correct answers, I just chose yours because of the unit conversion factor thing as that corrected the result immediately. Harvey also did resolve my problem but in a different manner.

(side note: this reply system is a bit confusing at times!)

24-Ruby IV
February 4, 2013

Garrett Ramjattan wrote:

Well both of you gave me correct answers...

One joke

Khwaja friend came to consult him about the case. He told him everything and at the end said, "Well? Am I wrong?" Hodge said: "You are right, my friend, you are right." The next day, who knew nothing about it as the enemy came to Hodge. And he also, wanting to determine what will end litigation, told him the case, of course, biased, in the light of its own advantage. "Well, Hodge, what would you say? Am I not right?" - He asked Hodja. And he Hodja answered, "Sure, sure, you're right."

Hodja's wife accidentally listened to his conversation with the litigants, and seeing that Khoja said both right, it planned to embarrass him and said: "Effendi, yesterday was at your neighbor Korkut, he explained to you the business, you tell him that he was right. Then came Sanjar his opponent, you and told him that he was right. How? Kazi you and I for so many years, his wife Kazi. Would be right at the same time and the plaintiff and the defendant? "Hodge said quietly, "Yes, it is, my wife, and you are also right.

12-Amethyst
February 4, 2013

I know this is probably "beating a dead horse" but I would like to point out the differences between the three methods given. My motivation has nothing to do with who is right and who gets credit.

The method Werner provided developed a new conversion constant that is specific to the SI system, as he said. If a user changes the base system, then a new constant will be needed. Coming up with new constants increases the chance of error and makes the worksheet less universal.

The methods Valery and I used will work regardless of the base units. Valery's method (dividing each variable by the specified unit) is the best way to conform to the original equation. Also, this is the best way to use empirical equations which could be using a mixture of unit systems. This method means that the constants in the equation do not need changing. That could be desirable if you have to show adherence to a code.

My approach (showing the fundamental equation), is useful if you desire to show the the full equation with all constants and variables (e.g. Rg, k). However, it too could increase the chance of error if you don't "get it right". In your case, we had a known answer for checking the result.

In the long run, Valery's method is best for quick use of a published equation. If you are developing a procedure which would benefit from full explanation of all equations, then converting the equation to the fundamental form would be a better choice. In the case in question, this approach also made the equation more general by not assuming k=1.

24-Ruby IV
February 4, 2013

"Yes, it is, Harvey, and you are also right!"

Thank you!

24-Ruby IV
February 4, 2013

mc2.png