|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
"empty list" results, inverse trig substitutions, "Floats" in "solve"I'm new to axiom, using it for calculations. There seems to be odd behaviour
when using "solve" on a list of equations. This is with the most recent axiom binary package, Version Axiom (May 2009), on Ubuntu 8.10 "intrepid". For instance: (8) -> solve([a=3+x,b=1-x,x=2],[a,b]) ... (8) [] Type: List List Equation Fraction Polynomial Integer So, the answer is "the empty list"?! That's not very useful, and seems not correct either. What am I missing here? Then instead: (9) -> solve([a=3+x,b=1-x,x=2],[a,b,x]) (9) -> (9) [[a= 5,b= - 1,x= 2]] Type: List List Equation Fraction Polynomial Integer That works. Why? Similarly, axiom seems confused about finding substitutions. For instance: (12) -> solve([ tan(bt)=(a*r)/(s*(r-d)), x=100*cos(bt), y=d*sin(bt)],[x,y,bt]) (12) -> (12) [[]] Type: List List Equation Expression Integer Here, "the empty list" again - why? If, instead, I "spell it out" for axiom, by taking the arctan instead, then (13) -> solve([bt=atan((a*r)/(s*(r-d))),x=100*cos(bt),y=d*sin(bt)],[x,y,bt]) (13) -> (13) [ (100r - 100d)s a d r [x= ----------------------------, y= ----------------------------, +-------------------------+ +-------------------------+ | 2 2 2 2 2 | 2 2 2 2 2 \|(r - 2d r + d )s + a r \|(r - 2d r + d )s + a r a r bt= atan(--------)] (r - d)s ] Type: List List Equation Expression Integer Axiom doesn't know about substituting inverse trig functions by itself? But then, again, (14) -> solve([bt=atan((a*r)/(s*(r-d))),x=100*cos(bt),y=d*sin(bt)],[x,y]) (14) -> (14) [[]] Type: List List Equation Expression Integer Arrrrgh! Ok, why is that again, returning "the empty list" when using "solve" with the truncated list of variables? On anther topic, "Floats" in "solve", where this works, mixing integers and floats: (16) -> solve([a=3+x,b=1-x,x=2.0],[a,b,x]) ... (16) [[a= 5.0,b= - 1.0,x= 2.0]] Type: List List Equation Fraction Polynomial Float and this works: (17) -> solve([a=3+x,b=1-x,x=2],0.001) ... (17) [[x= 2.0,a= 5.0,b= - 1.0]] Type: List List Equation Polynomial Float doing this, using "x=2.0" instead of "x=2": (18) -> solve([a=3+x,b=1-x,x=2.0],0.001) ... There are 20 exposed and 3 unexposed library operations named solve having 2 argument(s) but none was determined to be applicable. ... Cannot find a definition or applicable library operation named solve with argument type(s) List Equation Polynomial Float Float Arrrrgh! - the dreaded "none was determined to be applicable"! Does that make sense, that? Thanks in advance for any clues! Are these bugs? James _______________________________________________ Axiom-developer mailing list Axiom-developer@... http://lists.nongnu.org/mailman/listinfo/axiom-developer |
|
|
Re: "empty list" results, inverse trig substitutions, "Floats" in "solve"Hi James:
When you ask Axiom to solve solve([a=3+x,b=1-x,x=2],[a,b]) I believe (note, this is an educated guess, but simple problems in Axiom can often have deep reasons, so much so it is difficult to understand whether things are bugs or features) that x is treated as a parameter, or as lying in the coefficient domain (usually an integral domain). All polynomial equations are converted into polynomial ideals over the coefficient domain before using the solver. Thus an equation like x=2 is converted to x-2 (=0), but x-2 is a non-zero element of the coefficient domain when x is an indeterminate. To solve the equation in a,b, the coefficient domain is extended to its field of fractions, and x-2 is therefore a unit in the polynomial ring with a, b as indeterminates. The polynomial ideal is then a unit ideal, hence there is no solution. Of course, this is not what the user wants. The user wants to solve for a,b,x but just wants the projected part a, b of the solution. However, the "equation" x=2 does not involve a or b. If it is replaced by one that does, provided it forms a consistent system in the variables a, b with the rest (thus no single equation in x alone should be resulted through elimination), then the system will solved. solve([a=b+x,b=a-x,x=a-3],[a,b]) [[a= x + 3,b= 3]] If x is intended to be solved (not a parameter), then it should be considered as an indeterminate like a, b. Otherwise, if it is intended to substitute x with a value like 2, then it should be done after the system in a, b has been solved. By distinguishing the two cases when the variables to be solved is [a,b] or [a,b,x], Axiom allows the user to indicate his intention. I can't do much with the tan problem, since we have: solve([tan(b) = a],[b]) >> Error detected within library code: No identity element for reduce of empty list using operation append (You mileage may differ, since I am using a very old version of Axiom). This is clearly a bug, for the old version. William On Fri, 02 Oct 2009 13:29:29 -0600 James <james@...> wrote: >I'm new to axiom, using it for calculations. There seems >to be odd behaviour >when using "solve" on a list of equations. This is with >the most recent axiom >binary package, Version Axiom (May 2009), on Ubuntu 8.10 >"intrepid". For >instance: > > (8) -> solve([a=3+x,b=1-x,x=2],[a,b]) > ... > (8) [] > Type: List List Equation >Fraction Polynomial Integer > >So, the answer is "the empty list"?! That's not very >useful, and seems not >correct either. What am I missing here? > >Then instead: > > (9) -> solve([a=3+x,b=1-x,x=2],[a,b,x]) > (9) -> > (9) [[a= 5,b= - 1,x= 2]] > Type: List List Equation >Fraction Polynomial Integer > >That works. Why? > >Similarly, axiom seems confused about finding >substitutions. For instance: > > (12) -> solve([ tan(bt)=(a*r)/(s*(r-d)), x=100*cos(bt), >y=d*sin(bt)],[x,y,bt]) > (12) -> > (12) [[]] > Type: List List >Equation Expression Integer > >Here, "the empty list" again - why? > >If, instead, I "spell it out" for axiom, by taking the >arctan instead, then > > (13) -> >solve([bt=atan((a*r)/(s*(r-d))),x=100*cos(bt),y=d*sin(bt)],[x,y,bt]) > (13) -> > (13) > [ > (100r - 100d)s a >d r > [x= ----------------------------, y= >----------------------------, > +-------------------------+ > +-------------------------+ > | 2 2 2 2 2 | 2 > 2 2 2 2 > \|(r - 2d r + d )s + a r \|(r - 2d r >+ d )s + a r > a r > bt= atan(--------)] > (r - d)s > ] > Type: List List >Equation Expression Integer > >Axiom doesn't know about substituting inverse trig >functions by itself? > >But then, again, > > (14) -> >solve([bt=atan((a*r)/(s*(r-d))),x=100*cos(bt),y=d*sin(bt)],[x,y]) > (14) -> > (14) [[]] > Type: List List >Equation Expression Integer > >Arrrrgh! Ok, why is that again, returning "the empty >list" when using "solve" >with the truncated list of variables? > > >On anther topic, "Floats" in "solve", where this works, >mixing integers and >floats: > > (16) -> solve([a=3+x,b=1-x,x=2.0],[a,b,x]) > ... > (16) [[a= 5.0,b= - 1.0,x= 2.0]] > Type: List List Equation >Fraction Polynomial Float > >and this works: > > (17) -> solve([a=3+x,b=1-x,x=2],0.001) > ... > (17) [[x= 2.0,a= 5.0,b= - 1.0]] > Type: List List >Equation Polynomial Float > > >doing this, using "x=2.0" instead of "x=2": > > (18) -> solve([a=3+x,b=1-x,x=2.0],0.001) > ... > There are 20 exposed and 3 unexposed library >operations named solve > having 2 argument(s) but none was determined to be >applicable. > ... > Cannot find a definition or applicable library >operation named solve > with argument type(s) > List Equation Polynomial Float > Float > > >Arrrrgh! - the dreaded "none was determined to be >applicable"! >Does that make sense, that? > > >Thanks in advance for any clues! Are these bugs? > > >James > > > >_______________________________________________ >Axiom-developer mailing list >Axiom-developer@... >http://lists.nongnu.org/mailman/listinfo/axiom-developer William Sit, Professor Emeritus Mathematics, City College of New York Office: R6/202C Tel: 212-650-5179 Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/ _______________________________________________ Axiom-developer mailing list Axiom-developer@... http://lists.nongnu.org/mailman/listinfo/axiom-developer |
|
|
Re: "empty list" results, inverse trig substitutions, "Floats" in "solve"On Sat, Oct 3, 2009 at 2:20 PM, William Sit <wyscc@...> wrote:
> > I can't do much with the tan problem, since we have: > > solve([tan(b) = a],[b]) >>> >>> Error detected within library code: > > No identity element for reduce of empty list using operation > append > > (You mileage may differ, since I am using a very old version of Axiom). > > This is clearly a bug, for the old version. > Both Axiom (February 2009) and OpenAxiom (current) return (1) -> solve([tan(b) = a],[b]) (1) [] Type: List List Equation Expression Integer But FriCAS gives: wspage@debian:~$ fricas -nox FriCAS (AXIOM fork) Computer Algebra System Version: FriCAS 2009-09-17 Timestamp: Wednesday September 30, 2009 at 22:17:16 ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave FriCAS and return to shell. ----------------------------------------------------------------------------- (1) -> (1) -> solve([tan(b) = a],[b]) (1) [[b= 0]] Type: List(List(Equation(Expression(Integer)))) (2) -> Regards, Bill Page. _______________________________________________ Axiom-developer mailing list Axiom-developer@... http://lists.nongnu.org/mailman/listinfo/axiom-developer |
|
|
Re: "empty list" results, inverse trig substitutions, "Floats" in "solve"Hi James:
solve([a=3+x,b=1-x,x=2.0],0.001) is an "incorrectly" constructed command. The "solve" function that was applicable in solve([a=3+x,b=1-x,x=2],0.001) is available for the domain List Equation Fraction Polynomial Integer (from the package FLOATRP) but is not available when Integer is replaced by Float. According to documentation from FLOATRP, "solve(leq, eps)" finds all the real solutions of the system leq of equations of *rational* functions with respect to all the variables appearing in lp [sic:leq], with precision eps. Thus, despite the package is called with FLOATRP(FLOAT), the leq must be from List equation Fraction Polynomial Integer. I think the reason is that the package uses Groebner basis. See numsolve.spad for source: the restriction is given near the top, in package InnerNumericFloatingSolver (K specifies the coefficient field of the input polynomials and must be either Fraction Integer or Complex(Fraction Integer). William On Fri, 02 Oct 2009 13:29:29 -0600 James <james@...> wrote: >I'm new to axiom, using it for calculations. There seems >to be odd behaviour >when using "solve" on a list of equations. This is with >the most recent axiom >binary package, Version Axiom (May 2009), on Ubuntu 8.10 >"intrepid". For >instance: > > (8) -> solve([a=3+x,b=1-x,x=2],[a,b]) > ... > (8) [] > Type: List List Equation >Fraction Polynomial Integer > >So, the answer is "the empty list"?! That's not very >useful, and seems not >correct either. What am I missing here? > >Then instead: > > (9) -> solve([a=3+x,b=1-x,x=2],[a,b,x]) > (9) -> > (9) [[a= 5,b= - 1,x= 2]] > Type: List List Equation >Fraction Polynomial Integer > >That works. Why? > >Similarly, axiom seems confused about finding >substitutions. For instance: > > (12) -> solve([ tan(bt)=(a*r)/(s*(r-d)), x=100*cos(bt), >y=d*sin(bt)],[x,y,bt]) > (12) -> > (12) [[]] > Type: List List >Equation Expression Integer > >Here, "the empty list" again - why? > >If, instead, I "spell it out" for axiom, by taking the >arctan instead, then > > (13) -> >solve([bt=atan((a*r)/(s*(r-d))),x=100*cos(bt),y=d*sin(bt)],[x,y,bt]) > (13) -> > (13) > [ > (100r - 100d)s a >d r > [x= ----------------------------, y= >----------------------------, > +-------------------------+ > +-------------------------+ > | 2 2 2 2 2 | 2 > 2 2 2 2 > \|(r - 2d r + d )s + a r \|(r - 2d r >+ d )s + a r > a r > bt= atan(--------)] > (r - d)s > ] > Type: List List >Equation Expression Integer > >Axiom doesn't know about substituting inverse trig >functions by itself? > >But then, again, > > (14) -> >solve([bt=atan((a*r)/(s*(r-d))),x=100*cos(bt),y=d*sin(bt)],[x,y]) > (14) -> > (14) [[]] > Type: List List >Equation Expression Integer > >Arrrrgh! Ok, why is that again, returning "the empty >list" when using "solve" >with the truncated list of variables? > > >On anther topic, "Floats" in "solve", where this works, >mixing integers and >floats: > > (16) -> solve([a=3+x,b=1-x,x=2.0],[a,b,x]) > ... > (16) [[a= 5.0,b= - 1.0,x= 2.0]] > Type: List List Equation >Fraction Polynomial Float > >and this works: > > (17) -> solve([a=3+x,b=1-x,x=2],0.001) > ... > (17) [[x= 2.0,a= 5.0,b= - 1.0]] > Type: List List >Equation Polynomial Float > > >doing this, using "x=2.0" instead of "x=2": > > (18) -> solve([a=3+x,b=1-x,x=2.0],0.001) > ... > There are 20 exposed and 3 unexposed library >operations named solve > having 2 argument(s) but none was determined to be >applicable. > ... > Cannot find a definition or applicable library >operation named solve > with argument type(s) > List Equation Polynomial Float > Float > > >Arrrrgh! - the dreaded "none was determined to be >applicable"! >Does that make sense, that? > > >Thanks in advance for any clues! Are these bugs? > > >James > > > >_______________________________________________ >Axiom-developer mailing list >Axiom-developer@... >http://lists.nongnu.org/mailman/listinfo/axiom-developer William Sit, Professor Emeritus Mathematics, City College of New York Office: R6/202C Tel: 212-650-5179 Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/ _______________________________________________ Axiom-developer mailing list Axiom-developer@... http://lists.nongnu.org/mailman/listinfo/axiom-developer |
| Free embeddable forum powered by Nabble | Forum Help |