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.5/6_5.pdf | Bin 0 -> 6110 bytes 1332/CH6/EX6.5/6_5.sce | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 1332/CH6/EX6.5/6_5.pdf create mode 100755 1332/CH6/EX6.5/6_5.sce (limited to '1332/CH6/EX6.5') diff --git a/1332/CH6/EX6.5/6_5.pdf b/1332/CH6/EX6.5/6_5.pdf new file mode 100755 index 000000000..571664a3b Binary files /dev/null and b/1332/CH6/EX6.5/6_5.pdf differ diff --git a/1332/CH6/EX6.5/6_5.sce b/1332/CH6/EX6.5/6_5.sce new file mode 100755 index 000000000..c8db77c99 --- /dev/null +++ b/1332/CH6/EX6.5/6_5.sce @@ -0,0 +1,48 @@ +//Example 6.5 +//Dolittle Factorization Method +//Page no. 233 +clc;clear;close; + +A=[2,1,1;1,3,1;1,1,4]; +printf('\tL\t\t *\t\tU\t\t =\t\tA') +U(2,1)=0;U(3,1)=0;U(3,2)=0; +L(1,2)=0;L(1,3)=0;L(2,3)=0; +for i=1:3 + L(i,i)=1 +end +for i=1:3 + U(1,i)=A(1,i) +end +L(2,1)=1/U(1,1); +for i=2:3 + U(2,i)=A(2,i)-U(1,i)*L(2,1); +end +L(3,1)=1/U(1,1); +L(3,2)=(A(3,2)-U(1,2)*L(3,1))/U(2,2); +U(3,3)=A(3,3)-U(1,3)*L(3,1)-U(2,3)*L(3,2); +printf('\n') +for i=1:3 + for j=1:3 + printf('%.2f\t',L(i,j)) + end + + if(i==2) + printf(' * ') + else + printf('\t') + end + + for j=1:3 + printf('%.2f\t',U(i,j)) + end + if(i==2) + printf(' = ') + else + printf('\t') + end + for j=1:3 + printf('%.2f\t',A(i,j)) + end + printf('\n') +end + -- cgit