Mathematica to solve a few NxN matrices

In summary, the conversation suggests using the function Chop[] in mathematica in order to filter out the imaginary component of the eigenvalues/eigenvectors and compare them. This can help with solving NxN matrices in mathematica.
  • #1
nbo10
418
5
Hi All,
I'm using mathematica to solve a few NxN matrices, but the eigen(values/vectors) comes back with 0. i, which is zero but how do I evaluate it as zero so that I can do comparison, > < =, etc... Thanks

JMD
 
Physics news on Phys.org
  • #2
I don't know exactly how to do it in mathematica, but I think you could filter out the real component and compare that.
 
  • #3
nbo10 said:
Hi All,
I'm using mathematica to solve a few NxN matrices, but the eigen(values/vectors) comes back with 0. i, which is zero but how do I evaluate it as zero so that I can do comparison, > < =, etc... Thanks

JMD


Use Chop[] !

cheers,
Patrick
 

Related to Mathematica to solve a few NxN matrices

1. How do I input matrices in Mathematica?

To input a matrix in Mathematica, use the command "MatrixForm" followed by the matrix elements in curly braces {}. For example, if you want to input a 2x2 matrix with elements 1, 2, 3, and 4, you would type "MatrixForm[{{1,2},{3,4}}]".

2. How can I perform basic operations on matrices in Mathematica?

Mathematica has built-in functions for basic matrix operations such as addition, subtraction, multiplication, and division. For example, to add two matrices A and B, you can use the command "A + B". To multiply two matrices, you can use the command "A.B".

3. How can I solve a system of linear equations using Mathematica?

To solve a system of linear equations, you can use the "Solve" function in Mathematica. Input the equations in the form of "a1x + b1y = c1" and "a2x + b2y = c2" and use "Solve[{a1x + b1y == c1, a2x + b2y == c2}, {x,y}]" to find the values of x and y that satisfy the equations.

4. Can Mathematica handle large matrices?

Yes, Mathematica has the ability to handle large matrices with thousands or even millions of elements. However, it may take longer to perform operations on larger matrices, so it is important to optimize your code for efficiency.

5. Is there a way to visualize matrices in Mathematica?

Yes, Mathematica has a built-in function called "MatrixPlot" that allows you to visualize matrices as a grid of colored squares, with each square representing an element in the matrix. This can be useful for quickly identifying patterns or outliers in your data.

Similar threads

Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
288
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
19
Views
138
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
Back
Top