5
$\begingroup$

I'm trying to solve a system of 12 equations and 12 unknowns with the code below.

b = 5;
c = 0.2;
s = 0.3;
NSolve[
 {c == (b x2 - o y2)/(b x2),
  x5 == 1 - x1 - x2 - x3 - x4,
  y5 == 1 - y1 - y2 - y3 - y4 - y6,
  x1 == 7 x2,
  x3 == x2,
  s == o y6 / (b x2 - o y2),
  s == (o y4 - b x4)/(b x2 - o y2),
  b x2 c (1 - s) == o y4 - b x4,
  b x2 c s == o y6,
  b (x1 + x4 + 2 x2 + 2 x5) == o (y1 + y4 + 2 y2 + 2 y5 + 3 y6),
  b (x1 + 2 x4 + x3) == o (y1 + 2 y4 + x3 + 2 y6),
  b (2 x3 + 4 x2 + 6 x5) == o (2 y3 + 4 y2 + 6 y5 + 6 y6)
  }, {o, x1, x2, x3, x4, x5, y1, y2, y3, y4, y5, y6}]

Mathematica happily tells me there are no solutions. I'd like to understand why. Are the systems of equations not independent? If so, can Mathematica tell me why?

RESPONDING TO COMMENTS

If I replace the variables at the top with fractions I still get no solutions.

b = 5;
c = 1/5;
s = 3/10;
Eqn = {c == (b x2 - o y2)/(b x2),
   x5 == 1 - x1 - x2 - x3 - x4,
   y5 == 1 - y1 - y2 - y3 - y4 - y6,
   x1 == 7 x2,
   x3 == x2,
   s == o y6 / (b x2 - o y2),
   s == (o y4 - b x4)/(b x2 - o y2),
   b x2 c (1 - s) == o y4 - b x4,
   b x2 c s == o y6,
   b (x1 + x4 + 2 x2 + 2 x5) == o (y1 + y4 + 2 y2 + 2 y5 + 3 y6),
   b (x1 + 2 x4 + x3) == o (y1 + 2 y4 + x3 + 2 y6),
   b (2 x3 + 4 x2 + 6 x5) == o (2 y3 + 4 y2 + 6 y5 + 6 y6)
   };
V = {o, x1, x2, x3, x4, x5, y1, y2, y3, y4, y5, y6};
NSolve[Eqn, V]
$\endgroup$
  • $\begingroup$ What happens if you replace 0.2 with 1/5 and 0.3 with 3/10? $\endgroup$ – J. M.'s discontentment Jul 22 '15 at 2:25
  • 2
    $\begingroup$ If you throw Eliminate at your equations, it says that s has to be 1/2. $\endgroup$ – wxffles Jul 22 '15 at 2:29
  • $\begingroup$ @J. M. I tried. Sadly, nothing changed. $\endgroup$ – wdkrnls Jul 22 '15 at 2:46
  • $\begingroup$ @wxffles Can you show the arguments you placed in Eliminate? It's just returning False for me. $\endgroup$ – wdkrnls Jul 22 '15 at 2:47
  • 1
    $\begingroup$ NSolve gives an answer in version 10.2, but that answer is incorrect. Thanks to @Szabolcs for pointing this out. A bug report has been opened. To recover the old, correct behavior, one can use Method -> "EndomorphismMatrix". $\endgroup$ – ilian Jul 22 '15 at 17:30
9
$\begingroup$

If you attempt to Reduce your equations with respect to all unknown quantities, you obtain a result:

Clear[Evaluate[Context[] <> "*"]]
Reduce[{
   c == (b x2 - o y2)/(b x2),
   x5 == 1 - x1 - x2 - x3 - x4,
   y5 == 1 - y1 - y2 - y3 - y4 - y6,
   x1 == 7 x2,
   x3 == x2,
   s == o y6/(b x2 - o y2),
   s == (o y4 - b x4)/(b x2 - o y2),
   b x2 c (1 - s) == o y4 - b x4,
   b x2 c s == o y6,
   b (x1 + x4 + 2 x2 + 2 x5) == o (y1 + y4 + 2 y2 + 2 y5 + 3 y6),
   b (x1 + 2 x4 + x3) == o (y1 + 2 y4 + x3 + 2 y6),
   b (2 x3 + 4 x2 + 6 x5) == o (2 y3 + 4 y2 + 6 y5 + 6 y6)},
  {c, b, o, s, x1, x2, x3, x4, x5, y1, y2, y3, y4, y5, y6}
] // ToRules

First solution set:

{c -> 4,
 s -> 1/2,
 x1 -> (7 (b - o))/(2 (6 b + o)),
 x2 -> x1/7, 
 x3 -> x1/7, 
 x5 -> 1/7 (7 - 9 x1 - 7 x4), 
 y1 -> -(x1/7), 
 y2 -> -((3 b x1)/(7 o)),
 y3 -> 1/14 (-3 x1 + 35 y2), 
 y4 -> 1/21 (21 x4 + 6 x1 x4 - 14 y2 - 84 x4 y2), 
 y5 -> 1/42 (42 + 15 x1 - 42 x4 - 12 x1 x4 - 91 y2 + 168 x4 y2), 
 y6 -> -((2 y2)/3)}

Second solution set:

{s -> 1/2,
 x1 -> (14 (b - o))/(-4 b + 7 b c + 4 o),
 x2 -> x1/7, 
 x3 -> x1/7, 
 x5 -> 1/7 (7 - 9 x1 - 7 x4), 
 y1 -> (-14 b + 14 o + 28 b x1 - b c x1)/(28 o), 
 y2 -> ((-1 + c) (x1 + 7 y1))/(14 (-4 + c)), 
 y3 -> 1/14 (-3 x1 + 35 y2), 
 y4 -> 1/84 (x1 + 84 x4 + 27 x1 x4 + 7 y1 + 21 x4 y1 - 56 y2 - 336 x4 y2), 
 y5 -> 1/84 (84 + 16 x1 - 84 x4 - 27 x1 x4 - 98 y1 - 21 x4 y1
                - 182 y2 + 336 x4 y2), 
 y6 -> 1/84 (x1 + 7 y1 - 56 y2)}

Two options are shown, and in both of them s has the value of $1/2$. This seems to be in conflict with the assumption you make above of $s=0.3$.

I would suspect, therefore, that the problem lies in the initial values you chose for the parameter s, and possible for c and b as well.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ +1 In fact, Solve[ ] is more clear about the value for s $\endgroup$ – Dr. belisarius Jul 22 '15 at 3:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.