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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

7-Bedrock

## Units are not compatible

Hello everyone,

I hope you are doing fine !

I recently decided to try Mathcad Prime for my calculations, and I found the software to be easy to use.

However, when I was writing an equation, I got the message "Units are not compatible"

Can someone help ?

ACCEPTED SOLUTION

Accepted Solutions
25-Diamond I
(To:DanyGebran)

@DanyGebran wrote:

But the thing is I really need to use the Nq, Nc and Ngamma in the formula. Can't I use dimensionless numbers ?

You can, but its not advisable. You should take advantage of Primes ability to detect unbalanced units

What should I do to solve this problem then ?

Use correct units for ALL factors.

I guess that c should be the shear strength above the level of the base of foot (and should be neglected because its set to 0). The shear strength has the unit of tension (force per area), typically N/mm^2 or MN/m^2.

In Prime you should also apply units to a value of zero. So, as Luc already suggested, you should use c:=0 N/mm^2 or something like this instead of just 0. The specific units do not matter (as the value is 0), all that matters is the dimension which has to be force per area.

9 REPLIES 9
25-Diamond I
(To:DanyGebran)

From the three summands, the first is dimensionless, but the last are pressure (kn/m^2).

You can't add quantities of different dimensions. Thats one of the great benefits in using Mathcad or even Prime that you immediately  notice unit inconsistencies.

For future questions please always also attach your work sheet as well.

7-Bedrock
(To:Werner_E)

But the thing is I really need to use the Nq, Nc and Ngamma in the formula. Can't I use dimensionless numbers ?

What should I do to solve this problem then ?

23-Emerald III
(To:DanyGebran)

Mathcad (and Prime) requires that every expression and equation is unit balanced. One way to achieve that is to use no units at all.

In your case it's also possible to define  c with a unit of N/m^2. So:

That will balance the units.

Success!
Luc

25-Diamond I
(To:DanyGebran)

@DanyGebran wrote:

But the thing is I really need to use the Nq, Nc and Ngamma in the formula. Can't I use dimensionless numbers ?

You can, but its not advisable. You should take advantage of Primes ability to detect unbalanced units

What should I do to solve this problem then ?

Use correct units for ALL factors.

I guess that c should be the shear strength above the level of the base of foot (and should be neglected because its set to 0). The shear strength has the unit of tension (force per area), typically N/mm^2 or MN/m^2.

In Prime you should also apply units to a value of zero. So, as Luc already suggested, you should use c:=0 N/mm^2 or something like this instead of just 0. The specific units do not matter (as the value is 0), all that matters is the dimension which has to be force per area.

23-Emerald I
(To:DanyGebran)

Without understanding what the terms in your picture represent, we can only guess.  Both Luc and Werner have made astute observations about your issue, noting that one missing unit selection on a variable that has value zero would balance your equation.

Another good argument for posting the whole sheet (to illustrate how things fit together.)

12-Amethyst
(To:DanyGebran)

Your equation looks to be empirical and mismatched units are the norm for empirical equations.

Because I deal a lot with water system hydraulics, I use the Hazen-Williams Equation a lot.*  The typical published form is V = (1.318)(C)(Rh^0.63)(S^0.54).  For my purposes HW works best when combined with the Continuity Equation, Q = (A)(V) = ((pi)(d^2)/4)(V), and Hydraulic Slope, S = HL/L, to produce this form:  Q = (k)(C)(d^2.63)((HL/L)^0.54).

In this form, the numeric part of k = ((1.318)(pi))/(4^1.63) = 0.432223.  However, the units are still unbalanced, so I make k = (0.432223)((ft^0.37)/s) to take care of this problem.  Alternatively, you could attach the units to the roughness coefficient, C.  The key with empirical equations is to help Mathcad by manually dealing with the unbalanced units.

When I use HW outside of Mathcad (which is most of the time), it gets even more complicated because I use d in inches and Q in gallons per minute.  So, here I must also include conversion factors for feet to inches and for cubic feet per second to gallons per minute.  I won't bore you with this version of the derivation.

* "a lot" means almost every day over a career that now exceeds 40 years.  I programmed a HW solver into my HP-41CV calculator nearly 40 years ago, then ported it to the HP-42S, which I used for 29 years until I replaced it with a SwissMicros DM42 several years ago.  For the quick what-if calculations I routinely do, the calculator is faster and more practical than Mathcad.  However, when I need to formalize a calculation, I mostly use Mathcad (sometimes Excel).  For big problems, such as solving an entire water system, I use specialty software such as Watercad, EPANET, etc.

7-Bedrock
(To:FredLusk)

Good morning sir, and sorry for the late reply (to all of those who answered).

I first want to say thank you all for your time and consideration. Your answers helped me continue my work.

However, in the exercise I was doing, the N factors have no units, they are geotechnical factors that are dimensionless. I tried to place the factors in the beginning of the formula and that helped, and I was quite surprised.

12-Amethyst
(To:DanyGebran)

If you want to maintain unitless factors, then you need to include the "balancing units" some other way.  One way would be to add units to each piece of the equation so that each piece you are adding ends up with the same units.  On way is put each such piece in parentheses, then append the necessary "balancing units."  Or, you could define variables U1, U2, etc. as 1*balancingunits, 1*otherbalancingunits. etc. and insert them in the same way as I suggest in the previous sentence.

25-Diamond I
(To:DanyGebran)

However, in the exercise I was doing, the N factors have no units, they are geotechnical factors that are dimensionless.

Yes, but the variable c definitely is NOT dimensionless (tension, force per area). And even though its value is zero, Prime insists that you provide the unit.

I don't think that its an empirical formula - providing the correct units for the shear strength c, its perfectly unit balanced, isn't it?

I tried to place the factors in the beginning of the formula and that helped, and I was quite surprised.

??? Can you show what you mean by this?

Announcements

Top Tags