# Newton-Raphson Zero Finder (Formula) (G Dataflow)

Determines a zero of a function between two points with the help of the derivative of the function.

This node uses the Newton-Raphson method to determine a zero of a function.

## h

Delta value to calculate the derivative of the given formula.

Default: 1E-08

## formula

Function to calculate. The formula can contain any number of valid variables.

Entering Valid Variables

This node accepts variables that use the following format rule: variables must start with a letter or an underscore followed by any number of alphanumeric characters or underscores.

## start

Start value of the interval where this node starts searching for zeros.

Default: 0

## end

End value of the interval where this node stops searching for zeros.

Default: 1

## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

## accuracy

Accuracy and maximum iterations used to determine the zeros.

### accuracy

Accuracy used to determine the zeros.

Default: 1E-8

### maximum iterations

Maximum number of iterations that the node runs to find the zeros.

Default: 200

## zero

Point of determined zero of formula. zero is the approximate value of the underlying zero of the function.

## f(zero)

Function value at the point given by zero. The value should be very close to zero.

## function calls

Number of evaluations that the formula performs in finding the zeros.

## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## Algorithm for Finding Zeros Using the Newton-Raphson Method

The Newton-Raphson Method combines the simple midpoint strategy and the Newton strategy to determine a zero of a function. The midpoint strategy and the Newton strategy are defined by the following equation:

${x}_{\mathrm{new}}=\left\{\begin{array}{cc}\frac{{x}_{1}+{x}_{2}}{2}& \text{\hspace{0.17em}}\left(\mathrm{Midpoint}\text{\hspace{0.17em}}\mathrm{strategy}\right)\\ {x}_{1}-\frac{f\left({x}_{1}\right)}{f\prime \left({x}_{1}\right)}& \left(\mathrm{Newton}\text{\hspace{0.17em}}\mathrm{strategy}\right)\end{array}$

where

• x1 and x2 are given guesses with f(x1) * f(x2) < 0
• f is the given function

The following figure demonstrates the Newton strategy.

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices