diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /149/CH24/EX24.7 | |
download | Scilab-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.7')
-rwxr-xr-x | 149/CH24/EX24.7/ques7.sce | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/149/CH24/EX24.7/ques7.sce b/149/CH24/EX24.7/ques7.sce new file mode 100755 index 000000000..b117f3f66 --- /dev/null +++ b/149/CH24/EX24.7/ques7.sce @@ -0,0 +1,20 @@ +//ques 7
+clear
+clc
+disp('To find squareroot of 28 by newtons method let x=sqrt(28) ie x^2-28=0');
+function y=f(x)
+ y=x^2-28;
+endfunction
+disp(' To find the roots by newtons method ');
+disp('f(5)=-ve and f(6) is +ve so a root lies between 5 and 6');
+l=5;
+m=6;
+disp('let us take x0=5.5');
+disp("Root is given by rn=xn-f(xn)/der(f(xn)) ");
+disp('approximated root in each steps are');
+x0=5.5;
+for i=1:4
+ k=x0-f(x0)/derivative(f,x0);
+ disp(k);
+ x0=k;
+end
\ No newline at end of file |