I don't know of any nice way of converting the variables to symbolic
variables.
Even if you did compute the polynomials p1 and p2, and even if you did
manage to put it in the solve_* expressions after converting the
variables, the answer that you will get as the solution will not belong
to the QQ field in general. So, it is pointless to even do this
conversion to start with.
On 12/03/2012 05:19 PM, Cary Cherng wrote:
The patch in the ticket seemed to only address making the error messages
better. Is there some mechanism to convert p1 and p2 to symbolic based
polynomials in the below code
R.<g1,g2> = PolynomialRing(QQ)
...
# long sequence of calculations to compute polynomials p1 and p2
...
solve_ineq([p1 > 0, p2 > 0],[g1,g2])
On Monday, December 3, 2012 12:49:19 AM UTC-8, P Purkayastha wrote:
On 12/03/2012 09:44 AM, Cary Cherng wrote:
> I tried using solve_ineq in the notebook in the simple way below
and got
> an error. It seems to be related to
> http://trac.sagemath.org/sage_trac/ticket/11520
<http://trac.sagemath.org/sage_trac/ticket/11520>
> Is there a workaround?
>
> R.<g1,g2> = PolynomialRing(QQ)
> solve_ineq([g1 > g2],[g1,g2])
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "_sage_input_106.py", line 10, in <module>
> exec compile(u'open("___code___.py","w").write("# -*-
coding: utf-8 -*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("c29sdmVfaW5lcShbZzEgPiBnMl0sW2cxLGcyXSk="),globals())+"\\n");
execfile(os.path.abspath("___code___.py"))
> File "", line 1, in <module>
>
> File "/tmp/tmpwFoZvN/___code___.py", line 2, in <module>
> exec compile(u'solve_ineq([g1 > g2],[g1,g2])
> File "", line 1, in <module>
>
> File
"/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/relation.py",
line 1204, in solve_ineq
> return(solve_ineq_fourier(ineq, vars))
> File
"/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/symbolic/relation.py",
line 1115, in solve_ineq_fourier
> ineq0 = [i._maxima_() for i in ineq]
> AttributeError: 'bool' object has no attribute '_maxima_'
I think it is more related to this ticket:
http://trac.sagemath.org/sage_trac/ticket/13645
<http://trac.sagemath.org/sage_trac/ticket/13645>
As soon as you write g1 > g2, the expression is evaluated and you get a
boolean as a result. solve() or solve_ineq() clearly can't solve a
boolean. This inequality is not evaluated if you have normal symbolic
variables (declared using var()).
#11520 will be solved by the patch in #13645.
--
You received this message because you are subscribed to the Google
Groups "sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.