Is Mathematica the best option to compute the eigenvalues?

In summary, the conversation discusses the best option for computing the eigenvalues of a determinant involving trigonometric functions and known variables. The possibility of using Mathematica or Matlab is mentioned, and an example of using Mathematica to find the eigenvalues is given. The conversation also includes a link to a related question on a math forum.
  • #1
JD_PM
1,131
158
TL;DR Summary
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
  • #2
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 + (n*Pi*w)/v2 + (n*(2*Pi - t)*w)/v2] + (-2*n*v1^2*v2^3*Cos[(n*Pi*w)/v1 - (n*t*w)/v1 -
  (n*(2*Pi - t)*w)/v2] - 2*v1^3*v2^3*Cos[(n*Pi*w)/v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(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
  • #3
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?
 
  • #4
OK I confused WolframAlpha with WolframMathematica.

Now it is clear.
 

Related to Is Mathematica the best option to compute the eigenvalues?

1. What is Mathematica and how does it compute eigenvalues?

Mathematica is a computational software program used for various mathematical and scientific purposes. It uses a combination of symbolic and numeric methods to compute eigenvalues, which are the values that satisfy the equation Ax = λx, where A is a square matrix and λ is a scalar.

2. Is Mathematica the only option for computing eigenvalues?

No, there are other software programs and programming languages that can also compute eigenvalues, such as MATLAB, Python, and R. However, Mathematica is known for its powerful mathematical and computational capabilities, making it a popular choice for such tasks.

3. What are the advantages of using Mathematica for computing eigenvalues?

Mathematica has a user-friendly interface and a vast library of built-in functions and algorithms specifically designed for mathematical computations. It also has the ability to handle large and complex matrices efficiently, making it a reliable and efficient option for computing eigenvalues.

4. Are there any limitations to using Mathematica for computing eigenvalues?

Like any software program, Mathematica has its limitations. It may not be the best option for computing very large matrices with millions of elements, as it may take a significant amount of time and computing power. Additionally, it may not have all the specialized functions and algorithms that other software programs or programming languages may have for specific types of matrices.

5. Can Mathematica compute eigenvalues of non-numeric matrices?

Yes, Mathematica has the ability to handle both numeric and symbolic computations, so it can compute eigenvalues for non-numeric matrices as well. This makes it a useful tool for theoretical and research purposes, where exact solutions are needed rather than just numerical approximations.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Replies
2
Views
561
  • Introductory Physics Homework Help
Replies
2
Views
646
  • Introductory Physics Homework Help
Replies
11
Views
713
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
5K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • High Energy, Nuclear, Particle Physics
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
2
Views
1K
  • Special and General Relativity
Replies
7
Views
439
Replies
3
Views
1K
Back
Top