Units > Unit Checking
Unit Checking
In PTC Mathcad, you can multiply or divide quantities that have arbitrary units:
However, you cannot add or subtract them:
Adding or subtracting quantities that have incompatible units results in a unit-checking error. This is because length and mass are physical quantities that do not have the same dimension.
Adding or subtracting two different physical quantities that have the same dimension, no error is returned. For example, you can add energy and torque together since both of them have the same dimension with base units of (m2·kg/s2) or an equivalent compound unit of Joule.
When you define a function with incompatible units, you do not see an error. The function dimension is only checked when the function is evaluated.
Function Definition
Function Evaluation
Function Arguments
The function arguments must have units that are compatible with the function definition:
When an argument of a built-in function is an array, the columns, the rows, or the elements of the array must in some cases be unit compatible. For the histogram function, the second argument is a column vector of data and all the elements in that vector must have compatible units.
Compatible Units
Incompatible Units
Was this helpful?