Maple Program for Secant Method

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 = absolute);

                          1.365211903
[> Secant(f, x = [1, 2], tolerance = 10^(-2), output = sequence);

   1., 2., 1.263157895, 1.338827839, 1.366616395, 1.365211903


To play the following animation in this help page, right-click (Control-click, on Macintosh) the plot to display the context menu.  Select Animation > Play.


[> Secant(f, x = [1, 2], output = animation, stoppingcriterion = function_value);

 

[> Secant(f, x = [1, 2], output = animation, stoppingcriterion = function_value);



Comments

Popular posts from this blog

Maple Program for Bisection Method