axiom-developer
[Top][All Lists]

[Axiom-developer] [#47 complexForm(log(%i) - log(-%i))]

 From: wyscc Subject: [Axiom-developer] [#47 complexForm(log(%i) - log(-%i))] Date: Thu, 14 Jul 2005 15:49:20 -0500

Changes
http://page.axiom-developer.org/zope/mathaction/47ComplexFormLogILogI/diff
--

<hr>
From: wyscc Thurs Jul 14 15:30:00 -5:00

>On the other hand, asking for 'TranscendentalFunctionCategory' also seems a
>lot, since only division by two is required.

Looking at the code above, to define 'argument' in 'COMPCAT R', it seems we
need, other than arithmetic in 'RING', the following:

<pre>
R has OrderedSet
atan: % -> %
zero?: R -> Boolean
recip: % -> Union(%,"failed")
pi: () -> R
</pre>

\begin{axiom}
half: ()-> EXPR INT
myhalf()==recip(2::EXPR INT)::EXPR INT
myArgument: Complex EXPR INT -> EXPR INT
myArgument(x) ==
zero? real x =>
imag(x) > 0 =>  pi()$(EXPR INT) * myhalf() imag(x) < 0 => - pi()$(EXPR INT) * myhalf()
error "myArgument not defined at (0,0)"
atan(imag(x)*recip(real(x)))
myArgument(-%i)
myArgument(%i)
myArgument(3+5*%i)
myArgument(3-5*%i)
myArgument(0::Complex EXPR INT)
\end{axiom}

Note, I think the current return of  'argument(0::Complex EXPR INT)' and
'argument(0::Complex INT)' as '%pi/2' are wrong.

\begin{axiom}
argument(0::Complex INT)
argument(0::Complex EXPR INT)
\end{axiom}

> * Should 'EXPR INT' have 'OrderedRing' ?

Even 'POLY INT' does not have 'OrderedRing' and the reason given was to allow
'EXPR' to implement 'abs'. I thought about this briefly and wonder what 'abs'
of a polynomial really should be and find no satisfactory answer (one
possibility is to define it relative to a term-ordering as the 'abs' of the
leading coefficient). You probably noted that 'OrderedRing' is not the same as
'Join(OrderedSet, Ring)'. One use of 'ORDRING' is to step through a segment.
Clearly, there is no canonical meaning to stepping from one expression (or
polynomial) to another (since some term-orderings like pure lex is not
*sequential* because there may be infinitely number of monomials between two).

> * Is 'TRAFUN' really necessary?

You meant 'TRANFUN'? (Maybe it's not since searching hyperdoc with '*TRANFUN*'
under constructors only returns 'FortranFunctionCategory' :-). Seriously, I
believe the reason is, like any other categories in Axiom, to allow multiple
domains in the category (say due to the different data-representations or
algorithms, or whether one wants symbolic computation or numerical), but to
also provide a few default implementations valid across all domains of the
category (unless overridden for some more efficient implementations).

In Axiom, it is easy (and we are sometimes forced) to spin out these
hierarchical categories and domains of abstractions. In any other system, such
abstractions are not really necessary because the author usually dictates every
choice (notation, algorithm, input, output conventions). I once worked with a
bright undergraduate student on developing something intended to be partial
differential polynomial ring (where derivations are abstract operators, not
necessarily the d/dx type) and wanted a flexible way to input/output partial
differential algebraic equations (something rather simple?) and the number of
categories and domains simply proliferated. One of the main hurdles is ordering
the pieces (a general multivariate partial differential monomial carries a lot
of data and notation). The student quitted, unfortunately leaving no notes of
our numerous discussions on the design. I wonder whether MB worked alone on the
design for transcendental functions or wrote notes to himse!
lf at least.

William

--