Approximation of Functions
¦ HOME ¦ Math Software Downloads ¦ Numerical Methods ¦ Register Your Software ¦ Contact ¦ Search ¦ Credit ¦

Software:
Linear Algebra
Functions
Ordinary Differential Equations
Systems of Nonlinear Equations
Multiple Integration
Maxima and Minima
Functions and Equations
Regression
Approximation & Interpolation
Stereographer
Math Miscellanea
Support Software
Numerical Methods:
Integration and Differentiation
Solution of Equations
Maxima and Minima
Approximation of Functions
Regression
Polynomial Regression
Fast Fourier Transforms
Differential Equations
Linear Algebra Methods
Miscellaneous Procedures
Decimal Comma/Decimal Point
                            

   
Google
 
APPROXIMATION OF FUNCTIONS

Suppose we have a one-variable function f(x) whose values are known at points which may be unevenly spaced:
 


We can
do an exact fit using the method of Undetermined Coefficients. If we approximate the function by a linear combination of the first Nx+1 members of a certain complete set of functions {Gi}, using a series expansion of the form:

Nx
ε Ai Gi(x)   ;   G0(x)=1
i=0

where the Ai's are constants and Nx+1 is the number of terms in x.  For an exact fit, Nx=Px, otherwise Nx<Px.

If we use xC as center of expansion, the approximating function's value at the mth grid point is:

Nx
ε Ai Gi(Xm-xC)
i=0

To do an exact fit, at each grid point we equate the value of the function at that grid point to the value of the approximation at the same grid point:

               Nx
f(xm) =
ε Ai Gi(Xm-xC)
       i=0

This way we set up a system of linear equations from which the coefficients Ai can be easily found.

If we have a 2-variable tabulated function f(x,y) whose values are known at the grid points of a rectangular grid which may be unevenly spaced, such as

which has Px intervals in the x-direction and Py intervals in the y-direction, we can approximate the function by a linear combination of the first Nx+1 and Ny+1 members of certain complete sets of functions {Gi} and {Hj} using a series expansion of the form:

Nx        Ny
ε    ε   Aij Gi(x) Hj(y)  ;  G0(x)=1  ;  H0(y)=1
i=0   j=0

which has Nx+1 terms in x and Ny+1 terms in y.  For an exact fit, Nx=Px and Ny=Py, otherwise Nx<Px and/or Ny<Py.

If we use (xC,yC) as center of expansion, the approximating function's value at the (xm,yn) grid point is:

Nx        Ny
ε    ε   Aij Gi(x
m-xC) Hj(yn-yC)
i=0   j=0

To do an exact fit, at each grid point we equate the value of the function at that grid point to the value of the approximation at the same grid point:

                     Nx       Ny
f(
xm,yn) = ε    ε   Aij Gi(xm-xC) Hj(yn-yC)
          i=0   j=0

This way we set up a system of linear equations from which the coefficients Aij can be easily found.

Extension to more than 2 variables is obvious.

The sets of functions used here, that is, {Gi} and {Hj}, are:

1, (x-xC), (x-xC)2, (x-xC)3, (x-xC)4,...

and

        2p(x-xC)         2p(x-xC)         2*2p(x-xC)         2*2p(x-xC)
1, SIN( ———————— ), COS( ————————— ), SIN( —————————— ), COS( ——————————— ),...
         
PER              PER                PER                PER

where xC is the center of expansion and PER is the period.

The use of finite power and trigonometric series is partly justified by Weierstrass' Approximation Theorems:

1) Any function which is continuous in an interval may be approximated in that interval, to any degree of accuracy, by a finite power series.

2) Any continuous periodic function may be approximated, to any degree of accuracy, by a finite trigonometric series.

Naturally, if the function itself is not a finite power or trigonometric series, then we need more and more terms for more and more accuracy.  A power or trigonometric series with infinite number of terms may yield the exact value of the function, as is the case with Taylor and Fourier series.  Developing a Fourier or Taylor series, however, may not be very easy.  A Fourier series requires the evaluation of the Fourier Coefficients, which are integrals which in turn may need numerical evaluation.  A Taylor expansion requires you to find all the function's derivatives and this may be a difficult task.  (Curiously, continuous nondifferentiable functions exist, that is, there are continuous curves with no tangent at any point.)

Thus, the Weierstrass' Theorems make this approach acceptable if the solution is known to be continuous in the interval of interest.  If necessary, the problem should be solved piecewise, each time choosing an interval in which the solution and its derivatives are known to be continuous and sufficiently smooth (with a limited number of “wiggles”).

Copyright © 2001-2010 Numerical Mathematics. All rights reserved.