# The method of weighted residuals

### Intro

One can write a general differential equation as:

$A(u)=f(x)$

An example, which we will often consider is

ex. $A(u)=-\frac{d}{dx}\left( a(x)\frac{d u }{dx}\right),$

to model e.g. heat conduction with a space-dependent heat conduction coefficient $a(x)$ and a heat production term $f(x)$. (Notice the “ex” when we are talking about a particular example.)

On top of that we of course need boundary conditions, Neumann, Dirichlet, Robin… In our case we will consider

ex. $u(x=0) =u_0\qquad\left(a(x)\frac{du}{dx}\right)_{x=L}=Q_0.$

### Approximation

The method of weighed residuals proceeds as follows: approximate the solution $u$ by a linear combination of $N+1$ approximation functions (aka solution functions) ${\phi_j}$:

$u_N=\sum_{j=1}^Nc_j\phi_j+\phi_0.$

(The last term is introduced for convenience when dealing with boundary conditions, see below).

Of course, this approximation is not a solution of the original equation in general, so introduce the residual:

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

### “Zero” residual

Now, this residual is not zero in general, but we can make it zero in a weighted residual sense:

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

where we introduce $N$ weight functions (aka test functions) ${\psi_j}$.

Now, different choices for the weight functions result in different methods:

• ${\psi_j}={\phi_j}$: Galerkin method. The residual is “spat out” of the functional space: it is made orthogonal to it. A similar idea to Tsebitchev polynomials…
• The least-squares Galerkin method.
• The collocation method.

### Boundary conditions

Since we lack a weak form of our problem, all boundary conditions (BCs) must be taken into account by the solution functions (we no longer distinguish natural and essential ones). It is often very convenient to split this task:

• $\phi_0$ is to satisfy the actual BCs.
• All the other $\phi_i$ are to satisfy homogeneous BCs.