page_128
file:///G|/%5EDoc%5E/_new_new/got/020349878X/files/page_128.html[22/02/2009 23:52:40]
< previous page page_128 next page >
Page 128
The computation was carried out with Maple which automatically performs all calculations symbolically
where possible and numerically otherwise. In this language the entire problem took no more
programming effort than writing the above mathematical expressions in Maple notation. To illustrate this
point we list below the entire Maple program leading to the graphs in Figure 6.4a, b.
> with (Linear Algebra): with (plots):
> lambda:=n->(2*n+1)*(Pi/2);
> phi:=(x,n)->sin(lambda(n)*x);
> g:=n->integrate(phi(x,n),x=0..1)/integrate(phi(x,n)^2,x=0..1);
> F:=(t,N,k)->k*add(–g(n)*integrate(exp((s–t)*lambda(n)^2)*
(s^(k–1)), s=0..t)* phi(1, n), n=0..N)+t^k;
> a:=(j,k)->integrate(F(t,N,k)*F(t,N,j),t=0..T);
> b:=j->integrate(B(t)*F(t,N,j),t=0..T);
> N:=10;K:=4;T:=1;
> B:=t->sin(Pi*t);
> AA:=evalf(Matrix(K,K,(j,k)->a(j,k)));
> RS:=evalf(Matrix(K,1,(j)->b(j)));
> COE:=LinearSolve(AA,RS);
> P:=t->add(COE[j, 1]*t^j,j=1..K);
> plot(P(t),t=0..1);
> PP:=t→add(j*COE[j,1]*t^(j−1),j=1..K);
> alpha:=(t,n)->−g(n)*integrate(PP(s)*exp(-(t-s)*
lambda(n)^2), s=0..t);
> u:=t->add(alpha(t,n)*phi(1,n),n=0..20)+P(t);
> p1:=plot(u(t),t=0..1):p2:=plot(B(t),t=0..1):
> display(p1, p2);
The above calculation yields a polynomial of degree
K
whose coefficients
cj
clearly depend on the
dimension of the subspace in which the solution
wN(x, t)
is found, i.e.,
cj=cj(N).
In order for the answer
to remain meaningful for the original problem, we would need a proof that
for constants
We do not have such a result but take assurance from numerical experiments that
show that
P
4
(t)
changes little for
N>
10.
Such a behavior cannot always be expected, and it may well be that a problem is solvable in the
subspace but that the answers diverge as For example, consider the following problem:
< previous page page_128 next page >