Numerical polynomial approximation of an LDE solution

Copyright © 2004-2012  DigiArea, Inc. . All rights reserved.

Description:

This worksheet illustrates ©LdeApprox ©package capability of doing numerical polynomial approximation of an LDE solution. First of all we load the package and define an IVP. Then ©we use ApproxSol procedure to find 5-th degree polynomial approximation for the IVP solution on interval x = [0,1]. After that we find exact solution by Maple™ procedure dsolve . Finally we compare exact and approximate results using Maple™ procedures plot .

This loads the package.

restart:
with(LdeApprox):

Example

Initial value problem

ivp:={diff(y(x),x,x) = -y(x) - 2*x*diff(y(x),x), y(0) = 0, D(y)(0) = 1};

ivp := {y(0) = 0, D(y)(0) = 1, diff(y(x),`$`(x,2)) = -y(x)-2*x*diff(y(x),x)}

Finding polynomial approximation for solution of the IVP.

apr:=ApproxSol(ivp,y(x),x=0..1, 5);

apr := y(x) = 5802888/162557926871+162140696512/162557926871*x+4855352320/162557926871*x^2-101738521600/162557926871*x^3+112928757760/487673780613*x^4+694837248/162557926871*x^5
apr := y(x) = 5802888/162557926871+162140696512/162557926871*x+4855352320/162557926871*x^2-101738521600/162557926871*x^3+112928757760/487673780613*x^4+694837248/162557926871*x^5

The exact solution is as follows.

sol:=dsolve(ivp,y(x));

sol := y(x) = 1/2*Pi/GAMMA(3/4)*exp(-1/2*x^2)*x^(1/2)*BesselI(1/4,1/2*x^2)

Comparing exact and approximate results.

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

[Maple Plot]

Note:

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