Am Montag, den 08.06.2009, 15:24 -0700 schrieb Richard Fateman:
> can you deal with inf*%i ? Check on what mathematica does -- I think it
> allows for a unit vector in any direction in the complex plane.
> adding all this to the simplifier is risky, e.g. inf+inf=inf,
> inf-inf=undefined or perhaps [].
> It would be hard to convince Robert D that this is a good idea if it
> slows things down.
> (Hard to convince me and others, too. But possible)
As a guide I have chosen the definitions on functions.wolfram.com and
related informations:
For the following I used the definitions:
directed_infinity(1) ---> '$inf
directed_infinity(-1) ---> '$minf
directed_infinity(0) ---> '$infinity
directed_infinity(false) ---> '$und or '$ind
I have not distinguished beetween '$und and '$ind and call both cases
indeterminate. This can be changed.
Next I have implemented the arithmetic (addition, multiplication,
exponentiation) for directed infinities. In a first try I have implemented
the code directly into the simplifying functions for add, mul and power.
I have tried to be complete. These are examples:
Numbers and symbols are absorbed from the directed infinity:
(%i5) 10+x+y+directed_infinity(z)+0+a+1+2*a
(%o5) directed_infinity(z)
The addition of inf and inf gives inf:
(%i19) directed_infinity(1)+directed_infinity(1)
(%o19) directed_infinity(1)
The addition of inf and minf gives indeterminate:
(%i33) directed_infinity(1)+directed_infinity(-1)
(%o33) directed_infinity(false)
But subtraction of inf and minf gives again inf:
(%i101) directed_infinity(1)-directed_infinity(-1)
(%o101) directed_infinity(1)
Multiplication with Zero gives indeterminate:
(i165) 0*directed_infinity(1)
(%o165) directed_infinity(false)
(%i167) 0*directed_infinity(-1)
(%o167) directed_infinity(false)
(%i169) 0*directed_infinity(0)
(%o169) directed_infinity(false)
Expressions in a multiplication are absorbed as an argument of the directed
infinity. The argument is simplified to the complex signum value:
(%i423) z*directed_infinity(1);
(%o423) directed_infinity(z/abs(z))
(%i424) (1+%i)*directed_infinity(1);
(%o424) directed_infinity((%i+1)/sqrt(2))
(%i425) sin(x)*directed_infinity(1);
(%o425) directed_infinity(sin(x)/abs(sin(x)))
The general case which simplifies to the correct expressions:
(%i243) directed_infinity(x)*directed_infinity(y)
(%o243) directed_infinity(x*y/(abs(x)*abs(y)))
Division of Zero through infinities:
(%i245) 0/directed_infinity(1)
(%o245) 0
But
(%i251) 0/directed_infinity(false)
(%o251) directed_infinity(false)
Zero and a directed infinity as a power:
(%i325) 0^directed_infinity(1)
(%o325) 0
(%i327) 0^directed_infinity(-1)
(%o327) directed_infinity(0)
Nested directed infinities are simplified:
(%i430) directed_infinity(directed_infinity(z));
(%o430) directed_infinity(z/abs(z))
Dieter Kaiser