newRPL: Handling of units
|
05-11-2016, 02:49 AM
Post: #24
|
|||
|
|||
RE: newRPL: Handling of units
(05-09-2016 09:27 PM)JoJo1973 Wrote: I think that there are two competing issues there: cancellation of redundant units, and simplification strategies.I made a small change today: now non-dimensional base units are consistent with plain numbers. This doesn't make the radians disappear from the units, but makes it completely transparent, as you can have 1_m*r/s, coming from V=r*w, for example, and you can add 1_m/s, they will be considered consistent. You can also convert to 1_kph and the units will be consistent. There's other side effects, like adding a plain number is equivalent to adding 1_r, or 1_dB. Another, perhaps less desirable side effect is that unrelated non-dimensional units are convertible among themselves: you can convert 1_r into 1_dB and it's not an error: the units are indeed consistent. Also, you can add r/s to Hz and it's OK, because both are 1/s in the end. 180_° 0.1 + --> 185.7..._° I added 1_tr = 2*pi_r, and redefined 1_rpm = 1_tr/min This means now rpm can be converted directly into other angular speeds like r/s, or 1/s. (05-09-2016 09:27 PM)JoJo1973 Wrote: For what it concerns the simplification strategies, there exists a library that's better than a thousand words: let me introduce you to UTool by Carsten Dominik: his library performs everything you might desire about units, and even more (look esp. at USIMP, UUBASE UUFACT, UUDIM and ULCVT). I looked at UTOOLS. The menu is cool, the partial factorization of units is helpful. USIMP simply does UFACT on each element of the list. It's a start, but not too elaborated. And the user always has to "manually" define a list of their preferred units, and then "manually" again apply USIMP. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)