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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

classic mathcad issue with lbf in plots

prop_design
15-Moonstone

classic mathcad issue with lbf in plots

hi,

 

i noticed a weird thing, possibly a bug, with classic mathcad. i found a trick reading through old posts. i'm using the trick now. however, i'm wondering if others have observed this.

 

if you try to plot force in units of lbf by switching the unit system to US, the program plots Force*gravity instead. if you take what mathcad plots and divide by g, then it will show force in units of lbf.

 

the trick i found on here was to just use the metric system and divide force by lbf. that works good. so i'll use this going forward. however, this seems like a bug when trying to use the built in US unit system. the program outputs any force variable in lbf. it just plots that variable in lbf * g instead of plotting lbf.

 

anthony

1 ACCEPTED SOLUTION

Accepted Solutions

To further clarify:

Werner_E_0-1598272758523.pngWerner_E_1-1598272800924.pngWerner_E_2-1598273118475.png

I still tend to call this a bug (which is not present in Prime)

 

View solution in original post

11 REPLIES 11
tietjee
14-Alexandrite
(To:prop_design)

Could add the link to the old post?

prop_design
15-Moonstone
(To:tietjee)

sorry, i'm not entirely sure which post mentioned the work around. however, the work around wasn't related to the bug. it was similar enough to allow me to get what i wanted though.

 

i figured i should post this to see if anyone else has noticed it. it doesn't seem right. i tried creating a custom unit system (based off the US system) and it just made things even weirder. you can't control the force output with mathcad. it just allows it's built in types. but if you change length and time then the plot output for force is even more messed up. it takes your length and time into account and also multiplies by gravity. so the bug aspect is in the unit definition it says pound force. it will display that for a variable but not in the plot. the other aspect of the bug is this is only for the built in US system or a customization of it. the metric systems don't have this behavior.

 

so using the help from the old post, i can get what i want. which was velocity as the x axis in mph and force in lbf for the y axis. i leave the program in SI units. then plot F/lbf and v/mph. then the output of the plot is what i want.

Dividing a physical quantity by the unit you'd like to see in the plot is standard behaviour in classic Mathcad (and is independent from the unit system selected).

Nonetheless is the effect you describe somewhat strange and I also tend to call it a bug.

 

I don't have "classic" Mathcad any longer, so I can't verify what you're saying, and while I worked (almost) exclusively in English units, I never bothered to change the default from MKS.

 

I would note that Mathcad would recognize "lb" and "lbm" both as mass units (equivalent), if you wanted force it had to be "lbf."  Whether that's the source of your issue or not I can't speculate.

FredKohlhepp_0-1598240757583.png

 

hi fred,

 

no i'm afraid the issue is different. it has to do with the magnitude of force in a plot. the built in unit system says pound force is the output. however it plots lbf * g. if you make a custom unit with 'US' as the starting system, it does the same thing. even worse, if you change the units of distance and time it also adds that in. so the magnitude of the force that is plotted can be really messed up. it definitely seems to be a bug, as this doesn't happen if you use any of the metric systems. moreover, it doesn't plot N * g.

 

awhile ago i tried prime and didn't like it. so i'm not sure what prime does or how it works. honestly, i don't care at all. one thing that pissed me off with prime is i made a handful of worksheets and decided to switch back to classic. there was no way to convert the files. i had to manually recreate them all. they were simple files. there was no reason they couldn't work in classic mathcad or prime. ptc just doesn't want you to switch back. they basically wasted a lot of my time, which i don't appreciate. so i have no intention of trying it out again. the main thing i like about classic mathcad is the help system and all the built in worksheets.

 

i've used mathcad on and off since the 90s. this is the first time i ran into the problem of plotting force. i haven't used mathcad in a long time. so i don't really remember how i worked with it way back when. i was surprised to find this issue. i was mainly curious if anyone else has noticed it.

@Fred_Kohlhepp 

The following pictures show the problem/bug.

If the unit system is SI or MKS, plotting forces shows the values in Newton, which is as expected.

(Unit CGS shows them in dyne which is also as it should be).

But if the unit system is U.S., the plot values do not correspond to pound force as expected, but for some reason rather to lb*ft*s^-2, which explains why dividing by g as written by @prop_design  gives the desired value (in lb, which then is also shown in the plot).

Dividing by the unit we'd like to see (as we are used to do) of course works OK regardless of the unit system chosen.

Werner_E_0-1598253879676.png

Werner_E_1-1598254134784.png

BTW, unit integration is a bit improved in Prime and the plots do not show this strange effect. Choosing unit system USCS correctly shows lbf. Nonetheless I couldn't be bothered downgrading from Mathcad to Prime.

 

 

 

 if the unit system is U.S., the plot values do not correspond to pound force as expected, but for some reason rather to lb*ft*s^-2, which explains why dividing by g as written by @prop_design  gives the desired value (in lb, which then is also shown in the plot).

 

I don't see the issue (maybe dense in my old age,  😉 .)  By definition a pound force equals the weight of one pound mass in earth's gravity.  (Yes, I know that's not the official definition, but it's the one most of us still struggling with English units can remember.)  Mathcad (Prime in my example but classic too, I'm sure) shows this:  Capture.JPG

For those of us who may have forgotten, the English unit of mass is a "slug."

Capture 1.JPG

Prime also produces the plots like classic:

Capture 2.JPG

No issue, no bug, just standard confusion!

 

 

 
 
 

 

The issue is, that the plot values (without dividing the axis values by a unit) correspond to Newton when we select the SI system and thats what we expect, as in SI the standard unit for force is Newton. You can see that the plot (the left one), which is defined for values up to 10 lbf, is running up to 44.48 which corresponds to 10 lbf = 44.48 N.

 

When choosing CGS the plot runs up to 4.448*10^6 which is as expected, because 10 lbf=4.448*10^6 dyne and dyne is the default unit of force in CGS.

 

But if we choose U.S. the default unit of force is lbf and so we would expect the plot running up to 10, corresponding to the upper limit of 10 lbf.

But rather the plot runs up to 321.7!

The workaround which prop_design mentioned is to divide the quantities by g. This results that we don't see force anymore but rather mass in lb and because lbf=lb*g the numerical values are the same as with lbf. Now Mathcad would show the plot up to 10 because in U.S. it uses lb as standard for mass.

But this workaround should not be necessary - we would expect Mathcad to show the plot up to 10 also when plotting quantities of force in lbf.

As Mathcads unit system states that the default unit of force is lbf, we would expect any force displayed in lbf unless explicitly otherwise demanded and this would also apply to plots.

 

Of course its always the best idea to divide by the units you'd like to see as done in the plots on the right side of my pictures. You are on the safe side doing so, so are nor forced to the standard units and you also see by the axis expressions the units without having to add an axis label.

 

To further clarify:

Werner_E_0-1598272758523.pngWerner_E_1-1598272800924.pngWerner_E_2-1598273118475.png

I still tend to call this a bug (which is not present in Prime)

 

Looks to me like Mathcad is defaulting to "basic units," and, unless told not to, dividing by lb as a mass.  Prime (4.0 Express) defaults to "lbf",

FredKohlhepp_0-1598276714536.png

I agree!  A bug!  At the very least, a nusiasnce.

 

prop_design
15-Moonstone
(To:Werner_E)

thanks werner,

 

i appreciate you figuring out a nice way of showing it and also confirming what i'm seeing. it gets even worse if you try and make a custom unit system, using the US system as the base. i was originally trying to get velocity to output by default as mph and force was supposed to default to pound force. if you plot that, it's really bad.

 

in any event, i hadn't used mathcad in so long, i couldn't really remember how to use it. i searched the forum and found the divide by unit trick. i think it would have been a lot better if the plot variables had unit placeholders like the variables. then it would have been intuitive. but using a metric unit system and dividing the plot variables by the desired units is fine, once you know to do that. now, if i can only remember to do that in the future.

 

thanks for taking the time to confirm what i was seeing and explain it better.

 

anthony

Top Tags