ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 19 Aug 2020 08:29:03 +0200solve maxima need to prechew equ to succeed (solve sympy ok)https://ask.sagemath.org/question/53100/solve-maxima-need-to-prechew-equ-to-succeed-solve-sympy-ok/ HI
Ubuntu 18.04 , Jupyter notebook SageMath 9.1
vL=['x','y','x_o','y_o','a','b']
varL=var(vL)
for v in varL :
assume(v,'real')
eq02=y - y_o == -b^2*(x - x_o)*x/(a^2*y)
eq2=x^2/a^2 + y^2/b^2 == 1
# here I need to prechew
eq03=eq02.multiply_both_sides(y/b^2).expand()
SmaximaPrechewed=solve([eq03,eq2],x,y)
show("solution maxima ok prechewed : ",SmaximaPrechewed)
SsympyNotPrechewed=solve([eq02,eq2],x,y,algorithm='sympy')
show("solution sympy ok : ",SsympyNotPrechewed)
SmaximaNotPrechewedKO=solve([eq02,eq2],x,y,algorithm='maxima')
show("solution maxima not preChewed KO : ",SmaximaNotPrechewedKO)ortolljWed, 19 Aug 2020 08:29:03 +0200https://ask.sagemath.org/question/53100/Sage solve returns empty listhttps://ask.sagemath.org/question/40250/sage-solve-returns-empty-list/ I have very complex formula, and I have to solve that formula for one of variables (get some variable from expression). If I use solve() function is sage, it returns empty list, which is odd, but I found that it could be caused by too complex expression. So I managed to use sympy.solve(), but it returns exception. Here is part of my code:
k, u, v ,w , E, B, S, J, C1, C2 = var('k', 'u', 'v', 'w', 'E', 'B', 'S', 'J', 'C1', 'C2')
#assumptions
assume(B > 0)
assume(S > 0)
assume(J > 0)
assume(k > 0)
assume((u*E^2 + v*E + w) > 0)
f1 = (S == 1/6*(4*E^3*u + 3*E^2*v)/B + 1/6*(2*E^3*u + 3*E^2*v + 6*E*w)/B - k)
f2 = (J == E/B - k/(E^2*u + E*v + w))
#solve f1 and f2 for E
E_S = solve(f1, E)
E_J = solve(f2, E)
#under our assumptions only E_S[2] and A_J[2] are real
#so for that solutions lets find S
f_S1 = (E_S[2].right() == E_J[2].right())
#show(f_S1)
solve(f_S1, S) #returns []
import sympy
sympy.solve(f_S1, S) #returns exception
I tried to rewrite to sympy in spyder as well, but computations didint finish in two days so I canceled it.
BobeshWed, 20 Dec 2017 11:24:23 +0100https://ask.sagemath.org/question/40250/solve 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.sophiaSun, 03 Apr 2016 21:52:36 +0200https://ask.sagemath.org/question/32978/