Partial Differential Equations PowerTool
by Dr. Jim Herod
Section 1.4: The Gramm-Schmidt Process
Maple Packages for Section 1.4
| > | restart; |
| > |
At this point, we should realize that having a set of orthogonal vectors {
,
,
, ... } is an important tool. We understand that we can convert these to an orthonormal set by dividing by the norm of each:
.
Such a conversion produces a set of orthonormal vectors: {
,
,
, ... }.
In the previous Section 1.3, we saw that the closest element in the span of some finite number of {
,
,
, ... } is
approximation for f =
,
where
= < f,
>.
To be sure the conversion to orthonormal vectors is not a problem, we say the redundant: we get the best approximation if the collection is orthogonal,
approximation for f =
,
choose
= < f,
>
/
.
This result about approximating functions is why Fourier Series is a topic of study for scientists and engineers.
Convinced that orthogonal families are important, we ask how they can be generated and since, as we have seen, there might be several orthogonal families in the same space, how can we know which ones to choose? Regarding the second question, there is good news: for many linear partial differential equations with boundary conditions, we do not have to choose the orthogonal family. It arises naturally with the problem. Concerning the first question, there are many ways to generate orthogonal families. In this section, we present one classical method known as the Gramm-Schmidt Process.
It is assumed that a linearly independent set
V
= {
, ... }
is given. The Gramm-Schmidt Process generates an orthogonal family {
,
,
, ... } having these properties:
(1) for each integer n, the generation of {
,
,
, ...,
} uses {
, ... ,
}, and
(2) for each n, the collection {
,
,
, ...,
}spans exactly the same subspace that {
, ... ,
} spans.
Below, we present the process and give an example. We generate an orthogonal family, not necessarily an orthonormal family. We begin with the linearly independent vectors as described in the set V and generate the orthogonal family.
The Gramm-Schmidt Process
Take
to be
.
=
.
Form
from
and
.
=
,
Form
from
,
, and
.
=
,
etc.
Question: Show that these three are orthogonal.
Indication of the Answer
We show that <
,
> = 0. We compute:
<
,
> = <
,
>
= <
,
> - <
,
> <
,
> / <
,
>
= 0
The remaining two dot products work similarly.
| > |
| > |
To illustrate these ideas, we choose a function in C([-1, 1]) and ask what cubic polynomial makes the best approximation, in the sense that the usual norm is as small as possible
An Example in C([-1,1])
We perform the Gramm Schmidt Process on the functions 1,
,
,
in C([-1,1]). Since we form the quotient
so many times, why not make that a special function of f and g? In this case, the dot product is an integral from -1 to 1. Thus, for convenience, we define a function of f and g that we will call P.
| > | P:=(f,g)->g(x)*int(f(t)*g(t),t=-1..1)/int(g(t)^2,t=-1..1); |
Next we define the functions
through
.
| > | v[0]:=x->1; v[1]:=x->x; v[2]:=x->x^2; v[3]:=x->x^3; |
| > | theta[0]:=v[0]; |
| > | form:=v[1](x)-P(v[1],theta[0]); theta[1]:=unapply(form,x); |
| > | form:=v[2](x)-P(v[2],theta[0]) -P(v[2],theta[1]); theta[2]:=unapply(form,x); |
| > | form:=v[3](x)-P(v[3],theta[0]) -P(v[3],theta[1]) -P(v[3],theta[2]); theta[3]:=unapply(form,x); |
Reality check that we did the Gramm Schmidt process correctly. Compute the dot product of each pair of the theta functions.
| > | int( theta[1](x)*theta[2](x), x=-1..1 ); int( theta[2](x)*theta[3](x), x=-1..1 ); int( theta[1](x)*theta[3](x), x=-1..1 ); |
We find the "best approximation" in C([-1, 1]) for the absolute value function with a polynomial of degree three. We follow these four steps.
STEP 1: Perform the Gramm Schmidt Process on 1,
,
,
.
We did that above. We got
| > | theta[0](x); theta[1](x); theta[2](x); theta[3](x); |
STEP 2: Form the Fourier coefficients.
| > | a[0]:=int(abs(t)*theta[0](t),t=-1..1)/int(theta[0](t)^2,t=-1..1); a[1]:=int(abs(t)*theta[1](t),t=-1..1)/int(theta[1](t)^2,t=-1..1); a[2]:=int(abs(t)*theta[2](t),t=-1..1)/int(theta[2](t)^2,t=-1..1); a[3]:=int(abs(t)*theta[3](t),t=-1..1)/int(theta[3](t)^2,t=-1..1); |
STEP 3: Write down the answer.
| > | approx:=x->sum(a[p]*theta[p](x),p=0..3); approx(x); |
You might like to see the graph of these two superimposed.
| > | plot([abs(x),approx(x)],x=-1..1); |
| > |
Unassisted Maple
Perhaps it is no surprise that Maple already knows these polynomials on [-1, 1]. After all, polynomial approximations for functions are commonly made. Here is how to access these in Maple. The routine we're interested in is called P . We form a listing of the first four for comparison with the ones we generated. These polynomials are called Legendre Polynomials .
| > | with( orthopoly ); |
Warning, the name P has been redefined
| > | theta[0](x);P(0,x); |
| > | theta[1](x);P(1,x); |
| > | theta[2](x);P(2,x); |
| > | theta[3](x);P(3,x); |
We see that Maple's listing of the Legendre Polynomials differs from our computations only by a constant factor. If we normalized both Maple's listing and ours we would have the same results.
| > |
| > |
EMAIL: herod@math.gatech.edu or jherod@tds.net
URL: http://www.math.gatech.edu/~herod
Copyright © 2003 by James V. Herod
All rights reserved