Grouping by units over add - progress, and a couple questions



I haven't been following this thread much most likely these comments will
be completely trivial and irrelevant, but here goes. It might be useful
to have a predicate which determines whether an expression is dimensionless,
another to determine whether a term has a well defined dimension, another
to determine whether two terms having a dimension have the same dimension.
These dimensions are defined as, say, L for length, T for time, M for mass,
or whatever people use. Every monomial in the basic dimensions (possibly with
negative exponents) defines a one dimensional space consisting of all
quantities which have that monomial as a description of their dimensions.
I say "one dimensional", even though the coefficients might look like they
depend on lots of parameters, since they are all dimensionless quantities
times that one monomial. So, it is one dimensional if we take the set of
scalars to be all dimensionless quantities. One can apply exponentials and
any other functions one likes to dimensionless quantities. One can add two
things provided they belong to the same monomial, otherwise not. One can
transform one dimensional quantity to another provided one chooses a unit
having dimensions equal to the monomial of the first, applies a function to
the dimensionless part, and multiplies the result by a unit having dimensions
equal to the monomial of the second dimensional quantity. So, any formula
for one thing in terms of another has to specify the units each is measured
in, so the latter can by divided by its unit, a function applied, and the
result multiplied by the unit for the former.

In other words, a function acting on dimensional quantities should have the
form f(x,unit1,unit2) or, more generally,
f([x1,u1,x2,u2,...,xn,un],u) where u1,...,un,u are units and xi and ui have
the same dimensions for all i.

f can then be written as, e.g. (x1+x2^(x3)^(x4)/x5 with the meaning
((x1/u1)+(x2/u2)^(x3/u3))^(x4/u4)/(x5/u5)*u and it is part of the job
of the package to verify that x1/u1,x2/u2,...,xm/un are dimensionless
before going any further with the computation. Or more generally vector
valued versions, with different coordinates possibly belonging to different
units, i.e.  f([x1,u1,x2,u2,...,xn,un],[v1,...,vm]) for vector valued
function declation with m coordinates having units v1,...,vm.
-- 
Ignorantly,
Allan Adler 
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.