axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] [Axiom-mail] [Axiom-mail] [Axiom-mail] [Axiom-mail] A


From: William Sit
Subject: [Axiom-developer] [Axiom-mail] [Axiom-mail] [Axiom-mail] [Axiom-mail] A newbyquestion about eval andExpression
Date: Mon, 14 Nov 2005 03:10:09 -0600

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


Doug Stewart wrote:
> 
> Changes http://page.axiom-developer.org/zope/mathaction/AxiomMail/diff
> --
> William Sit wrote:
> 
> >Changes http://page.axiom-developer.org/zope/mathaction/AxiomMail/diff
> >--
> >
> >
> >Doug Stewart wrote:
> >
> >
> >
> >>But it is a constant ---- How can I tell axiom that it is a constant?
> >>I tried this way but :-(
> >>)clear all
> >>digits 20
> >>-- n:=x^3+a1*x^2+a2*x+a3 ::Polynomial Fraction Integer
> >>
> >>a1:=1
> >>a2:=1
> >>a3:=1
> >>
> >>Q:=(3*'a2-'a1^2)/9
> >>R:=(9*'a1*'a2-27*'a3-2*'a1^3)/54
> >>S:  Complex Float :=(R+(Q^3+R^2)^(1/2))^(1/3)
> >>
> >>I thought that if I gave a1 a2 a3 some in integer values, that Maxima
> >>would then know that it was a constant but no it thinks it is a variable????
> >>
> >>
> >>
> >
> >Perhaps you try removing the single quotes?
> >
> >
> If I do that then it puts the ones in and that is not what I want.
> I want a symbolic answer not a numeric one.
> Doug Stewart

But you already have the symbolic formula in code (at least assuming S is not
0).
May be what you need is done in SOLVEFOR package in 
http://wiki.axiom-developer.org/images/zope/mathaction/axiom--test--1/src/algebra/solvefor.spad.pamphlet
which uses formulae to solve polynomials equations of degree 1 to 4. According
to that, the case S = 0 can be handled separately and the formulae you used
above is not valid (that is, S will not be 0 in that case).

So you can do:

pkg:= SOLVEFOR(UP('x,Complex Float), Complex Float)
root := aCubic(1,1,1,1)$pkg
qfactor := monicDivide(x^3 + x^2 + x + 1,x - root)
qfactor.quotient
qfactor.remainder

see SandboxQubic page
http://page.axiom-developer.org/zope/mathaction/SandBoxQubic#bottom

William

--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden




reply via email to

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