A Review of the Approximations package
Ken Levasseur
Mathematical Sciences
UMass Lowell
Kenneth_Levasseur@uml.edu
Introduction
The Approximations package provides a variety of functions for approximating functions by rational functions.
Given a function f defined on an interval [a,b], the basic problem this addresses is that of finding a rational function r(x) =
, where p(x) and q(x) are polynomials with some specified maximal degrees, such that f and r are as close as possible in some sense.
In this review, we will approximate this function. If you are reading a Mathematica Notebook, you can change the function to one you might prefer.
Minimization of Relative Error
Here is how to approximate our function in the relative minimax sense. First we approximate with polynomials of degree 2 or less.
The output has several parts. The first part is the list of locations of relative maxima in the error.
The second part of the output has two parts. The first is the approximating function itself.
The second part of the second part is the maximum error
Here is a plot of the error function
Here is an approximation by a rational function with degrees 1 and 2 for the numerator and denominator.
Notice that the error is considerably smaller in this case.
Minimization of Absolute Error
Minimization of absolute error is done with GeneralMiniMaxApproximation:
Notice how the maximum error is attained at all four extremes of the error function.
Other weight functions can be used in the third part of the first argument
Not everything goes well
I haven't had a chance to experiment with the Brake option that is mentioned in the message below.
| Created by Mathematica (March 1, 2006) |