I have a question regarding the Simplify command in mathematica.
I am working with a 4 x 4 table called Eqs, filled with symbolic expressions. I then do
Together[Eqs - Simplify[Eqs]]
and the output is
{{0.,0,0,0},{0,0.,0,0},{0,0,-((8. (1. (q4^\[Prime])[x]^2-5. x^2 (q4^\[Prime])[x]^2+10.25 x^4 (q4^\[Prime])[x]^2-11. x^6 (q4^\[Prime])[x]^2+6.25 x^8 (q4^\[Prime])[x]^2+1. x^9 (q4^\[Prime])[x]^2-3.5 x^10 (q4^\[Prime])[x]^2+1. x^11 (q4^\[Prime])[x]^2))/((-2.+x^2)^2 (-1.+x^2)^2)),0},{0,0,0,0.}}
Simplify seems not to be working as I thought it should. Why is that?
Edit: Eqs contains the Einstein equations for a certain metric. I used coordinates
{\[Tau], \[Rho], x, \[Phi]}
and as assumptions
$Assumptions =And[\[Tau] \[Element] Reals, \[Phi] > 0, \[Phi] < 2*\[Pi],\[Rho] >
0, x > 0, x < 1, L > 0] ;
Edit2: Let me post Simplify[Eqs]
{{1/(x (-1.+x^2)^2 q1[x] q2[x] q3[x]) \[Rho]^2 (x q1[x]^2 ((1. -2. x^2+1. x^4) q3[x]+q2[x] (1. +q3[x] (-3.+(-2.+4. x^2-2. x^4) q4[x]^2)))+x q3[x] (q1^\[Prime])[x] ((1. x-1.5 x^3+0.5 x^5) q2[x]+(-0.25+0.625 x^2-0.5 x^4+0.125 x^6) (q1^\[Prime])[x])+q1[x] (q2[x] ((1. x+2. x^3-1. x^5) q3[x]+(0.25 -0.25 x^2) (q1^\[Prime])[x])+x q3[x] ((-0.625 x+1. x^3-0.375 x^5) (q1^\[Prime])[x]+(0.25 -0.625 x^2+0.5 x^4-0.125 x^6) (q1^\[Prime]\[Prime])[x]))),0.,0.,0.},{0.,1/(x (-1.+x^2)^2 \[Rho]^2 q1[x] q2[x] q3[x]) (x q1[x]^2 ((-1.+2. x^2-1. x^4) q3[x]+q2[x] (-1.+q3[x] (3. +(2. -4. x^2+2. x^4) q4[x]^2)))+x q3[x] (q1^\[Prime])[x] ((-1. x+1.5 x^3-0.5 x^5) q2[x]+(0.25 -0.625 x^2+0.5 x^4-0.125 x^6) (q1^\[Prime])[x])+q1[x] (q2[x] ((-1. x-2. x^3+1. x^5) q3[x]+(-0.25+0.25 x^2) (q1^\[Prime])[x])+x q3[x] ((0.625 x-1. x^3+0.375 x^5) (q1^\[Prime])[x]+(-0.25+0.625 x^2-0.5 x^4+0.125 x^6) (q1^\[Prime]\[Prime])[x]))),0.,0.},{0.,0.,-((2. (x^2 q2[x]^2 q3[x]^2 (q1^\[Prime])[x] ((-8. x+16. x^3-10. x^5+2. x^7) q2[x]+(1-3. x^2+3.25 x^4-1.5 x^6+0.25 x^8) (q1^\[Prime])[x])+x^2 q1[x] q2[x]^2 q3[x]^2 ((8. -20. x^2+16. x^4-4. x^6) q2[x]+(8. x-16. x^3+10. x^5-2. x^7) (q1^\[Prime])[x]+x (4. -8. x^2+5. x^4-1. x^6) (q2^\[Prime])[x])+q1[x]^2 (x^2 (-1.5+4.5 x^2-4.875 x^4+2.25 x^6-0.375 x^8) q3[x]^2 (q2^\[Prime])[x]^2+q2[x]^3 ((-2.+4. x^2-2. x^4) q3[x]+x^2 q3[x]^2 (-12.+6. x^2+(-8.+20. x^2-16. x^4+4. x^6) q4[x]^2)+x (-2.+3. x^2-1. x^4) (q3^\[Prime])[x])+q2[x]^2 (x^2 (0.5 -1.5 x^2+1.625 x^4-0.75 x^6+0.125 x^8) (q3^\[Prime])[x]^2+x q3[x] ((1-1.5 x^2+0.5 x^4) (q2^\[Prime])[x]+(2. -3. x^2+x^4) (q3^\[Prime])[x])+q3[x]^2 (2. +16. x^4-16. x^6+4. x^8+x^4 (16. -48. x^2+52. x^4-24. x^6+4. x^8) q4[x]^2+x^3 (-16.+64. x^2-100. x^4+76. x^6-28. x^8+4. x^10) q4[x] (q4^\[Prime])[x]+1. (1. -1. x)^4 x^10 (q4^\[Prime])[x]^2))+x^2 q2[x] q3[x]^2 ((-2.5 x+5.25 x^3-3.5 x^5+0.75 x^7) (q2^\[Prime])[x]+(1-3. x^2+3.25 x^4-1.5 x^6+0.25 x^8) (q2^\[Prime]\[Prime])[x]))))/(x^2 (-2.+x^2)^2 (-1.+x^2)^2 q1[x]^2 q2[x]^2 q3[x]^2)),0.},{0.,0.,0.,1/((-1.+x^2)^2 q1[x] q2[x] q3[x]) (x^2 q2[x] q3[x] ((-4.+2. x^2) q3[x]+x (-2.+4. x^2-2.5 x^4+0.5 x^6) (q3^\[Prime])[x])+q1[x] ((1. -2. x^2+1. x^4) q3[x]^2+x^2 (0.5 -1.5 x^2+1.625 x^4-0.75 x^6+0.125 x^8) (q3^\[Prime])[x]^2+q2[x] (-1. q3[x]+x^2 q3[x]^2 (6. -3. x^2+(4. -10. x^2+8. x^4-2. x^6) q4[x]^2)+x (-0.5+0.75 x^2-0.25 x^4) (q3^\[Prime])[x])+x^2 q3[x] ((1.25 x-2.625 x^3+1.75 x^5-0.375 x^7) (q3^\[Prime])[x]+(-0.5+1.5 x^2-1.625 x^4+0.75 x^6-0.125 x^8) (q3^\[Prime]\[Prime])[x])))}}
Edit3: Eqs is
{{-((3 \[Rho]^2 q1[x])/(1 - x^2)^2) - 2. \[Rho]^2 q1[x] q4[x]^2 - (1/(
16 x (-1 + x^2)^2 q1[x] q2[x]^2 q3[
x]))\[Rho]^2 (-4 x q1[x] + (-1 + x^2) Derivative[1][q1][
x]) (-2 x (-2 + x^2) q2[x] q3[
x] (4 x q2[x] + (-1 + x^2) Derivative[1][q1][x]) +
q1[x] (4 q2[x]^2 +
x (2 - 3 x^2 + x^4) q3[x] Derivative[1][q2][x] +
q2[x] (4 (-1 - 4 x^2 + 2 x^4) q3[x] -
x (2 - 3 x^2 + x^4) Derivative[1][q3][x]))) - (1/(
16 x (-1 + x^2)^2 q2[x]^2 q3[
x]))\[Rho]^2 (-4 x q1[
x] (-x (2 - 3 x^2 + x^4) q3[x] Derivative[1][q2][x] +
q2[x] ((8 + 8 x^2 - 4 x^4) q3[x] +
x (2 - 3 x^2 + x^4) Derivative[1][q3][x])) + (-1 +
x^2) (-16 x (-1 + x^2) q2[x]^2 q3[x] -
x (2 - 3 x^2 + x^4) q3[x] Derivative[1][q1][x] Derivative[1][
q2][x] +
q2[x] (x (2 - 3 x^2 + x^4) Derivative[1][q1][x] Derivative[
1][q3][x] +
2 q3[x] ((2 + 11 x^2 - 5 x^4) Derivative[1][q1][x] +
x (2 - 3 x^2 + x^4) (q1^\[Prime]\[Prime])[x])))), 0.,
0., 0.}, {0., (3 q1[x])/((1 - x^2)^2 \[Rho]^2) + (
2. q1[x] q4[x]^2)/\[Rho]^2 - (1/(
16 x (-1 + x^2)^2 \[Rho]^2 q1[x] q2[x]^2 q3[
x]))(-4 x q1[x] + (-1 + x^2) Derivative[1][q1][
x]) (2 x (-2 + x^2) q2[x] q3[
x] (4 x q2[x] + (-1 + x^2) Derivative[1][q1][x]) +
q1[x] (-4 q2[x]^2 -
x (2 - 3 x^2 + x^4) q3[x] Derivative[1][q2][x] +
q2[x] ((4 + 16 x^2 - 8 x^4) q3[x] +
x (2 - 3 x^2 + x^4) Derivative[1][q3][x]))) + (1/(
16 x (-1 + x^2)^2 \[Rho]^2 q2[x]^2 q3[
x]))(-4 x q1[
x] (-x (2 - 3 x^2 + x^4) q3[x] Derivative[1][q2][x] +
q2[x] ((8 + 8 x^2 - 4 x^4) q3[x] +
x (2 - 3 x^2 + x^4) Derivative[1][q3][x])) + (-1 +
x^2) (-16 x (-1 + x^2) q2[x]^2 q3[x] -
x (2 - 3 x^2 + x^4) q3[x] Derivative[1][q1][x] Derivative[1][
q2][x] +
q2[x] (x (2 - 3 x^2 + x^4) Derivative[1][q1][x] Derivative[1][
q3][x] +
2 q3[x] ((2 + 11 x^2 - 5 x^4) Derivative[1][q1][x] +
x (2 - 3 x^2 + x^4) (q1^\[Prime]\[Prime])[x])))), 0.,
0.}, {0.,
0., (12 q2[x])/((1 - x^2)^2 (2 - x^2)) + (8. q2[x] q4[x]^2)/(
2 - x^2) -
2 (2 x q4[x] + (-1 + x^2) Derivative[1][q4][
x])^2 + (2 x (-2 + x^2) (-1 + x^2)^2 q2[x] q3[x]^2 Derivative[
1][q1][x]^2 -
2 x (-1 + x^2) q1[x] q3[
x]^2 (-(2 - 3 x^2 + x^4) Derivative[1][q1][x] Derivative[1][
q2][x] +
2 q2[x] (-x (-3 + x^2) Derivative[1][q1][
x] + (2 - 3 x^2 + x^4) (q1^\[Prime]\[Prime])[x])) +
q1[x]^2 ((-1 + x^2) q3[x] Derivative[1][q2][
x] ((4 + 16 x^2 - 8 x^4) q3[x] +
x (2 - 3 x^2 + x^4) Derivative[1][q3][x]) +
q2[x] (48 x q3[x]^2 +
x (-2 + x^2) (-1 + x^2)^2 Derivative[1][q3][x]^2 -
2 (-1 + x^2) q3[
x] ((4 - 5 x^2 + 3 x^4) Derivative[1][q3][x] +
x (2 - 3 x^2 + x^4) (q3^\[Prime]\[Prime])[
x]))))/(4 x (-2 + x^2) (-1 + x^2)^2 q1[x]^2 q2[x] q3[
x]^2) - (-x q1[x] q3[
x] ((10 x - 6 x^3) q2[x] + (2 - 3 x^2 + x^4) Derivative[1][
q2][x]) (-2 x (-2 + x^2) q2[x] q3[
x] (4 x q2[x] + (-1 + x^2) Derivative[1][q1][x]) +
q1[x] (4 q2[x]^2 +
x (2 - 3 x^2 + x^4) q3[x] Derivative[1][q2][x] +
q2[x] (4 (-1 - 4 x^2 + 2 x^4) q3[x] -
x (2 - 3 x^2 + x^4) Derivative[1][q3][x]))) +
2 (2 x^2 (-2 + x^2)^2 (-1 + x^2) q2[x]^2 q3[x]^2 Derivative[1][
q1][x] (4 x q2[x] + (-1 + x^2) Derivative[1][q1][x]) -
2 x^2 (-2 + x^2)^2 q1[x] q2[x]^2 q3[
x]^2 (-4 (1 + x^2) q2[
x] + (-1 +
x^2) (4 x Derivative[1][q2][x] + (-1 + x^2) (
q1^\[Prime]\[Prime])[x])) +
q1[x]^2 (-x^2 (2 - 3 x^2 + x^4)^2 q3[x]^2 Derivative[1][q2][
x]^2 - 4 q2[
x]^3 ((2 - 9 x^2 + 5 x^4) q3[x] +
x (2 - 3 x^2 + x^4) Derivative[1][q3][x]) +
x^2 (2 - 3 x^2 + x^4)^2 q2[x] q3[x]^2 (
q2^\[Prime]\[Prime])[x] +
q2[x]^2 ((8 - 68 x^2 + 20 x^4 + 24 x^6 - 8 x^8) q3[x]^2 +
x^2 (2 - 3 x^2 + x^4)^2 Derivative[1][q3][x]^2 +
x (2 - 3 x^2 + x^4) q3[
x] (4 Derivative[1][q2][x] -
x (2 - 3 x^2 + x^4) (q3^\[Prime]\[Prime])[
x])))))/(4 x^2 (-2 + x^2)^2 (-1 + x^2)^2 q1[
x]^2 q2[x]^2 q3[x]^2), 0.}, {0., 0.,
0., (3 x^2 (2 - x^2) q3[x])/(1 - x^2)^2 +
2. x^2 (2 - x^2) q3[x] q4[x]^2 - (1/(
16 (-1 + x^2)^2 q1[x] q2[x]^2 q3[
x]))(4 q3[x] +
x (2 - 3 x^2 + x^4) Derivative[1][q3][x]) (-2 x (-2 + x^2) q2[
x] q3[x] (4 x q2[x] + (-1 + x^2) Derivative[1][q1][x]) +
q1[x] (4 q2[x]^2 +
x (2 - 3 x^2 + x^4) q3[x] Derivative[1][q2][x] +
q2[x] (4 (-1 - 4 x^2 + 2 x^4) q3[x] -
x (2 - 3 x^2 + x^4) Derivative[1][q3][x]))) - (1/(
16 (-1 + x^2)^2 q1[x] q2[x]^2 q3[x]))
x (-2 + x^2) (2 (-1 + x^2) q2[x] q3[x] Derivative[1][q1][
x] (4 q3[x] + x (2 - 3 x^2 + x^4) Derivative[1][q3][x]) +
q1[x] (-(-1 + x^2) q3[x] Derivative[1][q2][
x] (4 q3[x] + x (2 - 3 x^2 + x^4) Derivative[1][q3][x]) +
q2[x] (-48 x q3[x]^2 -
x (-2 + x^2) (-1 + x^2)^2 Derivative[1][q3][x]^2 +
2 (-1 + x^2) q3[
x] ((4 + 3 x^2 - x^4) Derivative[1][q3][x] +
x (2 - 3 x^2 + x^4) (q3^\[Prime]\[Prime])[x]))))}}
Sorry for the mess.
Eqs
originally was. But one guess is that you have set$Assumptions
somewhere and that can makeSimplify
produce different results. So in other words, please post the least squre matrixEqs
that reproduces the problem... $\endgroup$Eqs
rather thanSimplify[Eqs]
so that we can determine what the actual issue is. $\endgroup$