Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I'm being "lazy" and using MathCad Prime (as I used MathCad) as a very souped-up calculator. I'm working with a 16-bit Digital-to-Analog Converter that has a range of ±10v, so I defined a unit DAU (D/A Unit) as 32768/10, and gave it the units of 1/V (where "V" is the units Volts).
The signal I'm sending through the D/A is the position of a sled, controlled by a stepper motor, where 8000 "steps" corresponds to 4.92 inches of travel. So I define a SU (Stepper Unit) as 4.92/8000 in (where "in" is the unit Inches).
Finally, I want to have the full range (10V) of the D/A converter correspond to 36" of travel. So what is the conversion factor from Stepper Units to D/A units?
Easy -- it is 1 SU times 10V/36 in times DAU. It does, indeed, give me the right answer, but the units show up as 1/V times V, i.e my Volts units do not cancel. I'll attach a file to illustrate what I mean.
Why don't the units cancel? Does explicitly declaring a "reciprocal unit" confuse MathCad? Is there a workaround that fixes this problem? Or is it a bug?
I used the same spreadsheet and did another problem, and the Volts cancelled! Indeed, simply copying the last "math" line below the final text box and re-evaluating it gets rid of the V/V units. Seems like a bug, but not a very serious one ...
They do cancel out, just delete the units.
MIke
If one simply "cancels the units" by hand, then why use units at all? The point of using units in MathCad, it seems to me, is to let MathCad handle conversion factors for you, and to do some (what we used to call) "Unit Checking" to see if your calculation is wildly off because you forgot a term. [I'm reminded of complicated College Physics problems, where once you balanced the equations so all the units came out, you probably had the numbers arranged correctly].
As I note below, if you simply repeat the expression that has the un-cancelled units a second time, MathCad "does the right thing" and cancels them as it should have done the first time. This is called Having Your Cake and Eating It, Too.
BS
I have seen some instances where Prime failed to recognise a typed unit as a unit. If this werre the case for the "V" in "1/V" then "1/V" times a unit "V" would not cancel. (Selecting "V" from the pull-down unit tool should cure that.
Fred,
Thanks for the suggestion. However, pasting the V from the "units" tool (whereever it was used) didn't work. I also tried, when defining DAU, to put the units in the denominator of the expression (instead of creating a 1/V unit for the whole thing), but that generated an error.
What does work is to simply put a copy of the expression that generates the 1/V * V "unit" to the right (or below) so that it evaluates again -- the second time, the units cancel (as they should). So it is clearly a "minor bug".
It's because you have a V in the units placeholder. Delete the evaluated answer, and then type "=" to evaluate it again. You will see a unitless answer. If you now type V in the units placeholder Mathcad is forced to add a 1/V so that the units still balance. You will get the same effect with any unit, or combination of units, typed into the units placeholder.
I'm puzzled by your statement that I have a "V in the units placeholder". What you see is what I typed into MathCad Prime (up to the "=" after the expression that results in the 1/V * V units). Curiously enough, I was sufficiently intrigued by your comment that I opened a blank sheet and typed in the three lines of Math again -- to my great surprise, the "extra units" are no longer there! It's not at all clear to me why it works once, but not twice (oohh, the submitted example was from a different PC, though that shouldn't be an issue, should it?).
BS
Are you sure you didn't type V in the place holder in the first place.
Mike
Yes, absolutely sure. I just typed the "=" sign, and let it evaluate. WYSIWIG (What You See Is What I Got).
BS
Fair enought. All I did was delete the unit and Mathcad accepted it, problem sorted 🙂
Mike
It's not at all clear to me why it works once, but not twice (oohh, the submitted example was from a different PC, though that shouldn't be an issue, should it?).
It's one of those things that will probably remain a mystery. Unless it happens again, I wouldn't worry about it.