Posts

Showing posts from October, 2021

Maple Working Rules for Newton-Raphson Method

Image
  Newton-Raphson Method The Newton-Raphson method is based on the principle that if the initial guess of the root of f(x)=0   is at x(i) , then if one draws the tangent to the curve at f(x(i)) , the point x(i+1)   where the tangent crosses the -axis is an improved estimate of the root (Figure 1). Using the definition of the slope of a function , at x= x(i)   Equation (1) is called the Newton-Raphson formula for solving nonlinear equations of the form  f(x)=0 .  So starting with an initial guess ,   x(i) , one can find the next guess ,   x(i+1) , by using Equation (1).  One can repeat this process until one finds the root within a desirable tolerance. Maple Setup [> NewtonsMethod(x^3 + 4*x - 10, x = 1);                           1.556773264 [> NewtonsMethod(x^3 + 4*x - 10, x = 2, output = sequence); 2, 1.625000000, 1.558650066, 1.556774723, 1.556773264, 1.556773264 [>...

Maple Program for Secant Method

Image
Working Rules for Secant Method in Maple 2020  The Secant command numerically approximates the roots of an algebraic function, f(x) , using a technique similar to Newton's method but without the need to evaluate the derivative of f(x) . Given an expression f and an initial approximate a, the Secant command computes a sequence  " p[k],  k=0..n ", of approximations to a root of f(x)=0 , where "n" is the number of iterations taken to reach a stopping criterion. The Secant command is a shortcut for calling the Roots command with the method=secant option The criterion that the approximations must meet before discontinuing the iterations. The following describes each criterion: [> restart; [> with(Student[NumericalAnalysis]); [> f := x^3 + 4*x^2 - 10; [> Secant(f, x = [1, 2], tolerance = 10^(-2));                           1.365211903 [> Secant(f, x = [1, 2], tolerance = 10^(-2), stoppingcriterion =...

Maple Program for Bisection Method

Image
  Bisection Method restart;  with(Student[NumericalAnalysis]): f := x^3 + 4*x^2 - 10; Bisection(f, x = [1, 2], tolerance = 10^(-4)); 1.365112304 Bisection(f, x = [1, 2], tolerance = 10^(-4), output = sequence); [1., 2.], [1., 1.500000000], [1.250000000, 1.500000000], [1.250000000, 1.375000000], [1.312500000, 1.375000000], [1.343750000, 1.375000000], [1.359375000, 1.375000000], [1.359375000, 1.367187500], [1.363281250, 1.367187500], [1.363281250, 1.365234375], [1.364257812, 1.365234375] Bisection(f, x = [1, 2], tolerance = 10^(-2), stoppingcriterion = absolute); 1.367187500 Bisection(f, x = [1, 2], output = animation, tolerance = 10^(-3), stoppingcriterion = function_value); Bisection(f, x = [1, 2], output = plot, tolerance = 10^(-3), maxiterations = 15, stoppingcriterion = relative); Bisection(f, x = [1, 2], output = animation, tolerance = 10^(-3), maxiterations = 15, stoppingcriterion = relative); Bisection(f, x = [1, 2], output = information, tolerance = 10^(-9), maxiteratio...