Question: What exactly is the difference between considering unassigned variables to be unit-free vs not unit-free?

I am reading the documentation on the `Units[Simple]` package.

There is a section that says

"In the Simple Units environment, in contrast to the Standard and Natural environments, unassigned variables are not automatically assumed to represent unit-free quantities. For example, 5m+x is a valid expression if x is unassigned, because x may represent a length. On the other hand (5m+x)(6s+x) is an invalid expression because the first factor implies that x represents a length and the second factor implies that x is a duration."

The way I understood this paragraph is that in Units:-Simple an unassigned variable is not assumed to represent a unit-free quantity, but in Units:-Standard it is assumed to represent a unit-free quantity.

Consider the expression 5m+x. This expression works in Units:-Simple but not in Units:-Standard.

Units:-Simple adds a quantity 5m to a quantity without units. But why can one add a quantity with units to a quantity without units?

Units:-Standard tries to add a quantity 5m to a quantity that is assumed to have units. What units are assumed?

Next, consider (5m+x)(6s+x).

This fails in both packages, as can be seen below (actually, for some reason, the embed below is not showing the expressions typed in for Units:-Standard, but can be seen if you download the worksheet I imagine).

restart

with(Units:-Simple)

5*Unit('m')+x

5*Units:-Unit(m)+x

(1)

(5*Unit('m')+x)*(6*Unit('s')+x)

Error, (in Units:-Simple:-*) the following expressions imply incompatible dimensions: {5*Units:-Unit(m)+x, 6*Units:-Unit(s)+x}

 

restart

with(Units:-Standard)

(5*Unit('m')+x)*(6*Unit('s')+x)

Error, (in Units:-Standard:-+) the units `m` and `1` have incompatible dimensions

 

5*Unit('m')+x

Error, (in Units:-Standard:-+) the units `m` and `1` have incompatible dimensions

 

NULL

So my question is, what exactly is the difference between considering unassigned variables to be unit-free vs not unit-free?

Download Units_Simple_vs_Standard.mw

Please Wait...