• Function approximation example of the AnalyticalApproximations`LdeApprox` package

    Copyright © 2004-2016 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.

  • [Graphics:Mathematica/LdeApprox/fun/images/index_gr_1.gif]
  • Let us try to find polynomial approximation of simple function.

  • [Graphics:Mathematica/LdeApprox/fun/images/index_gr_2.gif]
  • It is obvious that the function satisfies the following initial value problem:.

  • [Graphics:Mathematica/LdeApprox/fun/images/index_gr_4.gif]
  • Finding 3-rd degree polynomial approximation of the IVP solution on interval [-h, h].

  • [Graphics:Mathematica/LdeApprox/fun/images/index_gr_6.gif]
  • Comparing exact and approximate results for h = 1 and [Graphics:Mathematica/LdeApprox/fun/images/index_gr_8.gif]

  • [Graphics:Mathematica/LdeApprox/fun/images/index_gr_9.gif]


  • Comparing exact and approximate results for [Graphics:Mathematica/LdeApprox/fun/images/index_gr_12.gif] and n = [-3, 3] using Mathematica™ function Plot3D.

  • [Graphics:Mathematica/LdeApprox/fun/images/index_gr_13.gif]


    Not bad for 3-rd degree polynomial approximation, isn't it?