Matrices in Mathematica -- How to calculate eigenvalues, eigenvectors, determinants and inverses?

In summary, the conversation was about a bonus assignment involving the use of Mathematica to calculate matrices and their determinants. The person is a beginner with Mathematica and was able to complete some tasks, but is having trouble with task d and getting an error. They are seeking help from others and were able to use a trick to plot the eigenvalues for different values of n without repeating the calculation.
  • #1
Lambda96
158
59
TL;DR Summary
How to calculate eigenvalues, eigenvectors, determinants and inverses of a general nxn matrix
Hi,

In my linear algebra homework, there is a bonus assignment where we are supposed to use Mathematica to calculate matrices and their determinants etc. here is the assignment.

Bildschirmfoto 2023-05-17 um 15.02.04.png


Unfortunately, I am a complete newbie when it comes to Mathematica, this is the first time I have worked with Mathematica.

I was able to calculate the task a to c. Here is the solution for task b and the Matrix for the case ##n=5##.
Bildschirmfoto 2023-05-17 um 18.58.17.png

I have now problems with the task d, where I should calculate the determinants, eigenvalues, etc for the general case n or rather give a formula.

For the determinant as an example I proceeded as follows and unfortunately I get the following error:

Bildschirmfoto 2023-05-17 um 18.59.47.png

Unfortunately I don't know how to fix the error or is my initial equation already wrong?
 
Physics news on Phys.org
  • #2
You can't leave n undefined. Mathematica can't find the rule for arbitrary n by itself. You have to calculate the result for explicit values of n, and then find by yourself the general rule.
 
  • Like
Likes Lambda96 and renormalize
  • #3
As DrClaude says, ##n## must be specified explicitly:
1684346274397.png

The pattern is pretty obvious.
 
  • Like
Likes DrClaude and Lambda96
  • #4
Thanks DrClaude and renormalize for your help 👍👍

Thanks also renormalize for the trick with plotting n objects in Mathematica, so I could directly plot the eigenvalues from ##n=1## to ##n=10## without repeating the calculation 10 times 👍

I could now recognize corresponding patterns for the other values :smile:
 
  • Like
Likes renormalize and DrClaude

1. How do I calculate eigenvalues and eigenvectors of a matrix in Mathematica?

To calculate eigenvalues and eigenvectors of a matrix in Mathematica, you can use the built-in function Eigensystem[ ]. This function takes a matrix as its argument and returns a list containing the eigenvalues and corresponding eigenvectors in the form of {eigenvalues, eigenvectors}.

2. Can I calculate the determinant of a matrix in Mathematica?

Yes, you can use the Det[ ] function in Mathematica to calculate the determinant of a matrix. This function takes a matrix as its argument and returns a single value representing the determinant.

3. How can I find the inverse of a matrix in Mathematica?

The inverse of a matrix can be calculated using the Inverse[ ] function in Mathematica. This function takes a matrix as its argument and returns the inverse matrix.

4. What is the difference between symbolic and numeric calculations of matrices in Mathematica?

In symbolic calculation, the elements of a matrix are treated as variables and the calculations are performed using algebraic manipulation. In numeric calculation, the values of the elements are used for calculations. Symbolic calculation is useful for theoretical analysis while numeric calculation is more suitable for practical applications.

5. Can I perform matrix operations in Mathematica using variables?

Yes, you can use variables to define matrices and perform operations on them in Mathematica. However, it is important to use the correct syntax and functions for matrix operations in order to get accurate results.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
862
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • Advanced Physics Homework Help
Replies
6
Views
935
  • Linear and Abstract Algebra
Replies
1
Views
811
  • Engineering and Comp Sci Homework Help
Replies
18
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
8K
  • Quantum Physics
Replies
2
Views
972
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Back
Top