ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 05 Apr 2016 16:12:05 -0500solve irrational inequalityhttps://ask.sagemath.org/question/32978/solve-irrational-inequality/Is there any way to solve the following inequality for `a` in Sage?
(It's pretty easy to do in Maple.)
abs(-1/4*a - 1/4*sqrt(a^2 - 30*a + 17) + 1/4) < 1
Using `solve` doesn't work. I tried using the QEPCAD package,
but on SageMathCloud, i get an error: "unable to start QEPCAD".
I tried using sympy-solve and sympy-solveset, and that didn't work either.
I plan to raise questions regarding sympy on stackexchange,
but if anyone has helpful guidelines on using sagemath's solve vs sympy-solve,
that'd be greatly appreciated. My general experience has been that sympy-solve
is a lot more capable than sagemath's solve.
Any help would be greatly appreciated. Thank you.
**EDIT**
Thank you for replying. I am able to use qepcad now, but the problem
I'm trying to solve takes a very long time. Here is the code:
var('a')
dnf = solve(abs(-1/4*a - 1/4*sqrt(a^2 - 30*a + 17) + 1/4) <= 1, a)
qf = apply(qepcad_formula.or_, map(qepcad_formula.and_, dnf)) # reformat the solution
qf
qepcad(qf, vars='(a)') # simplify
Any help solving this would be greatly appreciated. Also, would it be possible
to update the version of sympy on sagemathcloud? Thank you.Sun, 03 Apr 2016 14:52:36 -0500https://ask.sagemath.org/question/32978/solve-irrational-inequality/Answer by schilly for <p>Is there any way to solve the following inequality for <code>a</code> in Sage?</p>
<p>(It's pretty easy to do in Maple.)</p>
<pre><code>abs(-1/4*a - 1/4*sqrt(a^2 - 30*a + 17) + 1/4) < 1
</code></pre>
<p>Using <code>solve</code> doesn't work. I tried using the QEPCAD package,
but on SageMathCloud, i get an error: "unable to start QEPCAD".</p>
<p>I tried using sympy-solve and sympy-solveset, and that didn't work either.
I plan to raise questions regarding sympy on stackexchange,
but if anyone has helpful guidelines on using sagemath's solve vs sympy-solve,
that'd be greatly appreciated. My general experience has been that sympy-solve
is a lot more capable than sagemath's solve.</p>
<p>Any help would be greatly appreciated. Thank you.</p>
<p><strong>EDIT</strong></p>
<p>Thank you for replying. I am able to use qepcad now, but the problem
I'm trying to solve takes a very long time. Here is the code:</p>
<pre><code>var('a')
dnf = solve(abs(-1/4*a - 1/4*sqrt(a^2 - 30*a + 17) + 1/4) <= 1, a)
qf = apply(qepcad_formula.or_, map(qepcad_formula.and_, dnf)) # reformat the solution
qf
qepcad(qf, vars='(a)') # simplify
</code></pre>
<p>Any help solving this would be greatly appreciated. Also, would it be possible
to update the version of sympy on sagemathcloud? Thank you.</p>
https://ask.sagemath.org/question/32978/solve-irrational-inequality/?answer=33003#post-id-33003right now, sympy 1.0 is in the anaconda distribution on smc. so you can use it over there, but that's outside of the confined world of sagemath. I've no idea how you can mix this.Tue, 05 Apr 2016 08:02:23 -0500https://ask.sagemath.org/question/32978/solve-irrational-inequality/?answer=33003#post-id-33003Comment by sophia for <p>right now, sympy 1.0 is in the anaconda distribution on smc. so you can use it over there, but that's outside of the confined world of sagemath. I've no idea how you can mix this.</p>
https://ask.sagemath.org/question/32978/solve-irrational-inequality/?comment=33013#post-id-33013Thank you, I am able to access the latest version of sympy now. My original question was on solving the irrational inequality above. Is that not possible in sagemath? Thanks.Tue, 05 Apr 2016 16:12:05 -0500https://ask.sagemath.org/question/32978/solve-irrational-inequality/?comment=33013#post-id-33013Comment by slelievre for <p>right now, sympy 1.0 is in the anaconda distribution on smc. so you can use it over there, but that's outside of the confined world of sagemath. I've no idea how you can mix this.</p>
https://ask.sagemath.org/question/32978/solve-irrational-inequality/?comment=33006#post-id-33006Expanding @schilly's answer a tiny bit: to use the Sympy in Anaconda on SageMathCloud, open a new Jupyter notebook in one of your SageMathCloud projects, then in the "Kernel" menu pick "Change kernel > Anaconda" (you might have a choice between Anaconda 2 and Anaconda 3). Then you can import sympy and get going.Tue, 05 Apr 2016 08:52:48 -0500https://ask.sagemath.org/question/32978/solve-irrational-inequality/?comment=33006#post-id-33006Answer by slelievre for <p>Is there any way to solve the following inequality for <code>a</code> in Sage?</p>
<p>(It's pretty easy to do in Maple.)</p>
<pre><code>abs(-1/4*a - 1/4*sqrt(a^2 - 30*a + 17) + 1/4) < 1
</code></pre>
<p>Using <code>solve</code> doesn't work. I tried using the QEPCAD package,
but on SageMathCloud, i get an error: "unable to start QEPCAD".</p>
<p>I tried using sympy-solve and sympy-solveset, and that didn't work either.
I plan to raise questions regarding sympy on stackexchange,
but if anyone has helpful guidelines on using sagemath's solve vs sympy-solve,
that'd be greatly appreciated. My general experience has been that sympy-solve
is a lot more capable than sagemath's solve.</p>
<p>Any help would be greatly appreciated. Thank you.</p>
<p><strong>EDIT</strong></p>
<p>Thank you for replying. I am able to use qepcad now, but the problem
I'm trying to solve takes a very long time. Here is the code:</p>
<pre><code>var('a')
dnf = solve(abs(-1/4*a - 1/4*sqrt(a^2 - 30*a + 17) + 1/4) <= 1, a)
qf = apply(qepcad_formula.or_, map(qepcad_formula.and_, dnf)) # reformat the solution
qf
qepcad(qf, vars='(a)') # simplify
</code></pre>
<p>Any help solving this would be greatly appreciated. Also, would it be possible
to update the version of sympy on sagemathcloud? Thank you.</p>
https://ask.sagemath.org/question/32978/solve-irrational-inequality/?answer=32988#post-id-32988You should now be able to use qepcad on SageMathCloud.
Example:
https://cloud.sagemath.com/projects/fc94de41-6af4-4ee1-a684-c33a9e56b2b0/files/qepcad.sagews
**EDIT** (to answer the edit in the question)
The upgrade to Sympy version 1.0 is the object of
[Sage trac ticket #20185](http://trac.sagemath.org/ticket/20185).
It should make it into Sage 7.2 and become available in SageMathCloud
in a few weeks.Mon, 04 Apr 2016 09:26:10 -0500https://ask.sagemath.org/question/32978/solve-irrational-inequality/?answer=32988#post-id-32988