Is Mathematica the best option to compute the eigenvalues?

Click For Summary
SUMMARY

The discussion centers on the computation of eigenvalues for a complex determinant involving trigonometric functions, specifically using Mathematica. The user initially considers Mathematica for this task but questions its effectiveness due to the simplicity of provided examples. They also contemplate using MATLAB as an alternative. The conversation clarifies the distinction between WolframAlpha and WolframMathematica, leading to a better understanding of the tools available for eigenvalue computation.

PREREQUISITES
  • Understanding of eigenvalues and eigenvectors in linear algebra
  • Familiarity with Mathematica 12.0 syntax and functions
  • Basic knowledge of MATLAB for numerical computations
  • Experience with trigonometric functions and determinants
NEXT STEPS
  • Explore advanced features of Mathematica for eigenvalue computation
  • Learn MATLAB's eigenvalue functions, such as eig
  • Research the differences between WolframAlpha and WolframMathematica
  • Investigate numerical methods for solving complex determinants
USEFUL FOR

Mathematicians, physicists, and engineers who require advanced computational tools for eigenvalue problems, particularly those dealing with complex determinants and trigonometric functions.

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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2] - n*v1^3*v2^2*Cos[(n*Pi*w)/v1 +
  (n*Pi*w)/v2 + (n*(2*Pi - t)*w)/v2] + b2*n*v1^3*v2^2*Cos[(n*Pi*w)/v1 + (n*Pi*w)/v2 + (n*(2*Pi - t)*w)/v2] -
  2*n*v1^3*v2^2*Sin[(n*t*w)/v1] - 2*b2*n*v1^3*v2^2*Sin[(n*t*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   Reactions: 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
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
2K