I'm simply trying to solve a system of equations and mathematica can't do it for all values over the region of interest. I have a 3x3 matrix that has a specific parametrization and after squaring the matrix I want to fix the eigenvalues to specific values.

matrix = (Outer[Times, {0, 0, 1}, {0, 0, 1}] + \[Epsilon]*
 Outer[Times, {0, a, b}, {0, a, b}] + \[Delta]*
 Outer[Times, {c, d, e}, {c, d, e}]);
matrix2[a_, b_, c_, d_, e_, \[Delta]_, \[Epsilon]_] = 

This is how the matrix is defined. From here I assign the elements a-e with angles and then solve for the eigenvalues that correspond to specific condition.

angles = {Pi/2,Pi/4,Pi/2};
numbs = {Sin[angles[[1]]], Cos[angles[[1]]],Sin[angles[[2]]],Cos[angles[[2]]],
Sin[angles[[3]]], Cos[angles[[3]]]};  
numbs[[4]]*numbs[[6]], \[Delta], \[Epsilon]]];

I want the ratio of the eigenvalues to be equal to a specific value and they it doesn't work except for the most specific of values, like pi/2 for all the angles, but it should for arbitrary angles between 0 - pi/2

NSolve[{vals[[3]]/vals[[1]] == ((1.12)/173.5), 
vals[[2]]/vals[[1]] == ((2.9*10^-3)/173.5)},
{\[Epsilon], \[Delta]},Complexes]

Any help or advice would be greatly appreciated, I'be been stuck on this for a while and can't figure it out. If more clarification is needed, I am more than will to provide it.


Perhaps this, which converted to exact fractions trying to avoid roundoff errors:

{ToRules[N[Reduce[Simplify[{vals[[3]]/vals[[1]] == ((112/100)/(1735/10)), 
  vals[[2]]/vals[[1]] == ((29/10*10^-3)/(1735/10))}]]]]}

which gives you eight solutions.

| improve this answer | |
  • $\begingroup$ +1 note this works without converting to exact fractions, I think all that does for you is suppress a warning. ( You need parenthesis on (1735/10) btw ) $\endgroup$ – george2079 Apr 26 '16 at 14:06

In principle you can create an entirely real formulation and use FindMinimum like this:

exp = Abs[vals[[3]]/vals[[1]] - 1.12/173.5]^2 + 
    Abs[vals[[2]]/vals[[1]] - 2.9*10^-3/173.5]^2 /. {\[Delta] -> 
     dr + I di , \[Epsilon] -> er + ei I};
sol = FindMinimum[exp ,
       {{dr, -5.7}, {di, 6.1}, {er, -1.4}, {ei, 1.2}}]

{1.67033*10^-7, {dr -> -5.7176, di -> 6.07862, er -> -1.32714, ei -> 1.30331}}

This is not a good solution however. It may be that there is no solution.

Edit: just to show this is sound, knowing the answer if we start close enough to a solution we get a good result

FindMinimum[exp, {{dr, .01}, {di, 0}, {er, -.1}, {ei, 0}}]

{1.2376*10^-16, {dr -> 0.00781672, di -> 6.45053*10^-7, er -> -0.0840721, ei -> -3.00245*10^-7}}

| improve this answer | |

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.