Mathematica Is Mathematica the best option to compute the eigenvalues?

Click For Summary
The discussion revolves around computing the eigenvalues of a complex determinant involving trigonometric functions. The original poster is exploring options for this computation, initially considering Mathematica but finding its examples too simplistic for their needs. They inquire whether Matlab might be a better alternative. A specific matrix is provided, and the poster shares an attempt to compute eigenvalues using Mathematica, which returns a complex expression. There is a realization that they confused WolframAlpha with WolframMathematica, clarifying their misunderstanding about the tools available for this task. The conversation emphasizes the challenges of handling intricate mathematical expressions and the importance of selecting the right computational software for advanced calculations.
JD_PM
Messages
1,125
Reaction score
156
TL;DR
I am wondering what's the best option to compute the eigenvalues for such a determinant
I am wondering what's the best option to compute the eigenvalues for such a determinant$$\begin{vmatrix}
\sin \Big( n \frac{\omega}{v_1} \theta \Big) & \cos \Big( n \frac{\omega}{v_1} \theta \Big) & 0 & 0 \\
0 & 0 & \sin \Big( n \frac{\omega}{v_2} (2 \pi - \theta) \Big) & \cos \Big( n \frac{\omega}{v_2} (2 \pi - \theta) \Big) \\
\sin \Big( n \frac{\omega}{v_1} \pi \Big) & \cos \Big( n \frac{\omega}{v_1} \pi \Big) & -\sin \Big( n \frac{\omega}{v_2} \pi \Big) & -\cos \Big( n \frac{\omega}{v_2} \pi \Big) \\
\frac{n}{v_1} \cos \Big( n \frac{\omega}{v_1} \pi \Big) & -\frac{n}{v_1} \sin \Big( n \frac{\omega}{v_1} \pi \Big) & \frac{n}{v_2} \cos \Big( n \frac{\omega}{v_2} \pi \Big) & -n\frac{B_2}{v_2} \sin \Big( n \frac{\omega}{v_2} \pi \Big) \\
\end{vmatrix} = 0$$Where ##L = R \theta## and L and R are known.

I was looking at mathematica:

https://reference.wolfram.com/language/tutorial/EigenvaluesAndEigenvectors.html

But the examples they show are much more simpler than the one I am dealing with,

Should I use Matlab instead?

Any suggestion is appreciated.

If you are interested from where is this coming from check this out: https://math.stackexchange.com/ques...osed-loop?noredirect=1#comment7161084_3482613
 
Physics news on Phys.org
Let's suppose, just as an experiment, you wanted the eigenvalues of a matrix

Code:
Eigenvalues[{{Sin[n w/v1 t],Cos[n w/v1 t],0,0},
{0,0,Sin[n w/v2(2Pi-t)],Cos[n w/v2(2Pi-t)]},
{Sin[n w/v1 Pi],Cos[n w/v1 Pi],-Sin[n w/v2 Pi],-Cos[n w/v2 Pi]},
{n/v1 Cos[n w/v1 Pi],-n/v1 Sin[n w/v1 Pi],n/v2 Cos[n w/v2 Pi],-n b2/v2 Sin[n w/v2 Pi]}}]

Then Mathematica would respond with a vector of four expressions, the first expression is

