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

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Default units to customon 2D plots

blckwtr
1-Newbie

Default units to customon 2D plots

Is it possible to change from the default unit in a 2D plot? Let's say; from m^3/s to liters/min.

In many plots this would be much easier for presentations, especially where the unit isn't in a power of 10 or 10^-1...

Thanks..

Tommy
20 REPLIES 20

To alter the units in a plot, divide by the units you want to plot in:

Q = m^3/s, plot Q/(liter/min)

Fred Kohlhepp
fkohlhepp@sikorsky.com

OK, but then you have to redefine the variable for use later on. But if this is the only way, I guess this is a necessity?!

"OK, but then you have to redefine the variable for use later on".
Attach the work sheet, "Save as 11" has a much greater audience.

jmG
IRstuff
3-Visitor
(To:blckwtr)

On 2/4/2009 9:59:13 AM, blckwtr wrote:
>OK, but then you have to
>redefine the variable for use
>later on. But if this is the
>only way, I guess this is a
>necessity?!

No, the variable does not change. Mathcad ALWAYS maintains its internal representation in its base units. Scaling the plot output is no different than changing a value's display units by using the units placeholder.

TTFN,
Eden

from m^3/s to liters/min.
_________________________

m�/s is limited to measuring the volume of rivers, that's about it. For processes it is T/hr or any equivalent derived, like kg/s.
Anyway, you know how to do.

jmG

I work in the oil industry, that says it all...;) Customers give their design input in a mixture of metric and imperial, but for calculations using CFD software or other FEA applications, it is often advantageous for us to give the input in metric, as for all of our calculations. But if we are to compare results on a plot with the design input given by our customer, it would have been pleasing to achieve this task without going the extra way on dividing with the appropriate unit.

I guess I just have to define a new variable for the plot of interest, and still have the "original" variable for additional calculations involving this variable. By doing this I don't have to redefine the variable two times.

600 liters/min = 0.013m^3/s, not an easy comparison when comparing lots of data...

Just a thought, though, but I guess this is a weakness with MC?!
RichardJ
19-Tanzanite
(To:blckwtr)

There is no need to define any new variables. If I assign a value with units to a variable, the value is converted to the base unit, and that's what is stored internally. For example, if I define

x:100*cm

Mathcad stores the value 1 (since the base unit is the meter) and the fact that it is a length. In fact, it stores 1 regardless of which unit system you choose for the worksheet. If I then evaluate it, I get the value in the default units for the worksheet, and Mathcad shows the units. In this case,

x=1m

if the unit system for the worksheet is SI. You can change what is displayed by typing units into the units placeholder. This only changes the display though: it has no effect on what is stored internally.

For graphs, the default behavior is that Mathcad divides by the default unit and displays the resulting value. It has to remove the units, because the only thing that can be used to plot graphs are pure numbers. That is a universal truth, not something that is true only for Mathcad. That is why the correct way to label the axes of a graph is variable_name/units, not variable_name (units), even though the latter convention is extremely common. You must divide by the units to get a value, then plot the value. The actual problem in Mathcad is that when you plot variables with units, Mathcad does not show that it has divided by the base unit. The placeholder really should show x/m if x is a length, but all it shows is x. You can change that though, by typing x/m, or x/cm, in the axes placeholders. This affects what is shown on the graph, but has no effect whatsoever on the internally stored value of x.

Richard

"I work in the oil industry, that says it all...;)"
___________________________

It does ! and I guessed it, but nice you confirmed. You would have no problem ignoring the Mathcad unit system like in the old DOS days and converting your formulae, like I do. Many collabs are in war flames with me because I would zap the unit system in Mathcad, no matter ... their battle is lost for ever: Maths are scalar. Engineers don't carry units, they use as is or convert before if needed.

Mathcad can't do more than you can do for it first.

jmG

On 2/4/2009 11:34:35 AM, jmG wrote:
== Many collabs are in war flames with me because I would zap the unit system in Mathcad, no matter ... their battle is lost for ever:

