# Eigen value of 100*100 Symbolic Matrix

3 ビュー (過去 30 日間)
SHUBHAM PATEL 2019 年 12 月 5 日

I am constructing a symbolic matrix and want to get eigen values and eigen vectors. Using following code I got error.
syms E t
Na = 100;
Nb = 100;
H =zeros(Na,Nb);
H =sym(H);
% E=1;t=1;
for i = 1:Na
for j = 1:Nb
if (i==j)
H(i,j)= E;
elseif (i-j==1|| i-j==2||i-j==3 )
H(i,j)= -t;
elseif (i-j ==-1|| i-j==-2||i-j==-3 )
H(i,j)=(-t);
end
end
end
If i would have used
[V,D]=eig(H)
it was taking too long. I don't know when it's gonna stop. Why is that? Then I tried to calculate only Eigenvalue, but an error occured:
"Error using symengine
Column index out of range."
How to sort it out?

#### 0 件のコメント

サインイン to comment.

### 採用された回答

Shashank Gupta 2019 年 12 月 11 日
Hi Patel,
Matrix computations which involvs many symbolic variables can be slow. In your case we have 100x100 symbolic matrix which makes the speed slower. To increase the computational speed, you can reduce the number of symbolic variables by substituting the given values for some variables. Also the “symengine error” is arising because of the similar reason, it is taking more time to evaluate the eigenvalue, you can check this by reducing the matrix size and see weather the same error arise.
I hope this helps you.

#### 0 件のコメント

サインイン to comment.

### その他の回答 (0 件)

サインイン してこの質問に回答します。