# Assuming seems not working and “Solve::svars: Equations may not give solutions for all ”solve“ variables.” issue

I am trying to solve these equations

    Assuming[{x1 ∈ Reals && x1 > 0 && x1 < 1},
Solve[{(a3 - r2)^2 + (b3 + r2 - 1)^2 ==
r2^2, (a6 - r2)^2 + (b6 + r2 - 1)^2 == r2^2,
b5 == k1*(a5 - 1) + 1, b3 == k1*(a3 - 1) + 1,
b2 == k1*(a2 - 1) + 1, b6 == k2*(a6 - a1) + b1,
b4 == k2*(a4 - a1) + b1, (a2 - 1/2)^2 + (b2)^2 ==
1/4, (a1 - 1/2)^2 + (b1)^2 == 1/4, (a4 - x1)^2 + (b4 - y1)^2 ==
r1^2, x1 + r1 == 1, (a5 - x1)^2 + (b5 - y1)^2 ==
r1^2, (y1 - b4)*k2 == -(x1 - a4), (b1)*k2 == -(a1 - 1/2), (b2)*
k1 == -(a2 - 1/2), (1 - r2 - b3)*k1 == -(r2 - a3), (1 - r2 - b6)*
k2 == -(r2 - a6), (b5 - y1)*k1 == -(a5 - x1)}, {x1, y1, r1, r2,
k1, k2, a1, a2, a3, a4, a5, a6, b1, b2, b3, b4, b5, b6}]]


And it does output a valid solution

x1 -> 5/6, y1 -> 2/3, r1 -> 1/6, r2 -> 1/4, k1 -> 3/4, k2 -> -(4/3),
a1 -> 9/10, a2 -> 1/5, a3 -> 2/5, a4 -> 7/10, a5 -> 11/15, a6 -> 9/20,
b1 -> 3/10, b2 -> 2/5, b3 -> 11/20, b4 -> 17/30, b5 -> 4/5, b6 -> 9/10


But it also outputs a bunch of other invalid/undesired "solutions". I was trying to limit the output by using Assuming, apparently it does not work though.

Also, the console outputs

Solve::svars: Equations may not give solutions for all "solve" variables.


However, I clearly gave 18 variables with 18 equations. Why so?

My mma is 9.0.0.0. on mac.

• Assuming is only useful for functions that take the Assumptions option. Solve doesn't do that. BTW 9.0.0.0 is not the most current version of Mathematica. You should upgrade to 9.0.1 as yours has serious flaws. – Sjoerd C. de Vries May 14 '14 at 9:50
• The message indicates that, notwithstanding #eqns=#vars, there is a dimensional component in the solution set. (It's not a "complete intersection", if that's meaningful.) – Daniel Lichtblau Jun 10 '14 at 16:04

Using v 9.0 on a Mac

\$Version


"9.0 for Mac OS X x86 (64-bit) (November 20, 2012)"

eqns = {(a3 - r2)^2 + (b3 + r2 - 1)^2 == r2^2, (a6 - r2)^2 + (b6 + r2 - 1)^2 == r2^2, b5 == k1*(a5 - 1) + 1, b3 == k1*(a3 - 1) + 1, b2 == k1*(a2 - 1) + 1, b6 == k2*(a6 - a1) + b1, b4 == k2*(a4 - a1) + b1, (a2 - 1/2)^2 + (b2)^2 == 1/4, (a1 - 1/2)^2 + (b1)^2 == 1/4, (a4 - x1)^2 + (b4 - y1)^2 == r1^2, x1 + r1 == 1, (a5 - x1)^2 + (b5 - y1)^2 == r1^2, (y1 - b4)*k2 == -(x1 - a4), (b1)*k2 == -(a1 - 1/2), (b2)*k1 == -(a2 - 1/2), (1 - r2 - b3)*k1 == -(r2 - a3), (1 - r2 - b6)*k2 == -(r2 - a6), (b5 - y1)*k1 == -(a5 - x1)};

sol = Solve[eqns, {x1, y1, r1, r2, k1, k2, a1, a2, a3, a4, a5, a6, b1, b2, b3, b4, b5, b6}];


