summaryrefslogtreecommitdiff
path: root/1332/CH5/EX5.7
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1332/CH5/EX5.7
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1332/CH5/EX5.7')
-rwxr-xr-x1332/CH5/EX5.7/5_7.pdfbin0 -> 6197 bytes
-rwxr-xr-x1332/CH5/EX5.7/5_7.sce20
2 files changed, 20 insertions, 0 deletions
diff --git a/1332/CH5/EX5.7/5_7.pdf b/1332/CH5/EX5.7/5_7.pdf
new file mode 100755
index 000000000..f0152c41b
--- /dev/null
+++ b/1332/CH5/EX5.7/5_7.pdf
Binary files differ
diff --git a/1332/CH5/EX5.7/5_7.sce b/1332/CH5/EX5.7/5_7.sce
new file mode 100755
index 000000000..94a830d62
--- /dev/null
+++ b/1332/CH5/EX5.7/5_7.sce
@@ -0,0 +1,20 @@
+//Example 5.7
+//Aitkens Method
+//Page no. 161
+clc;clear;close;
+deff('x=f(x)','x=exp(-x)')
+printf('n\tx0\t\tx1\t\tx2\t\tx3\t\ty\t\tdx0\n')
+printf('-----------------------------------------------------------------------------------------------------\n')
+x0=0.5;e=0.0001
+for i=1:3
+ x1=f(x0);x2=f(x1);x3=f(x2);
+ y=x3-((x3-x2)^2)/(x3-2*x2+x1)
+ dx0=y-x0;
+
+ printf(' %i\t%.10f\t%.10f\t%.10f\t%.10f\t%.10f\t%.10f\n',i,x0,x1,x2,x3,y,dx0)
+ x0=y;
+ if abs(x0)<e then
+ break;
+ end
+end
+printf('\n\nThe solution of this equation after %i Iterations is %.10f',i,y) \ No newline at end of file