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. $\endgroup$math
users that answer your question are alsoscicomp
users, they won't get proper credit or attribution for their answer here onscicomp
if you copy-paste it frommath
, and vice versa. $\endgroup$math
has been deleted. Obviously you were right about keeping the question here. I have received very helpful responses. $\endgroup$