Physical Units

Lee Harding lee.harding at autodesk.com
Thu Jan 22 20:56:36 CET 2004


I'm an engineer of the physical ilk (MSME), but semi-literate in the art
of C++ programming.  After discovering GiNaC today, I thought "nice
library ". 

I've created a few programs for optimizing things, doing simple FEA
(finite element analysis) and other sorts of calculations. Invariably, I
end up restricting the domain to a consistent set of physical units
(e.g. metric meter, kg, sec) or writing a lot of code to compensate for
varying units across the input.  For general-purpose tools, it can be a
real pain in the shorts to get right.

I haven't thought a great deal about why math libraries so consistently
ignore the problem of unit consistency and conversion.  But, I have
failed to do it successfully with other libraries.  For example, the Gnu
project citrus[1] is a unit conversion library that implements it's own
expression concept.  Units and expressions are inextricably tied, I
can't do my job without the old reliable kg/s/m^2 (aka. Newtons, aka.
energy) after all. 

And, what is sin(pi)?  Is that degrees or radians?

It seems worthwhile to explore integrating physical units to GiNaC, if
only to make like easier on poor engineers like myself.  Is that a
reasonable possibility?

[1] http://citrus.sourceforge.net/





More information about the GiNaC-list mailing list