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.

LdeApprox_1.gifLdeApprox_2.gif

Finding polynomial approximation for solutions of an LDE with polynomial coefficients.

This loads the package.

In[1]:=

LdeApprox_3.gif

This declares a simple LDE.

In[2]:=

LdeApprox_4.gif

Out[2]=

LdeApprox_5.gif

Now one can use ApproxSol function to find polynomial approximation of solution of the following IVP: {LdeApprox_6.gif,y[0]==0,LdeApprox_7.gif[0]==1}

In[3]:=

LdeApprox_8.gif

Out[3]=

LdeApprox_9.gif

Using Mathematica function DSolve to get the exact solution of the IVP.

In[4]:=

LdeApprox_10.gif

Out[4]=

LdeApprox_11.gif

Now one can compare the results.

In[5]:=

LdeApprox_12.gif

Out[5]=

LdeApprox_13.gif

The a-method is fast saturated. To see this one can try to calculate the approximation polynomial of 16-degree or higher.

In[6]:=

LdeApprox_14.gif

Out[6]=

LdeApprox_15.gif

In[7]:=

LdeApprox_16.gif

Out[7]=

LdeApprox_17.gif

LdeApprox_18.gif
LdeApprox_19.gifLdeApprox_20.gifLdeApprox_21.gif

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: LdeApprox_22.gif.Thus functions are normalized to 1 on a given interval.

LdeApprox_23.gif

Normalize function.

Normalize makes effect only on such parts of expression expr which depend on x.

This declares LDE with parameter λ.

In[8]:=

LdeApprox_24.gif

Out[8]=

LdeApprox_25.gif

Now one can use ApproxSol function to find polynomial approximation of solutions of the following homogeneous BVP: {LdeApprox_26.gif,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]:=

LdeApprox_27.gif

LdeApprox_28.gif

LdeApprox_29.gif

Out[9]=

LdeApprox_30.gif

One has to normalize the result to compare it with the exact solution.

In[10]:=

LdeApprox_31.gif

Out[10]=

LdeApprox_32.gif

The exact solution is as follows.

In[11]:=

LdeApprox_33.gif

Out[11]=

LdeApprox_34.gif

This is the normalized form of the exact solution.

In[12]:=

LdeApprox_35.gif

Out[12]=

LdeApprox_36.gif

Now one can compare the results.

For λ = 1

In[13]:=

LdeApprox_37.gif

Out[13]=

LdeApprox_38.gif

In[14]:=

LdeApprox_39.gif

Out[14]=

LdeApprox_40.gif

For λ = 4

In[15]:=

LdeApprox_41.gif

Out[15]=

LdeApprox_42.gif

In[16]:=

LdeApprox_43.gif

Out[16]=

LdeApprox_44.gif

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.

LdeApprox_45.gif

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]:=

LdeApprox_46.gif

Out[17]=

LdeApprox_47.gif

Trying to find approximate solution.

In[18]:=

LdeApprox_48.gif

LdeApprox_49.gif

Out[18]=

LdeApprox_50.gif

Using ToRatCoeffs to convert the LDE into one with polynomial coefficients on the given interval.

In[19]:=

LdeApprox_51.gif

Out[19]=

LdeApprox_52.gif

Trying ApproxSol for the new LDE.

In[20]:=

LdeApprox_53.gif

Out[20]=

LdeApprox_54.gif

Using Mathematica function DSolve to get the exact solution.

In[21]:=

LdeApprox_55.gif

Out[21]=

LdeApprox_56.gif

Comparing the results.

In[22]:=

LdeApprox_57.gif

Out[22]=

LdeApprox_58.gif

The following example shows some of the package capabilities of getting symbolical results.

This is a simple IVP with parameter ξ.

In[23]:=

LdeApprox_59.gif

Out[23]=

LdeApprox_60.gif

Finding polynomial approximation of the IVP solution on interval [-h,h].

In[24]:=

LdeApprox_61.gif

Out[24]=

LdeApprox_62.gif

Finding exact solution of the IVP using Mathematica function DSolve.

In[25]:=

LdeApprox_63.gif

Out[25]=

LdeApprox_64.gif

Comparing exact and approximate results for LdeApprox_65.gif and ξ=1

In[26]:=

LdeApprox_66.gif

Out[26]=

LdeApprox_67.gif

Comparing exact and approximate results for LdeApprox_68.gif and LdeApprox_69.gif

In[27]:=

LdeApprox_70.gif

Out[27]=

LdeApprox_71.gif

Comparing exact and approximate results for LdeApprox_72.gif using Mathematica function Plot3D.

In[28]:=

LdeApprox_73.gif

Out[28]=

LdeApprox_74.gif

Comparing exact and approximate results in point LdeApprox_75.gif using Mathematica function Plot3D.

In[29]:=

LdeApprox_76.gif

Out[29]=

LdeApprox_77.gif

Comparing exact and approximate results for LdeApprox_78.gif using Mathematica function Plot3D.

In[30]:=

LdeApprox_79.gif

Out[30]=

LdeApprox_80.gif

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.