Updates:
Status: Started
Owner: mattpap
Cc: -mattpap
Labels: Solvers Polynomial Milestone-Release0.7.0 NeedsReview
Comment #3 on issue 989 by mattpap: solve fails for intersection of two
circles
http://code.google.com/p/sympy/issues/detail?id=989
This issue was fixed in edf8eaf851097c166a5e778eef6ca608e1c99c1a in
polys11, e.g.:
In [1]: var("x0 y0 x1 y1 r")
Out[1]: (x₀, y₀, x₁, y₁, r)
In [2]: eq1 = (x-1)**2+(y-2)**2-r**2
In [3]: eq2 = (x-x1)**2+(y-1)**2-r**2
In [4]: solve_poly_system([eq1, eq2], x, y)
Out[4]:
⎡⎛ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎞ ⎛
⎢⎜ ╱ 2 ⎛ 2 2⎞
╱ 2 ⎛ 2 2⎞ ⎟ ⎜
⎢⎜ ╱ -(1 - x₁) ⋅⎝2 - 2⋅x₁ + x₁ - 4⋅r ⎠ 2 ╱ -(1 -
x₁) ⋅⎝2 - 2⋅x₁ + x₁ - 4⋅r ⎠ ⎟ ⎜
⎢⎜1 + ╱ ────────────────────────────────── - x₁ ╱
────────────────────────────────── ⎟ ⎜1 -
⎢⎜ ╱ 2
╱ 2 ⎟ ⎜
⎢⎜ ╲╱ 2 - 2⋅x₁ + x₁
╲╱ 2 - 2⋅x₁ + x₁ ⎟ ⎜
⎢⎜────────────────────────────────────────────────────, 3/2 -
──────────────────────────────────────────⎟, ⎜───
⎣⎝ 2⋅(1 -
x₁) 2
⎠ ⎝
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎞⎤
╱ 2 ⎛ 2 2⎞ ╱ 2
⎛ 2 2⎞ ⎟⎥
╱ -(1 - x₁) ⋅⎝2 - 2⋅x₁ + x₁ - 4⋅r ⎠ 2 ╱ -(1 - x₁)
⋅⎝2 - 2⋅x₁ + x₁ - 4⋅r ⎠ ⎟⎥
╱ ────────────────────────────────── - x₁ ╱
────────────────────────────────── ⎟⎥
╱ 2
╱ 2 ⎟⎥
╲╱ 2 - 2⋅x₁ + x₁ ╲╱ 2
- 2⋅x₁ + x₁ ⎟⎥
─────────────────────────────────────────────────, 3/2 +
──────────────────────────────────────────⎟⎥
2⋅(1 -
x₁) 2 ⎠⎦
In [5]: eq1 = (x-x0)**2+(y-y0)**2-r**2
In [6]: eq2 = (x-x1)**2+(y-y1)**2-r**2
In [7]: %time s = solve_poly_system([eq1, eq2], x, y)
CPU times: user 1.12 s, sys: 0.00 s, total: 1.12 s
Wall time: 1.15 s
So, it doesn't hang any more and the results are (relatively) simple
(although large but this is the nature of the problem). Further
simplifications are possible in the most general case.
--
You received this message because you are subscribed to the Google Groups
"sympy-patches" group.
To post to this group, send email to sympy-patc...@googlegroups.com.
To unsubscribe from this group, send email to
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-patches?hl=en.