Comment #2 on issue 2087 by [email protected]: solver treats a nonlinear
expression as linear and mis-solves a true nonlinear system; fixed in
polys11 but slow
http://code.google.com/p/sympy/issues/detail?id=2087
Apparently something is still wrong here:
In [1]: F = [-10 + x + y**2, 20 - y + x*y + x**2]
In [2]: %time u = solve(F, x, y)
CPU times: user 0.04 s, sys: 0.00 s, total: 0.04 s
Wall time: 0.04 s
In [4]: for i in [0, 1]:
...: for j in [0, 1, 2, 3]:
...: print F[i].subs(zip((x, y), u[j])).evalf()
...:
...:
0
0
0
0
.0e-126 + .0e-126*I
.0e-126 - .0e-126*I
.0e-127 - .0e-126*I
5.92021002185507 + 2.05468381694801*I
although
(%i1) solve([-10 + x + y^2, 20 - y + x*y + x^2], [x, y]);
(%o1)
[[x = - 3.963619146646246 %i - 1.963805771877081,
y = 0.56545755124267 %i + 3.504789296681675],
[x = 3.963619146646246 %i - 1.963805771877081,
y = 3.504789296681675 - 0.56545755124267 %i],
[x = 4.217698864046327 %i + 1.463805771877079,
y = 0.70182938762197 %i - 3.004789296681675],
[x = 1.463805771877085 - 4.217698864046359 %i,
y = - 0.70182938762197 %i - 3.004789296681675]]
In [1]: F = [-10 + x + y**2, 20 - y + x*y + x**2]
In [2]: %time u = solve(F, x, y)
CPU times: user 0.04 s, sys: 0.00 s, total: 0.04 s
Wall time: 0.04 s
In [4]: map(N, u[0])
Out[4]: [-1.96380577187708 + 3.96361914664624⋅ⅈ, 3.50478929668168 -
0.565457551242665⋅ⅈ]
In [5]: map(N, u[1])
Out[5]: [-1.96380577187708 - 3.96361914664624⋅ⅈ, 3.50478929668168 +
0.565457551242665⋅ⅈ]
In [6]: map(N, u[2])
Out[6]: [1.46380577187708 + 4.21769886404633⋅ⅈ, -3.00478929668168 +
0.701829387621975⋅ⅈ]
In [7]: map(N, u[3])
Out[7]: [1.46380577187708 - 4.21769886404633⋅ⅈ, -3.00478929668168 -
0.701829387621975⋅ⅈ]
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.