axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Anybody up for a few basic Aldor questions?


From: C Y
Subject: Re: [Axiom-developer] Anybody up for a few basic Aldor questions?
Date: Fri, 18 Aug 2006 18:38:53 -0700 (PDT)

--- Ralf Hemmecke <address@hidden> wrote:

> Hi Cliff,
> 
> if I think about dimensions then that is a multiplicative structure.

Right

> In fact, to me it looks like a commutative group where the free
> generators are the basic SI dimensions.

The SI system dimensions can be defined this way as a first
approximation.

> So an implementation would be
> 
> Dimension: with {
>      *: (%, %) -> %;
>      /: (%, %) -> %;
>      kilogramm: %;
>      meter: %;
>      second: %;
>      ...
> } == add {
>      Rep == Array Integer;
>      import from Rep;
>      -- Suppose we have n basic units then the array would ALWAYS be
>      -- of length n. For simplicity I set n = 4;
>      local new(): Rep == per new(4, 0); -- create array of size 4
>      kilogram: % == {x := new(); x.1 := 1; per x}
>      meter: %    == {x := new(); x.2 := 1; per x}
>      second: %   == {x := new(); x.3 := 1; per x}
>      (x: %) * (y: %): % == per [xx+yy for xx in rep x for yy in rep
> y];
>      (x: %) / (y: %): % == per [xx-yy for xx in rep x for yy in rep
> y];
>      ...
> }
> 
> You can easily recognize if your dimension is a basic unit by just 
> running through the array and testing whether there is exactly ONE 1.

The thing is, different systems may have different basic dimensions -
they are not universal.
 
> Why would you want anything else? Can you give an explicit pointer to
> the text you have already written about units and dimensions?

Yes - it is incomplete, but there is a pdf here: 
http://portal.axiom-developer.org/Members/starseeker/axiomunit_diagramtest.pdf/download

> If you like, you could change the representation to allow infinitely 
> many basic dimensions (= infinitely many variables).

Probably not necessary, but different systems will have different
numbers of basic dimensions.  I think SI actually has one of the
largest.
 
> Your suggestion
> 
>  > BasicDimension: Abelian with {
>  >   "*": (%,%) -> DerivedDimension
>  > }
>  > == add {
>  >   Rep = Record(name : String, definition : String, system :
> String)
>  > }
> 
> looks completely unnatural to me.

Not surprising.  This is also my first foray into Aldor coding, and I'm
not familiar enough with what's there in Axiom to know how to build
this :-(.  However, I see no remedy to that but to try.

> How would you ever define * explicitly?
> 
> To me it looks more like you define a box that contains name and 
> definition of the dimension, but no multiplicative structure. Remove
> the * signature. That would appear in DerivedDimension anyway.

OK.

> And if you want BasicDimension, just add an exponent entry to your 
> representation
> 
> Rep = Record(exponent: Integer,
>               name : String,
>               definition : String,
>               system : String)

Hmm - that might work.  I was stuck thinking that a dimension to a
power is a different physical property.  Is time^2 a derived dimension
since it isn't in the array of basic dimensions as time^2, but just
time?

> and change my representation to
> 
> Rep == Array BasicDimension;
> 
> (And of course adapt the functions.)

> > Unfortunately the difficulties don't stop there - some
> > DerivedDimension in the SI system have no definitive definition in
> > terms of BasicDimensions, so some DerivedDimensions will have to
> > have parts of their structure undefined.
> 
> Can you give an example.

It is discussed in the paper - the primary difficulty revolves around
derived dimensions incorporating radians.

> Looking at your code, I find it unreadable. And if that is the case
> one should clearly think about another way of doing it.

Heh - I'm looking for A way to do it.  That was just pseudocode at
best.

> And I cannot follow why you would like "Polynomial" to appear. Is
> there a dimension that looks like
> 
>    4*m^2 + 5*kg/s

Actually, there will be some cases with a derived dimension not being
simplifiable directly to basic dimensions where such expressions might
arise.  In a system with no definition issues for derived dimensions
the answer would be no, but unfortunately that's not the situation with
SI.  For example, the distinction between Work and Moment of Force
cannot be expressed in terms of basic SI dimensions.  So they cannot be
added to either each other or a basic dimensional expression containing
their "definition", because that definition is not unique.  It's
discussed more in the writeup.

Cheers, and thanks!

Cliff



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]