#14628: Zero solution does not result in zero
-------------------------+--------------------------------------------------
Reporter: gagern | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-5.10
Component: symbolics | Keywords:
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
-------------------------+--------------------------------------------------
In the following case, the `solve` function of sage 5.8 will yield a list
of incorrect solutions, whereas the correct solution is missing. The
computation involves complex numbers, symbolic expressions and
trigonometric functions.
{{{
----------------------------------------------------------------------
| Sage Version 5.8, Release Date: 2013-03-15 |
| Type "notebook()" for the browser-based notebook interface. |
| Type "help()" for help. |
----------------------------------------------------------------------
sage: phi = var('phi', domain='real')
sage: M = Matrix([
....: [-sqrt(-I)/(exp(I*phi)-1), sqrt(-I)/(exp(I*phi)-1)],
....: [-1/(exp(I*phi)-1)+exp(-I*phi), 1/(exp(I*phi)-1)]])
sage: z = M*vector((-I, 1))
sage: z = z[0]/z[1]
sage: zi = z.imag_part()
sage: s1 = [s.rhs() for s in solve(zi == 0, phi)]
sage: s1
[0, pi - arccos(1/2*sqrt(5) - 1/2), arccos(1/2*sqrt(5) + 1/2)]
sage: N(zi.subs(phi=s1[1]))
0.244669085661435
sage: zi.subs(phi=pi/2)
0
}}}
The correct solution was found from an easier form of `zi`, which is
`-1/2*sqrt(2)*cos(phi)/(sin(phi) + 1)`. I first
[http://ask.sagemath.org/question/2600/zero-solution-does-not-result-in-
zero reported] this at asksage, and tmonteil
[http://ask.sagemath.org/question/2600/zero-solution-does-not-result-in-
zero?answer=3579#3579 confirmed] that this is a bug, not my mistake.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14628>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.