summaryrefslogtreecommitdiff
path: root/149/CH24/EX24.5
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /149/CH24/EX24.5
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 '149/CH24/EX24.5')
-rwxr-xr-x149/CH24/EX24.5/ques5.sce17
1 files changed, 17 insertions, 0 deletions
diff --git a/149/CH24/EX24.5/ques5.sce b/149/CH24/EX24.5/ques5.sce
new file mode 100755
index 000000000..a11557622
--- /dev/null
+++ b/149/CH24/EX24.5/ques5.sce
@@ -0,0 +1,17 @@
+//ques 5
+disp(' To find the roots of f(x)=3x-cos(x)-1 by newtons method ');
+disp('f(0)=-ve and f(1) is +ve so a root lies between 0 and 1');
+l=0;
+m=1;
+function y=f(x)
+ y=3*x-cos(x)-1;
+endfunction
+x0=0.6;
+disp('let us take x0=0.6 as the root is closer to 1');
+disp("Root is given by r=x0-f(xn)/der(f(xn)) ");
+disp('approximated root in each steps are');
+for i=1:3
+ k=x0-f(x0)/derivative(f,x0);
+ disp(k);
+ x0=k;
+end