I'm trying to solve a system of equations with MATLAB (R2012b):
syms w1 w2 x1 x2 y1 y2
eqns = [w1 + w2 == 1;
1/6 == 1/2 * (w1 * x1 + w2 * x2);
1/6 == 1/2 * (w1 * y1 + w2 * y2);
1/24 == 1/2 * (w1 * x1 * y1 + w2 * x2 * y2);
1/24 == 1/2 * (w1 * x1^2 + w2 * x2^2);
1/24 == 1/2 * (w1 * y1^2 + w2 * y2^2)];
vars = [w1 w2 x1 x2 y1 y2];
[solv, solu] = solve(eqns, vars)
The code above yields the warning:
12 equations in 6 variables. Explicit solution could not be found.
What's going on? eqns contains 6, not 12, equations and we have 6 variables.
FWIW, Maple has no trouble finding the solution:
$${\it w1}={\frac {4 (9\,{{\it y2}}^{2}-6\,{\it y2}+1)}{3(12\,{{\it y2} }^{2}-8\,{\it y2}+1)}},\; {\it w2}= \frac{-1}{ 36\,{{\it y2}}^{2}-24\,{\it y2 }+3 },\; {\it x1}={\frac {4\,{\it y2}-1}{4(3\,{\it y2}-1)}} , \\{\it x2}={\it y2},\; {\it y1}=-{\frac {-4\,{\it y2}+1}{12\,{\it y2}-4}}, \;{\it y2}={\it y2} $$