Table Of Contents

Find a Zero 1D (Newton-Raphson » Formula) (G Dataflow)

Version:
    Last Modified: January 12, 2018

    Determines a zero of a function in a given interval using the Newton-Raphson method. You define the function with a formula.

    connector_pane_image
    datatype_icon

    h

    Step size that this node uses to calculate the numerical derivative of the given function.

    Default: 1E-08

    datatype_icon

    formula

    Formula that defines the function.

    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.
    datatype_icon

    start

    Start value of the interval.

    Default: 0

    datatype_icon

    end

    End value of the interval.

    Default: 1

    datatype_icon

    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

    datatype_icon

    options

    Conditions that terminate the process of finding zeros.

    This node terminates the process of finding zeros if this node reaches the accuracy threshold or passes the maximum iterations threshold.

    datatype_icon

    accuracy

    Maximum deviation of the calculated solution from the actual solution when determining the zeros.

    Default: 1E-08

    datatype_icon

    maximum iterations

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

    Default: 200

    datatype_icon

    zero

    Determined value of the independent variable where the function evaluates to zero.

    This value is an approximation of the actual value of the variable where the function evaluates to zero.

    datatype_icon

    f(zero)

    Function value at zero. The value is expected to be nearly zero.

    datatype_icon

    function calls

    Number of evaluations of the formula to determine the zeros.

    datatype_icon

    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 Determining Zeros Using the Newton-Raphson Method

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

    x new = { x 1 + x 2 2 ( Midpoint strategy ) x 1 f ( x 1 ) f ( x 1 ) ( Newton strategy )

    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.

    To determine the zero of x2 + sin(x) - 1 in the interval (0, 1), enter the following values on the panel.

    formula x^2+sin(x)-1
    start 0
    end 1

    The following table lists the outputs of this node.

    zero 0.636733
    f(zero) -1.11022E-16
    function calls 12

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: Not supported

    Web Server: Not supported in VIs that run in a web application


    Recently Viewed Topics