diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1670/CH4/EX4.10/4_10.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '1670/CH4/EX4.10/4_10.sce')
-rwxr-xr-x | 1670/CH4/EX4.10/4_10.sce | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/1670/CH4/EX4.10/4_10.sce b/1670/CH4/EX4.10/4_10.sce new file mode 100755 index 000000000..ab713b8ab --- /dev/null +++ b/1670/CH4/EX4.10/4_10.sce @@ -0,0 +1,30 @@ +//Example 4.10
+//Givens Method
+//Page no. 105
+clc;close;clear;
+
+A=[8,-6,2;-6,7,-4;2,-4,3];
+n=3;
+for k=1:1
+ max1=0
+i1=2;j1=3;
+fi=(atan((2*A(i1,j1))/(A(i1,i1)-A(j1,j1)+10^-20)))/2
+disp(fi,'fi = ')
+O1=eye(n,n)
+O1(i1,j1)=-sin(fi)
+O1(j1,i1)=sin(fi)
+O1(i1,i1)=cos(fi)
+O1(j1,j1)=cos(fi)
+disp(O1,'O1 = ')
+A=inv(O1)*A*O1
+disp(A,'B = ')
+end
+printf('\n\n')
+l=poly(0,'lb')
+A=A-l*eye(n,n)
+disp(det(A),'Characteristic Equation = ')
+A=roots(det(A))
+printf('\n\n The eigenvalues are : \n\n')
+for i=1:n
+ printf('\tl%i = %g\t',i,A(i))
+end
\ No newline at end of file |