Your system has a 1-parameter family of solutions, that is, infinitely many of them. In the solution returned by Solve
, the parameter y
can be anything (that does not make a denominator zero).
Here's a way to figure out if there's a redundant equation.
vars = {x1, x2, x3, x4, x, y};
sys = {x1 == x A1/(x A1 + y A3), x2 == x A2/(x A2 + y A4),
x3 == y A3/(x A1 + y A3), x4 == y A4/(x A2 + y A4),
x1 + x2 + x3 + x4 == 2, x + y == 1};
(* calculate rank of system *)
ideal = sys /. Equal -> Subtract; (* convert equations to polynomial/rational expressions *)
basis = GroebnerBasis[ideal, vars];
relations = PolynomialReduce[ideal, basis, vars]; (* writes system in terms of basis *)
"rank" -> MatrixRank[relations[[All, 1]]] (* number of independent equations *)
(* construct minimal system *)
minpos = FirstPosition[#, 1, Nothing] & /@ RowReduce[relations[[All, 1]]];
"independent" -> minpos
min = Extract[sys, minpos]; (* extract the minimal system (drop redundant equation) *)
sol2 = Solve[min, DeleteCases[vars, y]] // Simplify; (* delete y to control which variable are solved for *)
sol = Solve[sys, vars] // Simplify; (* Simplify puts solutions in the same form *)
"SameQ[sol1,sol2]" -> sol === sol2 (* compare solutions *)
(*
"rank" -> 5
"independent" -> {{1}, {2}, {3}, {5}, {6}} <-- equation 4 is redundant
"SameQ[sol1,sol2]" -> True
*)
Check that the dropped equation is satisfied:
sys[[4]] /. sol // Simplify
(* {True} *)