Approximation Analysis Object *

23.08.2021

With this analysis object you can approximate an optional model function to your measurement data based on the least square error method.

You should use the approximation procedure if you know the mathematical relationship between your measurement data, e.g. if you know that your measurement data represents a quadratic characteristic curve. The approximation result is a formula that describes the functional relationship between the X and Y components of your data.

The quality of the calculated formula mainly depends on the model function , which you must specify as the basis for the approximation. The model function is a linear combination of different element functions. FlexPro offers you over 30 of these element functions from which you can construct your linear combination.

For the example of a square characteristic curve shown above, a model function such as the following is recommended: Y(X) = p0 + p1 * X + p2 * X². For this you have to select the element functions Constant, X and X^2 on the Options tab under Standard Model Function. The coefficients p0, p1 and p2 of the linear combination are calculated so that the resulting formula approximates as closely as possible the specified source data.

You could have also chosen Y(X) = a Sin(X) + b Cos(X) as a model function, but the resulting formula would have only poorly approximated the data in the example above. FlexPro provides you with the quality of the approximation through a goodness-of-fit measure. It specifies how precisely the calculated formula approximates the source data, and this should be as small as possible. The goodness-of-fit measure, also known as χ² (Chi-squared), is equal to the sum of the squares of all deviations of the approximated model function of the data.

Let us assume that the source data is in a characteristic curvedata set, which contains a measured component characteristic curve. This data set then forms discrete prop-points for a Characteristic Curve.y(Characteristic Curve.x)function, which is to be calculated. If you set the model function mentioned above on the Options tab in the analysis object, you obtain the following result:

Characteristic Curve.y(Characteristic Curve.x) = 2.5 + 0.1 * Characteristic Curve.x + 3.98 * Characteristic Curve.x^2

The factors 2.5, 0.1 and 3.98 were thus calculated by the approximation.

Standard and Custom Model Function

On the Standard Model Function tab, FlexPro offers you several predefined element functions. Simply select the functions that you want to use in the linear combination. The resulting model function will appear at the lower edge of the field.

If you want to use your own element functions, switch to the Custom Model Functions. Click on Add item and then choose either one of the predefined model functions or enter the element function you want to use. Write the function in FPScript notation, using the X variable.

Dynamic and Static Approximation

The approximation offers you two alternatives for calculating the coefficients: You can calculate the factors once and enter them as static in the model function or use a dynamic calculation for the factors. In this case, the factors are always re-calculated when the source data is changed.

Approximation and Approximation Coefficients

You can choose whether you want the approximation, i.e. the sampled model function, to be output as a signal, or the approximation coefficients to be output as a data series. For the output of the coefficients, the goodness-of-fit measure χ² is output as the last value in the data series.

Evaluating the Approximation Function

You can evaluate the approximated model function at the same X positions where your data points are located. Alternatively, you can freely define the X values for which the function is to be evaluated. For this, on the Data tab, select the option Use a different data set as independent variable X and specify a data set for the X values.

FPScript Functions Used

Approximation

See Also

2D Approximation Analysis Object

Linear Regression Analysis Object

* This analysis object is not available in FlexPro View.

Share article or send as email:

You might be interested in these articles