From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1332/CH6/EX6.4/6_4.sce | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 1332/CH6/EX6.4/6_4.sce (limited to '1332/CH6/EX6.4/6_4.sce') diff --git a/1332/CH6/EX6.4/6_4.sce b/1332/CH6/EX6.4/6_4.sce new file mode 100755 index 000000000..0371796a7 --- /dev/null +++ b/1332/CH6/EX6.4/6_4.sce @@ -0,0 +1,26 @@ +//Example 6.4 +//Gaussian Elimination Method without Pivoting +//Page no. 227 +clc;clear;close; + +A=[0.3*10^-11,1,0.7;1,1,0.9]; //augmented matrix + +//triangularization +for i=1:3 + B(1,i)=A(1,i) + B(2,i)=A(2,i)-(A(2,1)/A(1,1))*A(1,i) +end +disp(A,'Augmented Matrix=') +disp(B,'Triangulated Matrix=') + +//back substitution +x(2)=B(2,3)/B(2,2); +printf('\nx(2)=%f\n',x(2)) +for i=1:-1:1 + k=0 + for j=i+1:2 + k=k+B(i,j)*x(j) + end + x(i)=(1/B(i,i))*(B(i,3)-k) + printf('\nx(%i)=%f\n',i,x(i)) +end -- cgit