noninteractive and topoly together



The function to_poly_solve tries to be careful; try this (eq is your
equation) workaround:

 (%i3) to_poly(eq,[phi2])$
 (%i4) elim(first(%),[%g0,%g1])$

 (%i5) sol : solve(first(%),phi2);

 (%o5)
[phi2=(((48*Sc-48)*cRhat-72*gamma3*Sc+72*gamma3)*thetaR+((72-72*Sc)*cRhat+72*gamma3*Sc-72*gamma3)*thetaF+

((24*l+72)*Sc-24*l-72)*cRhat-72*gamma3*Sc+72*gamma3)/(Sc^2*cRhat*thetaR+(24-24*Sc)*cRhat*thetaF+

(-l*Sc^2+(24*l+24)*Sc-24*l-24)*cRhat),phi2=(3*cRhat-3*gamma3)/cRhat,phi2=3]

(%i11) for si in sol do print([si,radcan(subst(si, eq))]);
  <radcan believes in the multi-valueness of sqrt, so all solutions are OK>

(%i12) for si in sol do print([si,ratsimp(subst(si, eq))]);
  <the 2nd and 3rd solutions are OK, the first doesn't verify>

So to_poly_solve finds two solutions; depending on some messy inequality,
conditionally
there is a third solution.

Here's a simple example of how to_poly_solve tries to be careful; since
-1 + %i isn't in the range of the square root, the solution set of
sqrt(x)=-1 + %i
is empty:

 (%i2) to_poly_solve(sqrt(x)=-1 + %i,[x]);
 (%o2) []

 (%i3) to_poly_solve(sqrt(x)=1 + %i,[x]);
 (%o3) [[x=2*%i]]

I'd like to_poly_solve to remain careful (I wrote it by the way), but the
questions your example generates makes me wonder if I could improve the
algorithm.

If asksign always allowed a "I don't know" response (and the calling
program
knew what to do with the returned "I don't know" value), ...

Barton


-----maxima-bounces at math.utexas.edu wrote: -----

>I've appended a Maxima script below, which (5.15.0 under SBCL 1.0.17)
>asks a whole bunch of questions (up to eight of them), then comes up
>with a set of solutions; I haven't explored every possible permutation
>of answers to the questions yet, but it looks like the same three
>solutions keep cropping up again and again.  Thinking it would be nice
>to automate keeping track of this, I added load(noninteractive); on
>the start of the script (either before or after loading
>topoly_solver).  All I got were two long conditional expressions
>capped off by "then to_poly_solve(%, phi2)", i.e. the solver wasn't
>actually run (beyond producing its first question).  Any ideas,
>please?
>
>Thanks
>
>Dan Hatton
>
>load(topoly_solver);
>(((sqrt(3)*phi2-3*sqrt(3))*Sc-2*sqrt(3)*phi2+6*sqrt(3))*cRhat+3*sqrt(3)*ga
>mma3*Sc-6*sqrt(3)*gamma3)*sqrt(-(((phi2^3-198*phi2^2+1161*phi2-1728)*Sc^2+
>(336*phi2^2-2016*phi2+3024)*Sc-144*phi2^2+864*phi2-1296)*cRhat^2+((72*gamm
>a3*phi2^2-432*gamma3*phi2+648*gamma3)*Sc-72*gamma3*phi2^2+432*gamma3*phi2-
>648*gamma3)*cRhat)*thetaR^2-((((-24*phi2^3+216*phi2^2-648*phi2+648)*Sc+24*
>phi2^3-216*phi2^2+648*phi2-648)*cRhat^2+((-72*gamma3*phi2^2+432*gamma3*phi
>2-648*gamma3)*Sc+72*gamma3*phi2^2-432*gamma3*phi2+648*gamma3)*cRhat)*theta
>F+((-2*l*phi2^3+396*l*phi2^2-2322*l*phi2+3456*l)*Sc^2+((24*l+24)*phi2^3+(-
>888*l-216)*phi2^2+(4680*l+648)*phi2-6696*l-648)*Sc+(-24*l-24)*phi2^3+(504*
>l+216)*phi2^2+(-2376*l-648)*phi2+3240*l+648)*cRhat^2+(((72*gamma3-72*gamma
>3*l)*phi2^2+(432*gamma3*l-432*gamma3)*phi2-648*gamma3*l+648*gamma3)*Sc+(72
>*gamma3*l-72*gamma3)*phi2^2+(432*gamma3-432*gamma3*l)*phi2+648*gamma3*l-64
>8*gamma3)*cRhat)*thetaR-(((24*l*phi2^3-216*l*phi2^2+648*l*phi2-648*l)*Sc-2
>4*l*phi2^3+216*l*phi2^2-648*l*phi2+648*l)*cRhat^2+((72*gamma3*l*phi2^2-432
>*gamma3*l*phi2+648*gamma3*l)*Sc-72*gamma3*l*phi2^2+432*gamma3*l*phi2-648*g
>amma3*l)*cRhat)*thetaF-((l^2*phi2^3-198*l^2*phi2^2+1161*l^2*phi2-1728*l^2)
>*Sc^2+((-24*l^2-24*l)*phi2^3+(552*l^2+216*l)*phi2^2+(-2664*l^2-648*l)*phi2
>+3672*l^2+648*l)*Sc+(24*l^2+24*l)*phi2^3+(-360*l^2-216*l)*phi2^2+(1512*l^2
>+648*l)*phi2-1944*l^2-648*l)*cRhat^2-((-72*gamma3*l*phi2^2+432*gamma3*l*ph
>i2-648*gamma3*l)*Sc+72*gamma3*l*phi2^2-432*gamma3*l*phi2+648*gamma3*l)*cRh
>at)+sqrt((phi2^2-6*phi2+9)*cRhat^2+(6*gamma3*phi2-18*gamma3)*cRhat+9*gamma
>3^2)*(((72-24*phi2)*Sc^2+(72*phi2-216)*Sc-48*phi2+144)*cRhat*thetaR+((24*l
>*phi2-72*l)*Sc^2+(216*l-72*l*phi2)*Sc+48*l*phi2-144*l)*cRhat)
>= 0;
>to_poly_solve(%,phi2);_______________________________________________
>Maxima mailing list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima