I've been reading some resources on the web about Galerkin methods to solve PDEs, but I'm not clear about something. The following is my own account of what I have understood.
Consider the following boundary value problem (BVP):
$$L[u(x,y)]=0 \quad \text{on}\quad (x,y)\in\Omega, \qquad S[u]=0 \quad \text{on} \quad (x,y)\in\partial\Omega$$
where $L$ is a 2nd order linear differentiation operator, $\Omega\subset\mathbb{R}^2$ is the domain of the BVP, $\partial\Omega$ is the boundary of the domain, and $S$ is a 1st order linear differential operator. Expess $u(x,y)$ as an aproximation of the form:
$$u(x,y)\approx \sum_{i=1}^N a_i g_i(x,y)$$
where the $g_i$ are a set of functions that we will use to approximate $u$. Substituting in the BVP:
$$\sum_i a_i L[g_i(x,y)]=R(a_1,...,a_N,x,y)$$
Since our approximation is not exact, the residual $R$ is not exactly zero. In the Galerkin-Ritz-Raleigh method we minimize $R$ with respect to the set of approximating functions by requiring $\langle R,g_i \rangle = 0$. Hence
$$\langle R,g_i \rangle = \sum_{j=1}^N a_j \langle L[g_j],g_i \rangle = 0$$
Therefore, to find the coefficients $a_i$, we must solve the matrix equation:
$$\left( \begin{array}{ccc} \left\langle L\left[g_1\right],g_1\right\rangle & \ldots & \left\langle L\left[g_N\right],g_1\right\rangle \\ \ldots & \ldots & \ldots \\ \left\langle L\left[g_1\right],g_N\right\rangle & \ldots & \left\langle L\left[g_N\right],g_N\right\rangle \end{array} \right)\left( \begin{array}{c} a_1 \\ \ldots \\ a_N \end{array} \right)=0$$
My question is: How do I incorporate the boundary conditions into this?
EDIT: Originally the question said that $S[u]$ was a 2nd order linear differential operator. I changed it to a 1st order linear differential operator.
scicomp! Our policy on cross-posting follows that of other Stack Exchange sites. It is permissible to cross-post if you tailor the same question (more or less) to different audiences. It is permissible to ask your question to be migrated to another site after some time, if you feel that your question is not getting answered satisfactorily (or at all) on the site where it is initially posted. – Geoff Oxberry Feb 18 '12 at 02:27mathusers that answer your question are alsoscicompusers, they won't get proper credit or attribution for their answer here onscicompif you copy-paste it frommath, and vice versa. – Geoff Oxberry Feb 18 '12 at 02:33mathdoes NOT have a link here. If you had mentioned that you'd cross-posted on themathversion of this post, you'd probably hear a similar spiel from their users and mods. This question is on-topic and a better fit here, and I encourage you to delete the version onmath(even though it's a very good site) because the proportion of similar questions on this site will be larger than than proportion onmath. – Geoff Oxberry Feb 18 '12 at 02:37math, fewer of them are about numerical methods. Ultimately, it's your call, since it's your question. We have some users here who are really good PDE experts (disclaimer: I know some of them personally; again, biased). – Geoff Oxberry Feb 18 '12 at 02:56mathhas been deleted. Obviously you were right about keeping the question here. I have received very helpful responses. – a06e Feb 19 '12 at 16:09