Post Reply 
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.

There is another problem that could take advantage of UNORMALIZE: let's suppose you want to compute the tangential velocity of a point orbiting along a circular path of radius 10_cm at 45_°/s. Of course vt = r*w = 450_cm*°/s.

Then you know that its mass is 200_g, therefore its momentum will be 20250000_g*cm^2*°^2/s^2. The application of 1_J UFACT yields 6.16...*10^-4_J*r^2.

Now I'm glad that the degree units have remained during the whole calculation, because this has allowed UFACT to perform the correct conversion.

It's just that now the radiant units are not needed anymore and the only way to discard them is by editing them out or by further unit manipulation.

Since the calc can't know when an adimensional unit is to be discarded, that's when UNORMALIZE comes to aid: the command is intended to work only with planar angles, solid angles and temperature ratios, and its task is simply to cancel these units from the object.

Nothing needs to be changed in the UBASE logic, because it's perfectly ok as it is now: it's only the user that can judge whether a unit object should be normalized or not.
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).

Probably in NewRPL similar commands would belong to an external library rather than main core, but to me they are the implementation of the best and more versatile strategies to simplify units.

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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
newRPL: Handling of units - Claudio L. - 09-23-2015, 03:38 PM
RE: newRPL: Handling of units - Han - 09-27-2015, 02:29 PM
RE: newRPL: Handling of units - Claudio L. - 09-28-2015, 01:50 PM
RE: newRPL: Handling of units - Claudio L. - 09-30-2015, 06:02 PM
RE: newRPL: Handling of units - JoJo1973 - 05-08-2016, 01:30 PM
RE: newRPL: Handling of units - JoJo1973 - 05-08-2016, 04:28 PM
RE: newRPL: Handling of units - Claudio L. - 05-08-2016, 05:38 PM
RE: newRPL: Handling of units - Claudio L. - 05-09-2016, 05:42 PM
RE: newRPL: Handling of units - JoJo1973 - 05-09-2016, 06:05 PM
RE: newRPL: Handling of units - Vtile - 05-11-2016, 02:27 PM
RE: newRPL: Handling of units - JoJo1973 - 05-08-2016, 06:21 PM
RE: newRPL: Handling of units - Claudio L. - 05-08-2016, 06:24 PM
RE: newRPL: Handling of units - JoJo1973 - 05-08-2016, 10:44 PM
RE: newRPL: Handling of units - emece67 - 05-08-2016, 09:06 PM
RE: newRPL: Handling of units - Claudio L. - 05-09-2016, 12:41 AM
RE: newRPL: Handling of units - emece67 - 05-08-2016, 10:01 PM
RE: newRPL: Handling of units - Claudio L. - 05-09-2016, 12:59 AM
RE: newRPL: Handling of units - emece67 - 05-09-2016, 05:55 AM
RE: newRPL: Handling of units - JoJo1973 - 05-09-2016, 09:22 AM
RE: newRPL: Handling of units - Claudio L. - 05-09-2016, 01:46 PM
RE: newRPL: Handling of units - JoJo1973 - 05-09-2016, 09:27 PM
RE: newRPL: Handling of units - Claudio L. - 05-11-2016 02:49 AM
RE: newRPL: Handling of units - JoJo1973 - 05-12-2016, 11:18 AM
RE: newRPL: Handling of units - Claudio L. - 05-09-2016, 09:51 AM
RE: newRPL: Handling of units - Claudio L. - 05-11-2016, 05:01 PM
RE: newRPL: Handling of units - Helix - 05-12-2016, 01:07 PM
RE: newRPL: Handling of units - Claudio L. - 05-12-2016, 04:58 PM
RE: newRPL: Handling of units - Helix - 05-12-2016, 11:58 PM
RE: newRPL: Handling of units - Claudio L. - 05-13-2016, 01:43 AM
RE: newRPL: Handling of units - Claudio L. - 05-13-2016, 01:35 PM
RE: newRPL: Handling of units - Helix - 05-13-2016, 11:12 PM
RE: newRPL: Handling of units - Claudio L. - 05-14-2016, 02:57 AM



User(s) browsing this thread: 1 Guest(s)