#### Intro

We ended up the article about weighted residuals pointing out three possible approaches to the problem. We expand them here.

#### The problem

The residual is

with the approximated solution

We want this residual to be zero in this sense:

#### Galerkin method

Similarly to the RR method, we take . The residual is therefore “spat out” of the functional space: it is made orthogonal to it. A similar idea to Chebyshev interpolation.

It is therefore important to point out in which way this method differs from the RR one. We **do not** begin from a weak version of the equation. This means the functions are not in general “weaker” (less differentiable) than in the original differential equation. Also, we lack the embedded information from boundary conditions (NBCs, to be precise) in the weak form, so we must make sure indeed complies with all BCs. As in RR, is used for the non-homogeneous BCs, but all of them (N and E BCs) in this case, while the rest satisfy homogeneous BCs.

The linear algebra problem for the Galerkin method is:

with

which of course doesn’t have to be symmetric in general. The vector is

**However**, the Galerkin method coincides with the RR method in two cases:

- When all BCs are of the essential type. If only EBCs are present, the requirements on the are the same in both methods, and the weighted-integral form reduces to the weak form.
- When the from the Galerkin method are used for a RR method (not the inverse!).

#### Petrov-Galerkin method

In this case the two functional spaces are different. The linear algebra problem is then:

with

which looks even less symmetric than before. The vector is

There is clearly much leeway in how to proceed in this case.

#### Least-squares Galerkin method

The parameters are determined such that the integral of the square of the residual (its 2-norm) is minimized. If is linear, the coefficient matrix turns out to be symmetric in this case,

While the vector is

#### Collocation method

The residual is set to be zero at selected points along the domain. This is equivalent to setting the weight functions equal to Dirac delta functions at the selected points:

#### Example

Let’s consider the case

Actually, we will take , so

We will make , and take the BCs:

This is exactly the “Set 2 problem” in The Rayleigh-Ritz method.

Now, we employ the first function to comply with the actual BCs:

We can just take , then.

The rest have to satisfy the homogeneous BCs:

We will only introduce two of these, which can be taken as

They cannot be of linear and comply with the homogeneous BCs. Also, the second one lacks a linear term, but that’s fine since the set is complete for polynomials up to cubic. Now the residual can be computed to be

The last *x* is the contribution from .

#### Galerkin

In this case, we want:

#### Petrov-Galerkin

We are free to choose other two weight functions. E.g.:

Hence:

with the best results of all these methods (!).

#### Least squares Galerkin

In this case the weight functions are given by

.

Similarly,

.

#### Collocation

We may choose two points at which the residual will be zero. If we set them at 1/3 and 2/3, then our equations are simply

.

#### Results

One should compare graphically these four results, the RR result, and the exact solution (see The Rayleigh-Ritz method for the two later). Someone gets us an intern!😀

#### Refs

*An Introduction to the Finite Element Method*, J. Reddy. McGraw-Hill; 3 edition (January 11, 2005).**ISBN-10:**0072466855. At amazon (167 bucks!).- Petrov-Galerkin_method at wikipedia. (Not to be trusted so much!)
- Method of mean weighted residuals at wikipedia
- Galerkin method at wikipedia
- Weak formulation of boundary value problems.
- The Rayleigh-Ritz method