Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hi !,
I trying to learn the programming methods at mathcad, for that I'm triyng to make a loop to classificate a Pressure Vessel according to the fluid,Pressure, Volume. But i cant get it, if any one could help me with that.
Solved! Go to Solution.
I think he correctly handled that by defining "l" which removes the units from L.
The problem I think was the use of "while" in the second program. It should really be another "if" statement. See attached.
Alternatively, I would recommend the use of a matrix "lookup" function. I think that might provide a more concise solution.
How about the attached?
You were comparing L which had the units of energy to the values in your program.
Mike
I think he correctly handled that by defining "l" which removes the units from L.
The problem I think was the use of "while" in the second program. It should really be another "if" statement. See attached.
Alternatively, I would recommend the use of a matrix "lookup" function. I think that might provide a more concise solution.
Mark, that was exactly what i need, thanks for your quick help !
Also, consider multiplying the limits of L by the intended unit. This will allow you to define L in any units, and Mathcad will do the proper conversion while classifying your fluid.
Mark Gase wrote:
Also, consider multiplying the limits of L by the intended unit. This will allow you to define L in any units, and Mathcad will do the proper conversion while classifying your fluid.
This would have been my way of setting it up.
Can you show me an example of this oder way to do it ? It is always good to know more than one method.
Here is what I meant by my comment on the units.
You'd want to set up the second program similarly.
Regarding my comment about setting this up as a matrix lookup function - I'd have to play with it since I don't typically do those. Not sure I have the time right now.
Curiosity got the better of me. Here is how to approach this with a vlookup function.
Hi Mike,
Thanks for the quick reply, in your example the "Grupo" is not the correct it shoud show "Grupo 5" for a L<1.
Also i want to classificate the Category, that is a function of the Grupo and the Fluid ( A or C)
That's because I divided L by kN*m. It works if you divide L by MPa*m^3.
Mike
Emilio Janssen wrote:
Hi !,
I trying to learn the programming methods at mathcad, for that I'm triyng to make a loop to classificate a Pressure Vessel according to the fluid,Pressure, Volume. But i cant get it, if any one could help me with that.
Noting that you had made the argument to Grupo dimensionless, does the attached do the kind of thing you want?
Stuart
StuartBruff wrote:
Emilio Janssen wrote:
Hi !,
I trying to learn the programming methods at mathcad, for that I'm triyng to make a loop to classificate a Pressure Vessel according to the fluid,Pressure, Volume. But i cant get it, if any one could help me with that.
Noting that you had made the argument to Grupo dimensionless, does the attached do the kind of thing you want?
I had a few spare minutes, so I tidied the worksheet up a bit and handled L with units:
Stuart
Thanks Stuart, very usefull those examples and methods !!