Code:
Root[-(n*v1^4*v2^3*Sin[(n*Pi*w)/v1 - (n*t*w)/v1 - (n*Pi*w)/v2 - (n*(2*Pi - t)*w)/v2]) + b2*n*v1^4*v2^3*
  Sin[(n*Pi*w)/v1 - (n*t*w)/v1 - (n*Pi*w)/v2 - (n*(2*Pi - t)*w)/v2] - n*v1^4*v2^3*Sin[(n*Pi*w)/v1 -
  (n*t*w)/v1 + (n*Pi*w)/v2 - (n*(2*Pi - t)*w)/v2] - b2*n*v1^4*v2^3*Sin[(n*Pi*w)/v1 - (n*t*w)/v1 +
  (n*Pi*w)/v2 - (n*(2*Pi - t)*w)/v2] - 2*n*v1^3*v2^4*Sin[(n*Pi*w)/v1 - (n*t*w)/v1 + (n*Pi*w)/v2 -
  (n*(2*Pi - t)*w)/v2] - n*v1^4*v2^3*Sin[(n*Pi*w)/v1 - (n*t*w)/v1 - (n*Pi*w)/v2 + (n*(2*Pi - t)*w)/v2] -
  b2*n*v1^4*v2^3*Sin[(n*Pi*w)/v1 - (n*t*w)/v1 - (n*Pi*w)/v2 + (n*(2*Pi - t)*w)/v2] +
  2*n*v1^3*v2^4*Sin[(n*Pi*w)/v1 - (n*t*w)/v1 - (n*Pi*w)/v2 + (n*(2*Pi - t)*w)/v2] - n*v1^4*v2^3*
  Sin[(n*Pi*w)/v1 - (n*t*w)/v1 + (n*Pi*w)/v2 + (n*(2*Pi - t)*w)/v2] + b2*n*v1^4*v2^3*Sin[(n*Pi*w)/v1 -
  (n*t*w)/v1 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*w)/v1] - n*v1^3*v2^2*Sin[(n*t*w)/v1 -
  (2*n*Pi*w)/v2] + b2*n*v1^3*v2^2*Sin[(n*t*w)/v1 - (2*n*Pi*w)/v2] - n*v1^3*v2^2*Sin[(n*t*w)/v1 +
  (2*n*Pi*w)/v2] + b2*n*v1^3*v2^2*Sin[(n*t*w)/v1 + (2*n*Pi*w)/v2])*#1 + (2*n*v1^2*v2 + 2*b2*n*v1^2*v2 +
  2*n*v1^2*v2*Cos[(2*n*Pi*w)/v2] - 2*b2*n*v1^2*v2*Cos[(2*n*Pi*w)/v2] - 2*b2*n*v1^2*v2*Cos[(n*t*w)/v1 -
  (n*Pi*w)/v2] - 2*v1^2*v2^2*Cos[(n*t*w)/v1 - (n*Pi*w)/v2] + 2*b2*n*v1^2*v2*Cos[(n*t*w)/v1 + (n*Pi*w)/v2] +
  2*v1^2*v2^2*Cos[(n*t*w)/v1 + (n*Pi*w)/v2] + 2*n*v1*v2^2*Sin[(n*Pi*w)/v1 - (n*(2*Pi - t)*w)/v2] +
  2*v1^2*v2^2*Sin[(n*Pi*w)/v1 - (n*(2*Pi - t)*w)/v2] + 2*n*v1*v2^2*Sin[(n*Pi*w)/v1 + (n*(2*Pi - t)*w)/v2] -
  2*v1^2*v2^2*Sin[(n*Pi*w)/v1 + (n*(2*Pi - t)*w)/v2])*#1^2 + (-4*v1*v2*Sin[(n*t*w)/v1] +
  4*b2*n*v1*Sin[(n*Pi*w)/v2] + 4*v1*v2*Sin[(n*Pi*w)/v2])*#1^3 + 4*#1^4 & , 1]/(v1*v2),

The remaining three expressions are similar to the first.

You can look up Root in the help system to see what that is. Usually Root[expr] is more compact than the expanded analytic expression, if one is even available.
 
  • Like
Likes JD_PM
Bill Simpson said:
Let's suppose, just as an experiment, you wanted the eigenvalues of a matrix

Thanks for your reply.

I've been trying to compute the eigenvalues but there's something going wrong. I've copied/pasted the code you provided and I got a wrong output.

Screenshot (964).png


But you indeed got a good output.

What am I missing?
 
OK I confused WolframAlpha with WolframMathematica.

Now it is clear.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
5
Views
1K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
2K