AnalyticalApproximations`LdeApprox`
Copyright © 2003-2011DigiArea, Inc.. All rights reserved.
The package provides some functions for finding polynomial analytical and numerical approximations of functions and solutions of linear differential equations (LDEs). The main function (ApproxSol) allows one to find polynomial approximation for solutions of an LDE with polynomial coefficients on a given interval. The main algorithm applied is so called a-method (see [1]) which has the following special properties.
The method is numerically analytical one. It means that LDE coefficients, boundary or initial conditions and parameters of ApproxSol function (except degree of approximation polynomial) can be either symbolical or numerical expressions (see symbolic examples of the package).
The method gives the polynomial approximation which is very close to the uniform one. It means that the result is such a polynomial that minimizes the maximum value of the absolute error between the solution and a polynomial of the given degree over the interval under consideration (see numerical examples of the package).
The method is fast saturated. It means that the required precision can be reached very fast by increasing the degree of approximation polynomial [2].
The method can be applied to get approximation of either initial value problems (IVP) or boundary value problems (BVP) (see [3]). To receive normalized results of the solution of a homogeneous BVP one can use the package function Normalizes (see BVP examples of the package).
The method can be applied to get approximation of LDE's with regular singular points (see RSP examples of the package).
The method can be applied to get approximation of IVP or BVP even if the LDE has non-polynomial coefficients. To do this one can use the package function ToRatCoeffs (which gives rational approximation of the LDE coefficients) and then apply ApproxSol function to the result.
The so called modified a-method is also applied in the package (see modified a-method examples)
To present the package only LDEs with known analytical solutions are used.
The main function of the package ApproxSol has the following syntax.
Finding polynomial approximation for solutions of an LDE with polynomial coefficients.
This loads the package.
In[1]:=
This declares a simple LDE.
In[2]:=
Out[2]=
Now one can use ApproxSol function to find polynomial approximation of solution of the following IVP: {,y[0]==0,[0]==1}
In[3]:=
Out[3]=
Using Mathematica function DSolve to get the exact solution of the IVP.
In[4]:=
Out[4]=
Now one can compare the results.
In[5]:=
Out[5]=
The a-method is fast saturated. To see this one can try to calculate the approximation polynomial of 16-degree or higher.
In[6]:=
Out[6]=
In[7]:=
Out[7]=
Options for polynomial approximations.
Exact mode of calculation gives the result with no real numbers involved. Moreover any intermediate calculations are performed using exact arithmetic. This mode is available only if the LDE, boundary or initial conditions and boundary points of the interval has no real numbers involved. It should be pointed out that this mode (as a rule) leads to time and resources consuming computation and gives more bulky results. Nevertheless in some cases the Exact mode of calculation is absolutely necessary to get right results.
In a case of homogeneous LDE and BVP the appropriate eigenvalue variable must be specified by option Eigenvalue→variable (e.g. Eigenvalue→λ) to get solutions for different eigen values. Nevertheless in some simple cases the eigen value variable can be determined automatically by the algorithm (see example below).
The approximation problem can be treated as initial value problem (IVP) or boundary value problem (BVP) with regular singular points (RSP) or without them. The treatment is as follows.
If no condition (Cond) presented the problem treated as IVP and the initial point of the approximation is the middle point of the giving interval: x0=(a+b)/2.
If condition (Cond) is one point condition (for instance cond is y[x0]=0, y'[x0]=1, ... with one point x0) thenthe problem treated as IVP and x0 must be the middle point or the left point of the approximation interval, thusx0 = (a+b)/2 or x0 = a.
If condition (Cond) is two points condition (for instance cond is y[x0]=0, y'[x1]=1, ... with two points x0 and x1) then the problem is treated as BVP (see BVP examples) and it must be x0 = a and x1 = b or x0 = b and x1 = a.
If an LDE has an RSP then it must be the left point of the interval of approximation (see RSP examples).
In some cases (especially in a case of homogeneous LDE and BVP) it is convenient to get "normalized" approximate solution of a BVP or IVP. For this reason the package function Normalize is provided. Normalize performs normalization of a function f[x] on a given interval [a,b]. It means that for any f[x] one gets Normalize: .Thus functions are normalized to 1 on a given interval.
Normalize function.
Normalize makes effect only on such parts of expression expr which depend on x.
This declares LDE with parameter λ.
In[8]:=
Out[8]=
Now one can use ApproxSol function to find polynomial approximation of solutions of the following homogeneous BVP: {,y[0]==0,y[π]==0}. As corresponding eigen value variable is not specified then it is determined automatically. Only 6 values of eigen value variable are available for 5-degree approximation.
In[9]:=
Out[9]=
One has to normalize the result to compare it with the exact solution.
In[10]:=
Out[10]=
The exact solution is as follows.
In[11]:=
Out[11]=
This is the normalized form of the exact solution.
In[12]:=
Out[12]=
Now one can compare the results.
For λ = 1
In[13]:=
Out[13]=
In[14]:=
Out[14]=
For λ = 4
In[15]:=
Out[15]=
In[16]:=
Out[16]=
If the given LDE has non-polynomial coefficients one can use the package function ToRatCoeffs which gives a rational interpolation of the coefficients. This function applies RationalInterpolation function to each non-polynomial coefficient of the LDE. Thus ToRatCoeffs function inherits all options from the RationalInterpolation function of the NumericalMath`Approximations` package.
Rational interpolation for an LDE coefficients.
One can use any other available function from NumericalMath`Approximations` package to get appropriate approximation of the coefficients. Nevertheless it should be pointed out that in such a case the coefficients can not involve indeterminate variables except independent one. This is a restriction of NumericalMath`Approximations` package methods as pure numerical ones.
This LDE has non-polynomial coefficient.
In[17]:=
Out[17]=
Trying to find approximate solution.
In[18]:=
Out[18]=
Using ToRatCoeffs to convert the LDE into one with polynomial coefficients on the given interval.
In[19]:=
Out[19]=
Trying ApproxSol for the new LDE.
In[20]:=
Out[20]=
Using Mathematica function DSolve to get the exact solution.
In[21]:=
Out[21]=
Comparing the results.
In[22]:=
Out[22]=
The following example shows some of the package capabilities of getting symbolical results.
This is a simple IVP with parameter ξ.
In[23]:=
Out[23]=
Finding polynomial approximation of the IVP solution on interval [-h,h].
In[24]:=
Out[24]=
Finding exact solution of the IVP using Mathematica function DSolve.
In[25]:=
Out[25]=
Comparing exact and approximate results for and ξ=1
In[26]:=
Out[26]=
Comparing exact and approximate results for and
In[27]:=
Out[27]=
Comparing exact and approximate results for using Mathematica function Plot3D.
In[28]:=
Out[28]=
Comparing exact and approximate results in point using Mathematica function Plot3D.
In[29]:=
Out[29]=
Comparing exact and approximate results for using Mathematica function Plot3D.
In[30]:=
Out[30]=
The last example shows that AnalyticalApproximations`LdeApprox` package allows one to get polynomials with symbolic coefficients as an approximate solution of an LDE. The approximate solution gives uniform approximation of some class of functions on an interval. For more examples of this kind see symbolic examples of the package.
References
[1] Approximation Methods of Differential and Integral Equations Solving, V. K. Dzyadyk, Naukova Dumka, Kiev, 1988. (see QA371.D98 1995
in http://nvl.nist.gov/pub/new/newbook/1997/9715-nb.htm)
[2] On the Theory of Special Functions and its Approximations, V. K. Dzyadyk, Matematichesky Sbornik, 131, No.4, P. 438 - 464, 1986.
[3] Approximation Method for Boundary Value Problem Solution, V. K. Dzyadyk and L. A. Ostroveszky, Ukrainsky Matematichesky Zhurnal, 39, No. 3, P. 378-379, 1987.