The Black Knight Rides Again ...

Black Knight: None shall use units.
Engineer Arthur: What?
Black Knight: None shall use units!
Engineer Arthur: I have no quarrel with you, good Sir Knight. But I must use units in my derivation.
Black Knight: Then you are not an Engineer.
Engineer Arthur: I command you, as Head of Astronautical Engineering, to stand aside!
Black Knight: I move for no man.
Engineer Arthur: So be it!
[they argue until Arthur cuts off the Black Knight's Lemma with the Gimli Glider]
Engineer Arthur: Now, stand aside, worthy adversary!
Black Knight: 'Tis but a special case!
Engineer Arthur: A special case? Your argument's completely come apart!
Black Knight: No, it hasn't!
Engineer Arthur: Well, what's that then? (pointing at the gaping whole in the BK's argument)
Black Knight: I've recovered from worse.
Engineer Arthur: No you haven't!
Black Knight: Come on, you non-Engineer!
[they argue again. Arthur cuts off the Knight's implication with the Mars Orbiter]
Engineer Arthur: Victory is mine!
[kneels to pray]
Engineer Arthur: We thank thee, Lord, that in thy mercy -
[cut off by the Knight resuming the argument from the same point as before]
Black Knight: Come on, then.
Engineer Arthur: What?
Black Knight: Have at you!
Engineer Arthur: You are indeed brave, Sir Knight, but the argument is mine!
Black Knight: Oh, had enough, eh?
RichardJ
19-Tanzanite
(To:StuartBruff)

ROTFL!

Richard
PhilipOakley
5-Regular Member
(To:blckwtr)

On 2/4/2009 10:45:41 AM, blckwtr wrote:
>I work in the oil industry,
>that says it all...;)
>Customers give their design
>input in a mixture of metric
>and imperial, but for
>calculations using CFD
>software or other FEA
>applications, it is often
>advantageous for us to give
>the input in metric, as for
>all of our calculations. But
>if we are to compare results
>on a plot with the design
>input given by our customer,
>it would have been pleasing to
>achieve this task without
>going the extra way on
>dividing with the appropriate
>unit.
>
>I guess I just have to define
>a new variable for the plot of
>interest, and still have the
>"original" variable for
>additional calculations
>involving this variable. By
>doing this I don't have to
>redefine the variable two
>times.
>
>600 liters/min = 0.013m^3/s,
>not an easy comparison when
>comparing lots of data...
>
>Just a thought, though, but I
>guess this is a weakness with
>MC?!

No need for new variables! While Jean has his approach, most folk use the single variable to represent the true quantity (both the base unit and number value in that unit) then use the results place holders etc to do the implied conversions.

When using a 'book' formula that says "volume V in litres" then you put (v/ltr) in the formula.

If you want a graph in gallons (US or UK?) you put (V/gal) on the axis.

Let mathcad do the appropriate conversions.

It can take a little while to get used to if you have always had to separate numbers from measurement units. Keep the tools sharp 😉

Philip Oakley

Thank's guys for all the clearifying and helpful answers. Nice to have you here...;)

Best regards

-Tommy-

You are about right Philip,

In all those units things and the likes, there are 4 non exclusive "suites" and marriages: quality, quantity, coherence, scalar. They are not separable.

jmG

On 2/4/2009 10:45:41 AM, blckwtr wrote:
>I work in the oil industry,
>that says it all...;)
>Customers give their design
>input in a mixture of metric
>and imperial, but for
>calculations using CFD
>software or other FEA
>applications, it is often
>advantageous for us to give
>the input in metric, as for
>all of our calculations. But
>if we are to compare results
>on a plot with the design
>input given by our customer,
>it would have been pleasing to
>achieve this task without
>going the extra way on
>dividing with the appropriate
>unit.
>
>I guess I just have to define
>a new variable for the plot of
>interest, and still have the
>"original" variable for
>additional calculations
>involving this variable. By
>doing this I don't have to
>redefine the variable two
>times.
>
>600 liters/min = 0.013m^3/s,
>not an easy comparison when
>comparing lots of data...
>
>Just a thought, though, but I
>guess this is a weakness with
>MC?!

