From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 50/CH2/EX2.16/2_16.PNG | Bin 0 -> 11143 bytes 50/CH2/EX2.16/ex_16.sce | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 50/CH2/EX2.16/2_16.PNG create mode 100755 50/CH2/EX2.16/ex_16.sce (limited to '50/CH2/EX2.16') diff --git a/50/CH2/EX2.16/2_16.PNG b/50/CH2/EX2.16/2_16.PNG new file mode 100755 index 000000000..dd5cb960c Binary files /dev/null and b/50/CH2/EX2.16/2_16.PNG differ diff --git a/50/CH2/EX2.16/ex_16.sce b/50/CH2/EX2.16/ex_16.sce new file mode 100755 index 000000000..d1a65a8ca --- /dev/null +++ b/50/CH2/EX2.16/ex_16.sce @@ -0,0 +1,38 @@ + // The equation x^3-5*x+1==0 has real roots. + // the graph of this function can be observed here. +xset('window',15); +x=-2:.01:4; // defining the range of x. +deff('[y]=f(x)','y=x^3-5*x+1'); //defining the function. +deff('[y]=fp(x)','y=3*x^2-5'); +deff('[y]=fpp(x)','y=6*x'); +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-5*x+1') + +// from the above plot we can infre that the function has roots between +// the intervals (0,1),(2,3). +// since we have been asked for the smallest positive root of the equation, +// we are intrested on the interval (0,1) +// a=0;b=1, + + +// solution by multipoint iteration method + +// the approximate root after 3 iterations can be observed. + + +multipoint_iteration31(0.5,f,fp) + +// hence the approximate root witin the permissible error of 10^-15 is .201640, + + + +multipoint_iteration33(0.5,f,fp) + +// hence the approximate root witin the permissible error of 10^-15 is .201640, \ No newline at end of file -- cgit