Approximation for weighted residuals


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

R(x)=A(u_N) - f ,

with the approximated solution


We want this residual to be zero in this sense:

\int_0^L \psi_i R(x) dx= 0.

Galerkin method

Similarly to the RR method, we take {\psi_j}={\phi_j}. 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 u_N indeed complies with all BCs. As in RR, \phi_0 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:

\sum_jA_{ij} c_j = F_i,


A_{ij}=\int\phi_i A(\phi_j),

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

F_i = \int \phi_i\left(f - A(\phi_0)\right).

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

  1. When all BCs are of the essential type. If only EBCs are present, the requirements on the {\phi_j} are the same in both methods, and the weighted-integral form reduces to the weak form.
  2. When the {\phi_j} 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:

\sum_jA_{ij} c_j = F_i,


A_{ij}=\int\psi_i A(\phi_j),

which looks even less symmetric than before. The vector is

F_i = \int \psi_i\left(f - A(\phi_0)\right).

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 A is linear, the coefficient matrix turns out to be symmetric in this case,

A_{ij}=\int A(\phi_i)A(\phi_j).

While the vector is

F_i = \int A(\phi_i)\left(f - A(\phi_0)\right).

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:



Let’s consider the case


Actually, we will take a=c=1, so


We will make f(x)=-x^2, and take the BCs:

u(0)=0 \qquad u'(1)=1

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

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

\phi_0(0)=0 \qquad \phi_0'(1)=1.

We can just take \phi_0=x, then.

The rest have to satisfy the homogeneous BCs:


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

\phi_1=-x(2-x)\qquad \phi_2=x^2(1-\frac{2}{3}x).

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 \phi_0.


In this case, we want:



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

\psi_1=x\qquad \psi_2=x^2.



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

Least squares Galerkin

In this case the weight functions are given by

\psi_1=\frac{\partial R}{\partial c_1}=2-x(2-x).




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

R(1/3)=0\qquad R(2/3)=0.


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! 😀



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s