On Mon, Apr 04, 2022 at 02:47:48PM -0000, Brian McCall wrote:
> Asked and answered!
> 
> > * There are an unlimited number of derived (non-SI) and compound units 
> >   that people will want to use.
> 
> Unlimited? You sure that problem can't be bounded? 

Every problem can be bounded by the amount of matter and energy in the 
universe :-)

More practically, the problem is bounded by the number of addressable 
memory locations (2^64) and more practically still, by the amount of 
memory you actually have.

Presumably there is only a finite number of named measurement units 
which have ever been used in history, maybe a few thousand or so. A few 
days ago I pointed out that the Unix "units" program listed 2000+ units. 
I upgraded to a more recent version, and it now has over 3000:

    [steve ~]$ units
    Currency exchange rates from FloatRates (USD base) on 2018-10-20 
    3070 units, 109 prefixes, 109 nonlinear units

If the implementation had some reasonable hard limit like 20,000 named 
units, I wouldn't complain. But why? The obvious mapping from unit names 
to values is to use a dict, which is limited only by memory.


> In terms of the internal representation of units, the representation 
> that is use for machine calculations, there are only 7 units that need 
> to be supported. Everything else is a product of powers of these 7 
> units.

If you use the geometrized unit system, you need only one base unit, 
the metre. Everything can be written as a small power of length.

But for a more practical system, I count a minimum of 12 base 
dimensions:

* length
* mass
* time
* electric current
* thermodynamic temperature
* luminous intensity
* amount of substance
* amount of information
* currency
* plane angle
* solid angle
* other dimensionless (the name "uno" was proposed in 2003)

Some of these are strictly dimensionless in terms of the standard 
physics dimensional quantities, but we really don't want to be able to 
add 30 degrees to 1 yoctomol and get 1.1 radians.

(Reasonable people may disagree. So may unreasonable people.)

But as discussed in other parts of this loooong thread, there are other 
dimensionless quantities which we may wish to treat as distinct. Ratios?

Then there are at least three types of non-linear units:

- temperatures
- log scales such as bels (decibels) and moment magnitude scale for earthquakes
- piecewise linear (wire gauges etc)

and lets not forget prefixes.



-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/7FLXTDAQHTASYIQ3RJ6JIVFOPAC4SCH5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to