0
$\begingroup$

I'm pretty sure eqn1 and eqn2 both have non-trivial solutions. They are a very similar set of simultaneous equations generated by another algorithm. Why does Solve only find the non-trivial solutions for eqn1? How can I find the solution for eqn2? Approximate solutions are fine.

eqn1 = {0.07739637024021674` x + 0.04` y + (0.` + 0.144` I) z == 0, 0.04` x + 0.037396370240216706` y + (0.` + 0.144` I) z == 
0, (0.` - 0.144` I) x - (0.` + 0.144` I) y + 
 0.5573963702402167` z == 0};
eqn2 = {0.07782393781203643` x + 0.04` y + (0.` + 0.145` I) z == 0, 0.04` x + 0.0378239378120364` y + (0.` + 0.145` I) z == 
0, (0.` - 0.145` I) x - (0.` + 0.145` I) y + 
 0.5578239378120364` z == 0};
Solve[eqn1]
Solve[eqn2]

(Sorry I know it's a bit of an eye sore)

$\endgroup$

2 Answers 2

2
$\begingroup$

using LinSolve reports badly conditioned and returns trivial result too. You may write the equation in a matrix fashion, $m.v=v_0$, where $v={{x},{y},{z}}$ and $v_0$ is a vector whose elements are all zero. Here, your m matrix is hermitian so it can be diagonalized, and the solution to the equation can be found by finding the eigenvector of the matrix $m$ corresponding to eigenvalue 0 (x,y,z up to an overall normalizing factor: c*x, c*y, c*z also a solution for constant c):

m = (Table[
      CoefficientList[eqn2[[i]][[1]], #1, 2][[2]], {i, 1, 3}] & /@ {x,
      y, z})\[Transpose]

m == m\[HermitianConjugate]
(*True*)

{eval, evec} = Eigensystem[m]

{x, y, z} = evec[[3]]
(*3rd one corresponds to the zero eigenvalue for me*)
(*{1.11118*10^-16 + 0.0557919 I, -2.22045*10^-16 - 0.969765 I,0.237577 + 0. I}*)

(*copy eqn2 without ==0 to check*)
{0.07782393781203643` x + 0.04` y + (0.` + 0.145` I) , 
 0.04` x + 
  0.0378239378120364` y + (0.` + 0.145` I) z, (0.` - 
     0.145` I) x - (0.` + 0.145` I) y + 0.5578239378120364` z}

(*{-2.34119*10^-19 + 6.93889*10^-18 I, -3.95387*10^-18 + 5.55112*10^-17 I, 0. + 1.60843*10^-17 I}*)

solution (approximate)

{x, y, z} = Chop[{x, y, z}, N[10^-15]]

{0. + 0.0557919 I, 0. - 0.969765 I, 0.237577}

$\endgroup$
3
  • 2
    $\begingroup$ A slick way to obtain the matrix m is to use {b, m} = Normal @ CoefficientArrays[eqn2]. $\endgroup$
    – Carl Woll
    Commented Mar 8, 2019 at 18:37
  • $\begingroup$ In fact, one could just do NullSpace[Last[Normal[CoefficientArrays[eqn1, {x, y, z}]]]]. $\endgroup$ Commented Mar 8, 2019 at 23:06
  • $\begingroup$ Nice, thank you :) $\endgroup$
    – Tom
    Commented Mar 9, 2019 at 15:51
1
$\begingroup$

He is pretty sure there is a nontrivial solution to eqn2. So we want to be certain what the solution is, no hidden algorithm, no questionable decimals, no lurking potential division by zero, just and only simple obvious brute force steps of rationalizing the coefficients and adding the equations scaled by nonzero factors while showing the result of every step so that this can be checked.

For your eqn2 manually rationalize the three equations

 {007782393781203643/10^17 x + 004/100 y + (0 + 0145/1000 I) z == 0,
  004/100 x + 00378239378120364/10^16 y + (0 + 0145/1000 I) z == 0,
  (0 - 0145/1000 I) x - (0 + 0145/1000 I) y +  05578239378120364/10^16 z == 0}

Subtract the first from the second and a multiple of the first from the third to eliminate z.

{004/100 x + 00378239378120364/10^16 y + (0 + 0145/1000 I) z- 
   (007782393781203643/10^17 x + 004/100 y + (0 + 0145/1000 I) z ) == 0,
 (0 - 0145/1000 I) x - (0 + 0145/1000 I) y +  05578239378120364/10^16 z- 
   05578239378120364/10^16/(0 + 0145/1000 I)*
   (007782393781203643/10^17 x + 004/100 y + (0 + 0145/1000 I) z ) == 0}//Simplify

giving

{3782393781203643*x + 217606218796360*y == 0, 
 23615037390663710616808912749*x + 1358604970972000000000000000*y == 0}

subtract a multiple of the first from the second to eliminate x

{23615037390663710616808912749*x + 1358604970972000000000000000*y- 
  23615037390663710616808912749/3782393781203643*
  (3782393781203643*x + 217606218796360*y) == 0}//Simplify

giving

{y == 0}

and by inspection that means x==0 and by inspection that means z==0 is the only solution IF we can justify that rationalization.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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