LS approximation





| Vector |
in the palette on the schematic

The block is designed for approximation of table-defined functions by the least squares method (LS). The block has three vector inputs and two vector outputs.

Inputs

  • args_table - the port for the array of values of arguments of table-defined functions of dimension Npnt.
  • func_table - the port for an array of values of table-defined functions of dimension Npnt×Nfun (thus, approximation of several functions defined in the same points by an independent argument can be performed simultaneously).
  • args - the port for array of argument points of dimension Narg, in which it is necessary to calculate the value of approximated functions.

Outputs

  • output - the port for calculated after approximation of values of functions in the points specified in the third input port. The size of this output is equal to Narg×Nfun.
  • approx_koeff - the port for outputting values of coefficients of approximating polynomials (in ascending order of degrees). The size of this output is equal to (Order+1)⋅Nfun.

Properties

  • Form function:
    1. Polynomial a[m]⋅xm, m=0...Order.
    2. a[m]⋅sin(mπx), m=0...Order.
    3. a[m]⋅(1-x)⋅xm, m=0...Order.
  • Approximation order – Order;
  • Number of points of the function being approximated – Npnt;
  • Number of functions – Nfun.

Parameters

none