Non polynomial example of the AnalyticalApproximations`LdeApprox` package Copyright © 2004-2012 DigiArea, Inc. All rights reserved. Description:
This notebook illustrates AnalyticalApproximations`LdeApprox` package capability of doing polynomial approximation of an LDE solution with non polynomial coefficients. If the given LDE has non-polynomial coefficients one can use the package procedure ToRatCoeffs which gives a rational approximation of the coefficients. This procedure applies RationalInterpolation function from NumericalMath`Approximations` package to each non-polynomial coefficient of the LDE. It should be pointed out that the coefficients can not involve indeterminate variables except independent one. This restriction comes from NumericalMath`Approximations` package as pure numerical one. First of all we load the package and define an IVP. Then we use ToRatCoeffs and ApproxSol procedures to find 9-th degree polynomial approximation for the IVP solution on interval x = [-1,1]. After that we find exact solution by Mathematica function DSolve. Finally we compare exact and approximate results using Mathematica function Plot. This loads the package.
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_1.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_1.gif)
This LDE has non-polynomial coefficient.
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_2.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_2.gif)
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_3.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_3.gif)
Trying to find approximate solution(an error occurs as the LDE has non polynomial coefficients).
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_4.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_4.gif)
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_5.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_5.gif)
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_6.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_6.gif)
Using ToRatCoeffs to convert the LDE into one with polynomial coefficients on the given interval.
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_7.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_7.gif)
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_8.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_8.gif)
Trying ApproxSol for the new LDE.
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_9.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_9.gif)
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_10.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_10.gif)
Using Mathematica function DSolve to get the exact solution.
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_11.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_11.gif)
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_12.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_12.gif)
Comparing the results.
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_13.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_13.gif)
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_14.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_14.gif)
![[Graphics:Mathematica/LdeApprox/nonpoly/images/index_gr_15.gif]](Mathematica/LdeApprox/nonpoly/images/index_gr_15.gif)
Note:
We use quite simple examples (just for Web). You can try more complex examples in your computer. |