Discussion:
[Axiom-math] Simple question
Soren Hansen
2006-12-04 17:33:27 UTC
Permalink
Hi!

I'm a new Axiom user, so this is probably a very simple question, but it
really puzzles me:

(1) -> solve(x^10-1024, 1)

(1) [x= - 2,x= 2]
Type: List Equation Polynomial Fraction Integer


(2) -> solve(2^x-1024, 1)
There are 20 exposed and 3 unexposed library operations named solve
having 2 argument(s) but none was determined to be applicable.
Use HyperDoc Browse, or issue
)display op solve
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 solve
with argument type(s)
Expression Integer
PositiveInteger

Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
(2) ->


First question: What is so different about those two expressions?
Second question: How do I fix it?

The problem I actually wanted to solve was:
solve((250/x)^x-6000000000,1.e-5)

..which also doesn't work, but I expect that the answer to that will be
clear to me when my second question from above is answered.
--
Cheers, Søren.
Francois Maltey
2006-12-04 18:16:00 UTC
Permalink
Hello Soren, and Welcome !
Post by Soren Hansen
I'm a new Axiom user, so this is probably a very simple question, but it
(1) -> solve(x^10-1024, 1)
(1) [x= - 2,x= 2]
Type: List Equation Polynomial Fraction Integer
solve operate over Polynomial

Axiom isn't as the others CAS.
If you used maple or others you must change (just a little) your mind.
It's surprising at the beginning but some times after we appreciate
the typed language axiom. We must explain (to himself) what the want.
Post by Soren Hansen
(2) -> solve(2^x-1024, 1)
There are 20 exposed and 3 unexposed library operations named solve
having 2 argument(s) but none was determined to be applicable.
Use HyperDoc Browse, or issue
)display op solve
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 solve
with argument type(s)
Expression Integer
PositiveInteger
or "$" to specify which version of the function you need.
2^x isn't polynomial, it's a function with exp : 2^x = exp (x * log 2).

Axiom is very typed so 2^x in of type Expression Integer and there is
no solve over Expression Integer.

And I don't believe there are methods for such equations,
even if my eyes see the x=10 solution.

And Axiom don't have a lot of numerical methods.

What do you want to do with Axiom.

Have a nice day !

Francois (in France)
'Soren Hansen'
2006-12-04 21:36:22 UTC
Permalink
Post by Soren Hansen
(2) -> solve(2^x-1024, 1)
Note that there are forms of solve that take something of type
Expression Integer as the first argument.
I've been staring at the output of ")di op solve", but cannot spot it.
Does it say "Expression Integer" or does it perhaps say something else
that an "Expression Integer" can be implicitly converted to? I assume
Axiom sometimes does that kind of thing?
(3) -> solve((250/x)^x-6000000000)
(3) []
Type: List Equation Expression Integer
Unfortunately Axiom apparently cannot (yet) find an exact solution for
this one (requires LambertW).
Yes, I spotted LambertW in the output from Maple when I asked it the
same question. :-) I have however never heard of it before. Is it
difficult to implement? I'm thinking it could be my first stab at
implementing something new in Axiom. :-)
--
Cheers, Søren Hansen.
Ralf Hemmecke
2006-12-04 21:48:58 UTC
Permalink
Post by 'Soren Hansen'
Unfortunately Axiom apparently cannot (yet) find an exact solution for
this one (requires LambertW).
Yes, I spotted LambertW in the output from Maple when I asked it the
same question. :-) I have however never heard of it before. Is it
difficult to implement? I'm thinking it could be my first stab at
implementing something new in Axiom. :-)
Hi Bill,

the first time I saw LambertW was when Manuel Bronstein presented his
"Poor Man's Integrator". Since that is a very short Maple program (these
85 or so lines of code should be on his homepage) it would probably add
to the integration abilities of Axiom.

Would be nice to see that in Axiom. ;-)

Ralf
'Soren Hansen'
2006-12-05 17:55:55 UTC
Permalink
(1) -> )set message bottom on
Clever. This will come in handy. :-)
Post by 'Soren Hansen'
Yes, I spotted LambertW in the output from Maple when I asked it the
same question. :-) I have however never heard of it before. Is it
difficult to implement? I'm thinking it could be my first stab at
implementing something new in Axiom. :-)
You might be interested in: Chapter 22: First encounters of an Aldor
novice by Robert Corless
Yes, I already read it and converted it to spad. However, I'd like to
have it extended to what Maple can do (chosing different branches and
handling of complex numbers).
Post by 'Soren Hansen'
Would be nice to see that in Axiom. ;-)
Yes indeed. I would be glad to work with anyone having that objective.
I would be very interested in implementing both LambertW and whatever
else is needed for the function to be used when solving equations of the
w*exp(w) form. I'll probably need some help. I'll look into it in a few
days. I've got project deadlines coming up real soon. :-)
--
Mange hilsner, Søren Hansen.
Ralf Hemmecke
2006-12-04 20:55:01 UTC
Permalink
Post by Soren Hansen
solve((250/x)^x-6000000000,1.e-5)
Sorry to say, but that is not a good problem description. Try to
formulate the problem without the "solve" function and specify clearly
what solutions you accept. For example, there is no solution to

(250/x)^x = 6000000000

if you require x to be a natural number. You probably don't want that,
but your problem description is too vague. If you leave the computer to
guess something for you then you should prepare that a possible "answer"
is not that what you expect.

Ralf

PS: Maple 9.5 says

fsolve((250/x)^x-6000000000);
226.3269985

If that is of any help.
Soren Hansen
2006-12-04 21:44:54 UTC
Permalink
Post by Ralf Hemmecke
Post by Soren Hansen
solve((250/x)^x-6000000000,1.e-5)
Sorry to say, but that is not a good problem description.
I suppose I could have been more precise. I just expected the context to
make up for my lack of detail. I wanted to solve (250/x)^x=6000000000 to
to a precision of 10^-5. In my other example I managed to do that by
giving solve an expression for which it found the values of x where the
expression evaluated to zero. I - naïvely - thought a similar approach
would be sensible.
Post by Ralf Hemmecke
Try to formulate the problem without the "solve" function and specify
clearly what solutions you accept. For example, there is no solution
to
(250/x)^x = 6000000000
if you require x to be a natural number.
I was looking for an approximation with a set precision.
Post by Ralf Hemmecke
You probably don't want that, but your problem description is too
vague. If you leave the computer to guess something for you then you
should prepare that a possible "answer" is not that what you expect.
PS: Maple 9.5 says
fsolve((250/x)^x-6000000000);
226.3269985
If that is of any help.
Thanks, but I actually already found the answer using Maple. Maple's
version of solve gave me two solutions, each using LambertW. One
evaluated to ~226 and the other ~6.

I am merely trying to get the hang of Axiom in order to ditch Maple and
this seemed like a simple starting point.
--
Cheers, Søren Hansen.
Loading...