So far, we have generally sought to obtain an approximate solution, uN, by requiring that the residual RN vanishes in a certain way. Imposing boundary conditions is then done by special choice of the basis, as in the Galerkin method, or by imposing the boundary conditions strongly, i.e., exactly, as in the collocation method.
For the Galerkin method, this causes problems for more complex boundary conditions as one is required to indentify a suitable basis. This is partially overcome in the collocation method, in particular if we have collocation points at the boundary points, although imposing more general boundary operators is also somewhat complex in this approach.Adownside of the collocation method is, however, the complexity often associated with establishing stability of the resulting schemes.
These difficulties are often caused by the requirement of having to impose the boundary conditions exactly. However, as we have already seen, this can be circumvented by the use of the penalty method in which the boundary condition is added later. Thus, the construction of uN and RN are done independently, e.g., we do not need to use the same points to construct uN and to require RN to vanish at.
This expansion of the basic formulation highlights the individual importance of how to approximate the solution, enabling accuracy, and how to satisfy the equations, which accounts for stability, and enables new families of schemes, e.g., stable spectral methods on general grids.