NO, YOU DON'T!!!!!!!!
(You're not listening.)

Fred Kohlhepp
fkohlhepp@sikorsky.com

OK, sorry... Just a small lack of precision formulation there, I meant of course a NEW variable, not a redefenition of the same variable... I have done as you said now...;) (dividing with the units)

It looks neat, and relax, please...;) This is my job, I can't get all exited over details. I have enough deadlines on my mind.

Again, thanks... I'm off, training is good for the blood pressure they say...;)

"It looks neat"
_______________

Make it even neater ! and simpler

andandand: TRACEABLE.

jmG
IRstuff
3-Visitor
(To:blckwtr)

On 2/4/2009 1:29:47 PM, blckwtr wrote:
>OK, sorry... Just a small lack
>of precision formulation
>there, I meant of course a NEW
>variable, not a redefenition
>of the same variable... I have
>done as you said now...;)
>(dividing with the units)
>
>It looks neat, and relax,
>please...;) This is my job, I
>can't get all exited over
>details. I have enough
>deadlines on my mind.
>
>Again, thanks... I'm off,
>training is good for the blood
>pressure they say...;)

You're still not listening. Every variable is stored within Mathcad in its base units, regardless of how or where you defined it. In the plot, you are not changing the variable itself, you're only changing its DISPLAY. Therefore, after the plot, the variable is still exactly as it was before the plot.

TTFN,
Eden

On 2/4/2009 12:57:37 PM, fkohlhepp wrote:
>On 2/4/2009 10:45:41 AM, blckwtr wrote:
...
>NO, YOU DON'T!!!!!!!!
>(You're not listening.)
>
>Fred Kohlhepp
>fkohlhepp@sikorsky.com
_______________________

You can't be more right: Peoples ar not listening ! If Mathcad has a direct correspondence in the list of conversion, it is only needed to plug the desired unit in the left black place holder of the result, it does the conversion and displays the "UnitSystem" it is converted to. For the plot: simple, define the conversion factor.

So simple ! and no need for horror plots.

Here the first result is : qualified, quantified, coherent ... if the conversion exists in Mathcad, the new result is automatically: qualified, quantified in the converted coherent new system. If Mathcad does not have the built-in conversion, just a matter of creating it. Easy to check if the conversion exists, like demonstrated, but better check with source converters !!!!

Lovely Fred, I like your worry of making things clear.



jmG

On 2/4/2009 8:47:20 AM, blckwtr wrote:
>Is it possible to change from
>the default unit in a 2D plot?
>Let's say; from m^3/s to
>liters/min.
>
>In many plots this would be
>much easier for presentations,
>especially where the unit
>isn't in a power of 10 or
>10^-1...
>
>Thanks..
>
>Tommy
______________________________


>If Mathcad has a direct correspondence in the list of conversion, it is only needed to plug the desired unit in the left black place holder of the result, it does the conversion and displays the "UnitSystem" it is converted to. For the plot: simple, define the conversion factor.

So simple ! and no need for horror plots.

Here the first result is : qualified, quantified, coherent ... if the conversion exists in Mathcad, the new result is automatically: qualified, quantified in the converted coherent new system. If Mathcad does not have the built-in conversion, just a matter of creating it. Easy to check if the conversion exists, like demonstrated, but better check with source converters !!!! <<br> ......................
Tommy,

Just like this: elegant, as it should be & visually traceable.



jmG



We can have not two axes but two scale onthe plot - m^3 barrel for example:
http://twt.mpei.ac.ru/ochkov/Mathcad_12/1_66_Plot_V_V.png
Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm
Top Tags