Solve::svars: Equations may not give solutions for all "solve" variables. >>

Length[sol]


20

Assuming that you are looking for real solutions:

solr = Select[sol, FreeQ[N[#], Complex[_, _]] &];

Length[solr]


12

Some solutions are dependent on y1. Removing those,

solr2 = Select[solr, Length[#] == 18 &]


{{x1 -> 1/2, y1 -> 0, r1 -> 1/2, r2 -> 1/4, k1 -> 3/4, k2 -> -(4/3), a1 -> 9/10, a2 -> 1/5, a3 -> 2/5, a4 -> 9/10, a5 -> 1/5, a6 -> 9/20, b1 -> 3/10, b2 -> 2/5, b3 -> 11/20, b4 -> 3/10, b5 -> 2/5, b6 -> 9/10}, {x1 -> 2, y1 -> 1/2, r1 -> -1, r2 -> 1/4, k1 -> 3/4, k2 -> -(4/3), a1 -> 9/10, a2 -> 1/5, a3 -> 2/5, a4 -> 6/5, a5 -> 7/5, a6 -> 9/20, b1 -> 3/10, b2 -> 2/5, b3 -> 11/20, b4 -> -(1/10), b5 -> 13/10, b6 -> 9/10}, {x1 -> 5/6, y1 -> 2/3, r1 -> 1/6, r2 -> 1/4, k1 -> 3/4, k2 -> -(4/3), a1 -> 9/10, a2 -> 1/5, a3 -> 2/5, a4 -> 7/10, a5 -> 11/15, a6 -> 9/20, b1 -> 3/10, b2 -> 2/5, b3 -> 11/20, b4 -> 17/30, b5 -> 4/5, b6 -> 9/10}, {x1 -> 2/3, y1 -> 7/6, r1 -> 1/3, r2 -> 1/4, k1 -> 3/4, k2 -> -(4/3), a1 -> 9/10, a2 -> 1/5, a3 -> 2/5, a4 -> 2/5, a5 -> 13/15, a6 -> 9/20, b1 -> 3/10, b2 -> 2/5, b3 -> 11/20, b4 -> 29/30, b5 -> 9/10, b6 -> 9/10}, {x1 -> 1/2, y1 -> 0, r1 -> 1/2, r2 -> 1/4, k1 -> 3/4, k2 -> 0, a1 -> 1/2, a2 -> 1/5, a3 -> 2/5, a4 -> 1/2, a5 -> 1/5, a6 -> 1/4, b1 -> 1/2, b2 -> 2/5, b3 -> 11/20, b4 -> 1/2, b5 -> 2/5, b6 -> 1/2}, {x1 -> 5/6, y1 -> 2/3, r1 -> 1/6, r2 -> 1/4, k1 -> 3/4, k2 -> 0, a1 -> 1/2, a2 -> 1/5, a3 -> 2/5, a4 -> 5/6, a5 -> 11/15, a6 -> 1/4, b1 -> 1/2, b2 -> 2/5, b3 -> 11/20, b4 -> 1/2, b5 -> 4/5, b6 -> 1/2}, {x1 -> 4/3, y1 -> 5/6, r1 -> -(1/3), r2 -> 1/4, k1 -> 3/4, k2 -> 0, a1 -> 1/2, a2 -> 1/5, a3 -> 2/5, a4 -> 4/3, a5 -> 17/15, a6 -> 1/4, b1 -> 1/2, b2 -> 2/5, b3 -> 11/20, b4 -> 1/2, b5 -> 11/10, b6 -> 1/2}, {x1 -> 0, y1 -> 3/2, r1 -> 1, r2 -> 1/4, k1 -> 3/4, k2 -> 0, a1 -> 1/2, a2 -> 1/5, a3 -> 2/5, a4 -> 0, a5 -> 3/5, a6 -> 1/4, b1 -> 1/2, b2 -> 2/5, b3 -> 11/20, b4 -> 1/2, b5 -> 7/10, b6 -> 1/2}}

Length[solr2]


8

Verifying

And @@@ (eqns /. solr2)


{True, True, True, True, True, True, True, True}