Digi Area Group - Math Tools for Professionals
   Maple and Mathematica packages - math tools for professionals

LdeApprox™  - analytical approximation methods for Maple™

> Features List & Examples
> Screenshots
> Documentation & Downloads
> License & Pricing
> Buy Online

 
 
 
 
Google

Description  |  Features List & Examples  |  Introduction  |  Analitical approximations  |  Ref. Manual PDF (2M)

LDE with non polynomial coefficients

Copyright © 2004-2009  DigiArea Group . All rights reserved.

Description:

This worksheet illustrates  LdeApprox  package capability of doing numerical 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 numapprox[minimax]  procedure 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 numapprox  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 Maple™ procedure dsolve . Finally we compare exact and approximate results using Maple™ procedure plot .

This loads the package.

restart:
with(LdeApprox):

Examples:

This is a simple LDE with some non-polynomial coefficients.

lde:=diff(y(x),x)+erf(x)*y(x)=0;

lde := diff(y(x),x)+erf(x)*y(x) = 0

Trying to find approximate solution of the IVP (an erroroccurs as the LDE has non polynomial coefficients).

apr = ApproxSol({lde, y(0) = 1}, y(x), x=-1..1, 9);


Error, (in LdeApprox/ivp) erf(x) is not a polynomial on x


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

lde1 := ToRatCoeffs(lde, y(x), x=-1..1, 9);

lde1 := (-.1801193855e-10+(1.128373221+(.936614810e-10+(-.3760042623+(-.6043134633e-9+(.1121314427+(.1645036543e-8+(-.2517224681e-1+(-.1160467510e-8+.3373170972e-2*x)*x)*x)*x)*x)*x)*x)*x)*x)*y(x)+diff(...
lde1 := (-.1801193855e-10+(1.128373221+(.936614810e-10+(-.3760042623+(-.6043134633e-9+(.1121314427+(.1645036543e-8+(-.2517224681e-1+(-.1160467510e-8+.3373170972e-2*x)*x)*x)*x)*x)*x)*x)*x)*x)*y(x)+diff(...
lde1 := (-.1801193855e-10+(1.128373221+(.936614810e-10+(-.3760042623+(-.6043134633e-9+(.1121314427+(.1645036543e-8+(-.2517224681e-1+(-.1160467510e-8+.3373170972e-2*x)*x)*x)*x)*x)*x)*x)*x)*x)*y(x)+diff(...
lde1 := (-.1801193855e-10+(1.128373221+(.936614810e-10+(-.3760042623+(-.6043134633e-9+(.1121314427+(.1645036543e-8+(-.2517224681e-1+(-.1160467510e-8+.3373170972e-2*x)*x)*x)*x)*x)*x)*x)*x)*x)*y(x)+diff(...

Trying ApproxSol for the new approximate LDE.

apr := ApproxSol({lde1, y(0) = 1}, y(x), x=-1..1, 9);

apr := y(x) = .9999890597+.1751989801e-10*x-.5636204260*x^2-.3094800123e-10*x^3+.2483516267*x^4+.7957121989e-10*x^5-.8692165164e-1*x^6-.1471441464e-9*x^7+.1725316267e-1*x^8+.8201657434e-10*x^9
apr := y(x) = .9999890597+.1751989801e-10*x-.5636204260*x^2-.3094800123e-10*x^3+.2483516267*x^4+.7957121989e-10*x^5-.8692165164e-1*x^6-.1471441464e-9*x^7+.1725316267e-1*x^8+.8201657434e-10*x^9
apr := y(x) = .9999890597+.1751989801e-10*x-.5636204260*x^2-.3094800123e-10*x^3+.2483516267*x^4+.7957121989e-10*x^5-.8692165164e-1*x^6-.1471441464e-9*x^7+.1725316267e-1*x^8+.8201657434e-10*x^9

The exact solution of the IVP is as follows:

sol:=dsolve({lde, y(0) = 1},y(x));

sol := y(x) = exp(1/(Pi^(1/2)))*exp(-(x*erf(x)*Pi^(1/2)+exp(-x^2))/Pi^(1/2))

Comparing the results.

plot(subs(sol,y(x))-subs(apr,y(x)),x=-1..1);

[Maple Plot]

Note

We use quite simple example (just for Web). You can try more complex examples in your computer.