Download LabVIEW User Manual

Transcript
Chapter 17
Curve Fitting
the nonlinear function f = f(X, A). This is a more efficient computation
than the numerical calculation, because it does not require a numerical
approximation to the Jacobian.
The input arrays X and Y define the set of input data points. The VI
assumes that you have prior knowledge of the nonlinear relationship
between the x and y coordinates. That is, f = f(X, A), where the set of
coefficients, A, is determined by the Levenberg-Marquardt algorithm.
Using this function successfully sometimes depends on how close your
initial guess coefficients are to the solution. Therefore, it is always worth
taking effort and time to obtain good initial guess coefficients to the
solution from any available resources before using the function.
Using the Nonlinear Lev-Mar Fit VI
So far, you have seen VIs that are used when there is a linear relationship
between y and the coefficients a0, a1, a2, .... However, when a nonlinear
relationship exists, you can use the Nonlinear Lev-Mar Fit VI to determine
the coefficients. This VI uses the Levenberg-Marquardt method, which is
very robust, to find the coefficients A = {a0, a1, a2, ..., ak} of the nonlinear
relationship between A and y[i]. The VI assumes that you have prior
knowledge of the nonlinear relationship between the x and y coordinates.
As a preliminary step, you need to specify the nonlinear function in the
Formula Node on the block diagram of one of the subVIs of the Nonlinear
Lev-Mar Fit VI. This particular subVI is the Target Fnc and Deriv NonLin
VI. You can access the Target Fnc and Deriv NonLin VI by selecting it
from the menu that appears when you select Project»This VI’s SubVIs.
Note
When using the Nonlinear Lev-Mar Fit VI, you also must specify the nonlinear
function in the Formula Node on the block diagram of the Target Fnc and
Deriv NonLin VI.
The connections to the Nonlinear Lev-Mar Fit VI are shown below:
© National Instruments Corporation
17-19
LabVIEW User Manual