Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: nummath
See also: nmbrackout nmbrackin nmbrentroot nmbisect nmregfalsi nmsecant

Quantlet: nmridders
Description: Ridders' method (regula falsi modification) for finding a root of a given function in a given interval

Reference(s):

Usage: root = nmridders(fname {,a0,b0,xtol,maxiter})
Input:
fname string, name of a function whose root should be found. The function should have just one scalar parameter x. As a result, the function should return a scalar.
a0,b0 optional scalars, distinct initial points bracketing a root; if not given, nmbrackout will be used to find a bracket
xtol optional scalar; tolerance - absolute precision of the minimum; default xtol = 1e-8
maxiter optional scalar; maximal number of iterations; default maxiter = 100
Output:
root scalar, root of fname (isolated with an approximate precision xtol)

Note:

Example:
library("nummath")
proc(fval) = ftion(x)
  fval = x^2 - 16
endp
nmridders("ftion")

Result:
Contents of root
[1,]        4
Example:
library("nummath")
proc(fval) = ftion(x)
  fval = x^2 - 16
endp
nmridders("ftion",-10,0)

Result:
Contents of root
[1,]       -4



Author: L. Cizkova, 20030402 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006