Boundary conditions for weight function in weak form of an ODE or PDE

boundary value problemordinary differential equationspartial differential equations

I am really quite confused by how to pick a weight function's boundary conditions when evaluating the weak form of a differential equation.

For example, given this ODE in the domain $0<x<1$:
$$u'''' + \frac{2}{x} u''' = 0$$
where $u(0) = u(1) = 0$ (Dirichlet BCs) and $u'(0) = u'(1) = 0$ (Neumann BCs), we pick a weight function $w(x)$ with the exact same Dirichlet and Neumann BCs, i.e. $w(0) = w(1) = w'(0) = w'(1) = 0$, such that the boundary terms from subsequent IBP all vanish.

However, when given this ODE in the domain $-1<x<1$:
$$xu''+2u'+2u = 0$$ with $u(1) = 0$ and $u(-1) = -2$, we instead pick an arbitrary weight function such that $w(1) = w(-1) = 0$ (not the same as the Dirichlet BCs of $u$) such that the boundary term from the subsequent IBP vanishes.

Lastly, given Poisson's equation (a PDE):
$$- \nabla^2u = f$$
with $$
\begin{aligned}
u=0 & \text { on } S_g, \\
\nabla u \cdot \boldsymbol{n}=h & \text { on } S_h,
\end{aligned}
$$

where$S_g$ and $S_h$ cover the entire boundary but do not overlap, the weight function we pick is 0 on $S_g$ (i.e. same Dirichlet BC but not the same Neumann BC).

This leaves us with the following weak form:
$$
\int_V \nabla w \cdot \nabla u d V=\int_V w f d V+\int_{S_h} w h d S
$$

where now the boundary term from IBP hasn't fully vanished (since we only picked $w=0$ on $S_g$ and not $S$ entirely).

So I can't seem to figure out how to pick the boundary conditions of the weight function $w$. E.g. in the case of the two ODEs I described, we pick the BCs of $w$ such that the boundary terms from IBP vanish (i.e. are equal to 0). Whereas with the PDE, the weight function we pick has boundary conditions such that the boundary term (surface integral) doesn't vanish.

Is there a different approach to ODEs and PDEs?

I would very much appreciate someone describing the general rules to follow with regards to the boundary conditions of $w$.

Best Answer

In your first problem, integrate by parts until the same number of derivatives of $u$ and $w$ appear. (This does not always happen in the setting of PDE but it is a good heuristic to lean on before you have encountered more subtle situations.) Then these boundary terms will die irrespective of what $u$ is if $w$ and $w'$ vanish on the boundary, so you impose that and let $w$ otherwise be arbitrary. That last remark is important: the more boundary conditions you impose on $w$, the less your weak formulation pins down the solution, so you want to impose as few of those as you can. If you impose too many, you may lose uniqueness when you didn't need to do so.

In your second problem, you do the same thing, and now again the boundary terms die irrespective of what $u$ is if $w$ vanishes on the boundary.

In your third problem, you do the same thing, and now you can bake the Neumann BC into the equation (replacing the flux with what it would be if $u$ satisfied the BC). You can do that instead of just killing the term by imposing an additional BC onto $w$. One benefit of this is that you don't need as many boundary derivatives of $u$ to exist, which means you demand less regularity of the solution and even of the given boundary data. Another benefit is that you again impose fewer BCs on $w$, which sets you up better to get a unique solution.

Related Question