PHP Класс MathPHP\NumericalAnalysis\RootFinding\NewtonsMethod

In numerical analysis, Newton's method is a method for finding successively better approximations to the roots (or zeroes) of a real-valued function.
Показать файл Открыть проект

Открытые методы

Метод Описание
solve ( callable $function, array $args, number $target, number $tol, number $position ) : number Use Newton's Method to find the x which produces $target = $function(x) value $args is an array of parameters to pass to $function, but having the element that will be changed and serve as the initial guess in position $position.

Описание методов

solve() публичный статический Метод

Use Newton's Method to find the x which produces $target = $function(x) value $args is an array of parameters to pass to $function, but having the element that will be changed and serve as the initial guess in position $position.
public static solve ( callable $function, array $args, number $target, number $tol, number $position ) : number
$function callable f(x) callback function
$args array Parameters to pass to callback function. The initial value for the parameter of interest must be in this array.
$target number Value of f(x) we a trying to solve for
$tol number Tolerance; How close to the actual solution we would like.
$position number Which element in the $args array will be changed; also serves as initial guess
Результат number