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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Units are not compatible

DanyGebran
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 ?

DG_9695654_0-1604161884874.png

 

Thank you in advance !

1 ACCEPTED SOLUTION

Accepted Solutions


@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.

View solution in original post

9 REPLIES 9

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.

 

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 ?

LucMeekes
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:

LucMeekes_0-1604167265542.png

That will balance the units.

 

Success!
Luc


@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.

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.)

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.

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.

 

 

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.

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?

Top Tags