summaryrefslogtreecommitdiff
path: root/50/CH2/EX2.26
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /50/CH2/EX2.26
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 '50/CH2/EX2.26')
-rwxr-xr-x50/CH2/EX2.26/2_26.PNGbin0 -> 9944 bytes
-rwxr-xr-x50/CH2/EX2.26/ex_26.sce36
2 files changed, 36 insertions, 0 deletions
diff --git a/50/CH2/EX2.26/2_26.PNG b/50/CH2/EX2.26/2_26.PNG
new file mode 100755
index 000000000..d303cd438
--- /dev/null
+++ b/50/CH2/EX2.26/2_26.PNG
Binary files differ
diff --git a/50/CH2/EX2.26/ex_26.sce b/50/CH2/EX2.26/ex_26.sce
new file mode 100755
index 000000000..2e5761bf3
--- /dev/null
+++ b/50/CH2/EX2.26/ex_26.sce
@@ -0,0 +1,36 @@
+ // The equation x^3-7*x^2+16*x-12==0 has real roots.
+ // the graph of this function can be observed here.
+xset('window',25);
+x=0:.001:4; // defining the range of x.
+deff('[y]=f(x)','y=x^3-7*x^2+16*x-12'); //defining the cunction.
+deff('[y]=fp(x)','y=3*x^2-14*x+16');
+y=feval(x,f);
+
+a=gca();
+
+a.y_location = "origin";
+
+a.x_location = "origin";
+plot(x,y) // instruction to plot the graph
+title(' y = x^3-7*x^2+16*x-12')
+
+
+
+
+// given that the equation has double roots at x=2 hence m=2;
+
+m=2;
+
+ // solution by newton raphson method
+
+
+newton(1,f,fp) // calling the user defined function
+
+
+
+
+ //solution by modified newton raphsons mathod
+
+
+
+modified_newton(1,f,fp) \ No newline at end of file