I am trying to solve a linear system of equations with Mathematica.
My variables are x1, x2, x3, x4
. I use the code shown below, but it gives error saying that:
Equations may not give solutions for all "solve" variables.
Even when I used LinearSolve
, I got the same error.
Solve[{(x1 - ((-m3* n2 + m2 * z3 - 0.5*m2*z3)* x2 + (0.5 *n2* z3)*
x3 + (0.5 *m2 * z3)*x4)/((-1.5) n2* z3)) == (2/
1.5) , (x2 - ((m3* n2 - 0.5*m3 *n2 - m2 * z3)*
x1 + (0.5* m3* n2)* x3 + (0.5* m2* m3)*
x4)/((-1.5) (m2* m3)) ) == (-m3* n2 + m2* z3 )/((-1.5) m2*
m3) , (x3 - ((-n2* z1 + .5*n2 * z1)*
x1 + (.5* m2 * z1 - m2 * z1)*x2 + (m1 *n2 - 0.5* m2* z1)*
x4 )/((1.5) n2 z1) ) == (2/1.5 ) , (
x4 - ((-m1 *n2 + 0.5*m1 *n2 )*x1 + (-0.5 *m1* m2) *
x2 + (-.5* m1* n2 + m2 *z1)*x3)/((1.5) m1* m2) ) == (
m1* n2 - m2* z1)/((1.5)* m1* m2)} , {x1, x2, x3, x4}]
Can anyone help me please. I really appreciate your comments.
x1
). $\endgroup$FullSimplify[ Solve[eqns//Rationalize, #, Reals] & /@ Subsets[{x1, x2, x3, x4}, {3}]]
$\endgroup$1/2
rather than0.5
. This uses exact numbers rather than approximate numbers. $\endgroup$