cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

SOLVED
Newbie

## Beginner Programming Doubt

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.

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions

## Re: Beginner Programming Doubt

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.

13 REPLIES 13

## Re: Beginner Programming Doubt

You were comparing L which had the units of energy to the values in your program.

Mike

## Re: Beginner Programming Doubt

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.

## Re: Beginner Programming Doubt

Mark, that was exactly what i need, thanks for your quick help !

## Re: Beginner Programming Doubt

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.

Participant
(in response to MJG)

## Re: Beginner Programming Doubt

 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.

## Re: Beginner Programming Doubt

Can you show me an example of this oder way to do it ? It is always good to know more than one method.

## Re: Beginner Programming Doubt

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.

## Re: Beginner Programming Doubt

Curiosity got the better of me.  Here is how to approach this with a vlookup function.

## Re: Beginner Programming Doubt

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)

## Re: Beginner Programming Doubt

That's because I divided L by kN*m. It works if you divide L by MPa*m^3.

Mike

## Re: Beginner Programming Doubt

 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

## Re: Beginner Programming Doubt

 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

## Re: Beginner Programming Doubt

Thanks Stuart, very usefull those examples and methods !!

Announcements
Check out the latest