summaryrefslogtreecommitdiff
path: root/50/CH3/EX3.12/ex_3_12.sce
diff options
context:
space:
mode:
Diffstat (limited to '50/CH3/EX3.12/ex_3_12.sce')
-rwxr-xr-x50/CH3/EX3.12/ex_3_12.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/50/CH3/EX3.12/ex_3_12.sce b/50/CH3/EX3.12/ex_3_12.sce
new file mode 100755
index 000000000..4599b1c23
--- /dev/null
+++ b/50/CH3/EX3.12/ex_3_12.sce
@@ -0,0 +1,28 @@
+//example no. 3.12
+//solve system by decomposition method
+
+A=[1 1 -1;2 2 5;3 2 -3]
+
+b=[2;-3;6]
+
+
+
+ // hence we can observe that LU decomposition method fails to solve this system since the pivot L(2,2)=0;
+
+
+ //we note that the coefficient matrix is not a positive definite matrix and hence its LU decomposition is not guaranteed,
+
+
+ //if we interchange the rows of A as shown below the LU decomposition would work,
+
+ A=[3 2 -3;2 2 5;1 1 -1]
+
+ b=[6;-3;2]
+
+ [U,L]=LandU(A,3) // call LandU function to evaluate U,L of A,
+
+n=3;
+Z=fore(L,b);
+
+X=back(U,Z)
+ \ No newline at end of file