Function approximation example of the AnalyticalApproximations`LdeApprox` package
Copyright © 2004-2013 DigiArea, Inc. All rights reserved.
This notebook illustrates AnalyticalApproximations`LdeApprox` package capability of doing polynomial approximation of a given function. This method can be used if one knows an LDE which the function satisfies. First of all we load LdeApprox package and define a function to approximate and corresponding LDE. Then we use ApproxSol procedure to find 3-rd degree polynomial approximation for the LDE solution on interval x = [-h,h]. Finally we compare exact and approximate results using Mathematica® function Plot3D.
It should be pointed out that this method of approximation can be used even if the corresponding LDE has non polynomial coefficients. In this case one can use the package procedure ToRatCoeffs first to get new LDE with polynomial coefficients and then apply the method (see example with non polynomial coefficients).
This loads the package.
Let us try to find polynomial approximation of simple function.
It is obvious that the function satisfies the following initial value problem:.
Finding 3-rd degree polynomial approximation of the IVP solution on interval [-h, h].
Comparing exact and approximate results for h = 1 and
Comparing exact and approximate results for and n = [-3, 3] using Mathematica function Plot3D.
Not bad for 3-rd degree polynomial approximation, isn't it?