topoly vs. to_poly



Thanks Barton,

to_poly_solve is great!

(%i1) load(topoly)$
(%i2) load(polynomialp)$
(%i3) load("D:\\volker\\CVS\\maxima\\maxima\\share\\contrib\\topoly_solver.mac")$
(%i4) eq : sqrt(x-2) = x-14$
(%i5) to_poly_solve(eq,[x]);
(%o5)                             [[x = 18]]

But I didn't get the clou of to_poly and elim_allbut. In the above example, how can I use 
their information to judge whether 11 is a solution of eq or not?

(%i6) to_poly(eq);
                                   2      %pi                           %pi
(%o6) [[- x + %g1 + 14, x - 2 = %g1 ], [- --- < carg(%g1), carg(%g1) <= ---]]
                                           2                             2
(%i7) elim_allbut(first(%),[x]);
                         2
(%o7)                 [[x  - 29 x + 198], [x - %g1 - 14]]
(%i8) solve(first(%),[x]);
(%o8)                          [x = 18, x = 11]

Can I somehow be sure about 11 without testing?

(%i9) map( lambda([e],subst(rhs(e),x,eq)), % );
(%o9)                          [4 = 4, 3 = - 3]

Volker


Am 9 Sep 2007 um 19:34 hat Barton Willis geschrieben:

> One more thing: You might be interested in the to_poly based solver:
> 
> (%i1) load("C:/maximacvs/maxima/share/contrib/topoly_solver.mac")$
> (%i2) load("C:/maximacvs/maxima/share/contrib/topoly.lisp")$
> (%i3) load(polynomialp)$
> 
> (%i7) to_poly_solve(0.478+0.237*sqrt(v)-0.0124*v = 1,[v]);
> `rat' replaced -0.522 by -261/500 = -0.522
> `rat' replaced 0.237 by 237/1000 = 0.237
> `rat' replaced -0.0124 by -31/2500 = -0.0124
> 
> (%o7) [[v=(10665*sqrt(3)*sqrt(5)*sqrt(7)*sqrt(89)+1080585)/7688],
>        [v=-(10665*sqrt(3)*sqrt(5)*sqrt(7)*sqrt(89)-1080585)/7688]]
> 
> I think I forgot to include to_poly_solve.mac in the make file, so I think
> you'll need to get "topoly_solver.mac" from CVS. Also, a user shouldn't
> have to  load polynomialp. I'll look into these things.
> 
> BW
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima