summaryrefslogtreecommitdiff
path: root/243/CH6/EX6.9
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /243/CH6/EX6.9
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 '243/CH6/EX6.9')
-rwxr-xr-x243/CH6/EX6.9/6_09.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/243/CH6/EX6.9/6_09.sce b/243/CH6/EX6.9/6_09.sce
new file mode 100755
index 000000000..b6f7b9129
--- /dev/null
+++ b/243/CH6/EX6.9/6_09.sce
@@ -0,0 +1,20 @@
+//Example No. 6_09
+//Root of the equation using SECANT Method
+//Pg No. 153
+clear ; close ; clc ;
+
+//Coefficients of polynomial in increasing order of power of x
+A = [ -10 -4 1];
+x1 = 4 ;
+x2 = 2 ;
+fx = poly(A,'x','c')
+for i = 1:6
+ printf('\n For Iteration No. %i\n',i)
+ fx1 = horner(fx,x1);
+ fx2 = horner(fx,x2);
+ x3 = x2 - fx2*(x2-x1)/(fx2-fx1) ;
+ printf('\n x1 = %f\n x2 = %f \n fx1 = %f \n fx2 = %f \n x3 = %f \n',x1,x2,fx1,fx2,x3) ;
+ x1 = x2;
+ x2 = x3;
+end
+disp('This can be still continued further for accuracy') \ No newline at end of file