login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Here are some integration problems submitted by "Anonymous". In at least one example, Axiom generated a segmentation fault. We will see if we can reproduce the problem here in a more controlled environment.

Test1

Start here:

axiom
integrate(x/sqrt(2*%pi)*exp(-1/2*log(x)**2),x=0..%plusInfinity)
LatexWiki Image(1)
Type: Union(pole: potentialPole,...)

Test2

Might not work:

axiom
integrate(1/sqrt(2*%pi)*exp(-1/2*log(x)**2),x=0..%plusInfinity, noPole)
There are 4 exposed and 1 unexposed library operations named integrate having 3 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op integrate to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named integrate with argument type(s) Expression Integer SegmentBinding OrderedCompletion Integer Variable noPole
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

Test3

A simpler integration:

axiom
integrate(1/sqrt(2*%pi)*exp(-1/2*x**2),x=%minusInfinity..%plusInfinity)
LatexWiki Image(2)
Type: Union(f1: OrderedCompletion? Expression Integer,...)

We are using the following version of Axiom:

axiom
)version
Value = "Friday November 9, 2007 at 19:35:06 "

Another definite integral
axiom
integrate(x^n*exp(-x^2/2), x=0..%plusInfinity,"noPole")
LatexWiki Image(3)
Type: Union(fail: failed,...)

What if the positive Integer is declare as a positiveInteger or even chosen, say, as 2:

axiom
n:PositiveInteger
Type: Void
axiom
integrate(x^n*exp(-x^2/2), x=0..%plusInfinity)
n is declared as being in PositiveInteger but has not been given a value. integrate(x^2*exp(-x^2/2), x=0..%plusInfinity)
LatexWiki Image(4)
Type: Union(fail: failed,...)

I think the idea that one should be able to "declare the type" of a variable in Axiom by the command
axiom
n:PositiveInteger
Type: Void

is a frequent expectation of new users of Axiom - especially if one have used other computer algebra systems, after all Axiom is supposed to be a "strongly typed" system, right? Certainly I was surprized (and disappointed) by Axiom's limitations in this reguard.

Unfortunately Axiom does not attempt to use this type information when forming expressions - but worse - declaring the type actually interferes with the use of the variable to form expressions!

When you write

axiom
n:PositiveInteger
Type: Void

what this tells Axiom is that n will be assigned an integer value greater than 0 - only that. After it is actually assigned some value, then it can be used exactly like that value, but not before.

To me, this is a tremedous waste of an opportunity in Axiom to to deal with "domain of computation" issues such as are addressed in other untyped computer algebra systems by the use of "assumptions" such as:

  assume(x,PositiveInteger);

Such knowledge can be used to considerably improve the quality and generality of the computations.

Another problem with integrate
Sat, 12 Mar 2005 08:25:13 -0600 reply
Consider the following piecewise function:
axiom
f(x | (x >=0) and (x <=1) ) == 1
Type: Void
axiom
f(x | (x<0) or (x > 1)) == 0
Type: Void

It is obvious that LatexWiki Image, while Axiom claims otherwise:

axiom
integrate(f(t), t=-1..2)
axiom
Compiling function f with type Variable t -> NonNegativeInteger
LatexWiki Image(5)
Type: Union(f1: OrderedCompletion? Expression Integer,...)

What's worse, it doesn't say that it cannot calsulate it, but it simply gives an incorrect result! Haven't I first tested it with such a simple example I wouldn't even know, the results are wrong. Any clue how to serve Axiom such function, so that it integrates them correctly? Is this a bug in Axiom or I'm doing something wrong? TIA




subject:
  ( 7 subscribers )  
Please rate this page: