Question: Computing Error in Eigenfunction expansion

I have computed the eigenfunction expansion for f(x)=x on 0<x<1 in terms of the eigenfunctions exp(-x/2)*sin(n*Pi*x).

I wish to calculate the weighted L2 error in this expansion (the weight function is w(x)=exp(x)).

Specifically, I want to determine how many terms in the eigenfunction expansion are necessary for the error to be less than say 0.3.

Here is the code:

f := x -> x
w := x -> exp(x)
assume('n', integer);
y :=  (n, x) -> exp(-x/2) sin(n Pi x)       
c := n-> (int(f(x)*y(n, x)*w(x), x = 0 .. 1))/(int(y(n, x)^2*w(x), x = 0 .. 1))
Fourierf := (n, x) -> sum(c(j)*y(j, x), j = 1 .. n)

fsolve(Lerror(n) = 0.3, n);

This seems to run forever without giving a value of n.  I know this is a large computation, but it seems that Maple should be able to handle it.  Does anyone have any suggestions?

Heather

 

Please Wait...