[sage-devel] Bug in solve?

2022-11-07 Thread Florian Buerzle
Sage version: 9.8beta3 (built on WSL Ubuntu)
Operating system: Windows 11

I tried to solve a logarithmic equation with solve, using algorithm='sympy':

var("x")
eq = log(x^2) == log(2*x,10)
solve(eq,x,algorithm='sympy')

The result was:

\displaystyle \verb|Complement(ConditionSet(x,|\verb| |\verb|Eq(x**2|\verb| 
|\verb|-|\verb| |\verb|(2*x)**(1/log(10)),|\verb| |\verb|0),|\verb| 
|\verb|Complexes),|\verb| |\verb|ConditionSet(x,|\verb| 
|\verb|Eq(x**(1/log(10)),|\verb| |\verb|0),|\verb| |\verb|Complexes))|


However, using sympy.solve directly

import sympy
var("x")
eq = log(x^2) == log(2*x,10)
sympy.solve(eq,x)

it returns the correct solution 

\displaystyle \left[\verb|2**(-1/(1|\verb| |\verb|-|\verb| 
|\verb|log(100)))|\right]

Is this a conversion bug into sympy input?

Best 
Florian







-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/d9ae17f5-b50a-4c0d-9248-4b7b389e5f41n%40googlegroups.com.


Re: [sage-devel] bug in solve?

2010-07-28 Thread Johannes
ok, i got my first mistake,
the first line in the functoin schould be this:
variables = [var("w" + str(i))for i in range(s.nvertices())]

but anyway, no reason for such a big problem.


Am 29.07.2010 01:15, schrieb Johannes:
> i just tried something with solving a equation, i think i did it the
> wrong way, but still it should not result in this:
>
> def calc_wights_by_sum(s)
> variables = var(["w" + str(i) for i in range(s.nvertices())])
> equation = reduce(lambda f1,f2: f1 + f2, [variables[i] * s.vertex(i)
> for i in range(s.nvertices())]) == 0
> print equation
> return solve(equation,variables)
>
> sage: calc_wights_by_sum(s)
> False
> Exception RuntimeError: 'maximum recursion depth exceeded in
> __subclasscheck__' in  ignored
> Exception RuntimeError: RuntimeError('maximum recursion depth exceeded
> in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded
> in __subclasscheck__' in  ignored
>  ignored
> Exception RuntimeError: 'maximum recursion depth exceeded in
> __subclasscheck__' in  ignored
> Exception RuntimeError: RuntimeError('maximum recursion depth exceeded
> in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded
> in __subclasscheck__' in  ignored
> [...]
>
> i just helped to kill python by killall -9 python.
>
> greatz Johannes
>
>   

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] bug in solve?

2010-07-28 Thread Johannes
i just tried something with solving a equation, i think i did it the
wrong way, but still it should not result in this:

def calc_wights_by_sum(s)
variables = var(["w" + str(i) for i in range(s.nvertices())])
equation = reduce(lambda f1,f2: f1 + f2, [variables[i] * s.vertex(i)
for i in range(s.nvertices())]) == 0
print equation
return solve(equation,variables)

sage: calc_wights_by_sum(s)
False
Exception RuntimeError: 'maximum recursion depth exceeded in
__subclasscheck__' in  ignored
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded
in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded
in __subclasscheck__' in  ignored
 ignored
Exception RuntimeError: 'maximum recursion depth exceeded in
__subclasscheck__' in  ignored
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded
in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded
in __subclasscheck__' in  ignored
[...]

i just helped to kill python by killall -9 python.

greatz Johannes

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org