DAQmxCalculateReversePolyCoeff

NI-DAQmx C Functions

DAQmxCalculateReversePolyCoeff

int32 DAQmxCalculateReversePolyCoeff (float64 forwardCoeffs[], uInt32 numForwardCoeffsIn, float64 minValX, float64 maxValX, int32 numPointsToCompute, int32 reversePolyOrder, float64 reverseCoeffs[]);

Purpose

Computes a set of coefficients for a polynomial that approximates the inverse of the polynomial with the coefficients you specify with forwardCoeffs. The function generates a table of x versus y values over the range of x. The function then finds a polynomial fit, using the least squares method to compute a polynomial that computes an x given a y.

Parameters

Input
Name Type Description
forwardCoeffs float64 [] The array of the forward coefficients for the polynomial that computes y given a value of x. Each element of the array corresponds to a term of the equation. For example, if index 3 of the array is 9, the fourth term of the equation is 9x3.
numForwardCoeffsIn uInt32 The number of elements in forwardCoeff.
minValX float64 The minimum value of x for which you use the polynomial. This is the smallest value of x for which the function generates a y value in the table.
maxValX float64 The maximum value of x for which you use the polynomial. This is the largest value of x for which the function generates a y value in the table.
numPointsToCompute int32 The number of points in the table of x versus y values. The function spaces the values evenly between minValX and maxValX.
reversePolyOrder int32 The order of the reverse polynomial to compute. For example, an input of 3 indicates a 3rd order polynomial. An input of -1 indicates to compute a reverse polynomial of the same order as the forward polynomial.
Output
reverseCoeffs float64 [] The array of the reverse coefficients of the polynomial. Each element of the array corresponds to a term of the equation. For example, if index 3 of the array is 9, the fourth term of the equation is 9y3.
reverseCoeffs will be one greater than what you passed for reversePolyOrder. If you pass -1 for reversePolyOrder, the array must be the size of forwardCoeffs. Otherwise, the behavior is undefined.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.