Professional Documents
Culture Documents
(DE G611)
Assignment
SUBMITTED
TO
DR.SANDEEP JOSE
SUBMITTED BY
MANEPALLI RAVI TEJA (2017H1410057G)
eigenvectors of a symmetric matrix. Use the program to find the eigenvalues and
eigenvectors of the matrix
1 1 1
1 2 2
1 2 3
Jacobian code:
A=zeros(rows,rows);
C=zeros(rows,rows);
D=zeros(rows,rows);
V=eye(rows,rows);
N=inf;
for i=1:rows
for j=1:rows
end
end
B= A-diag(diag(A));
[M,I] = max(B(:));
[X,Y] = ind2sub(size(B),I);
while N >0.001
D=eye(rows);
t= 0.5*(atan(2*A(X,Y)/(A(X,X)-A(Y,Y))));
D(X,X)=cos(t);D(X,Y)=sin(t);D(Y,X)=-sin(t);D(Y,Y)=cos(t);
A=D'*A*D;
V=V*D;
C= A-diag(diag(A));
N = max(max(C));
[M,I] = max(C(:));
[X,Y] = ind2sub(size(C),I);
End
o=diag(A);
Output:
V=
2)Develop a general computer program, , to implement the matrix iteration method. Use
the program to find the eigenvalues and eigenvectors of the matrix [A] given in Q1
Matrix iterative method:
Code:
A=eye(rows,rows);
for i=1:rows
for j=1:rows
end
end
X=[1;1;1];
for i=1:rows
for j=1:8
x= D*X;
X= (1/x(1,1))*x;
end
c= X'*A*X;
w= (1/c)^(1/2);
X= w*X;
D= D - (x(1,1)*X*X'*A);
end
Output:
X = 0.3280
0.5910
0.7370
X = 0.7370
0.3280
-0.5910
No.3 eigen value is 3.079785e-01
X = 0.5910
-0.7370
0.3280
>>