Field variations at boundary - Glass of water problem My question is very simple: if I have a vector field $\boldsymbol{\phi}(t,\boldsymbol{x})$ defined inside an $n$-dimensional manifold $\mathcal{M}_n$ to which $\boldsymbol{x}$ belongs, why should it be $\boldsymbol{\phi}(t,\partial\mathcal{M}_n)=0$? What I mean with this abuse of notation is, why should the variation of a field be null at the spatial boundaries of a system?
I read for example this, but didn't help. I imagined a very simple system:
Consider a glass of water. I take the height of the surface point by point in every temporal instant and I compare the measure with a reference; I so obtain a field $h(t,\boldsymbol{x})$ that associates an height $h$ to every point $\boldsymbol{x}$ of the bidimensional surface for every time instant.
But if I want to describe the temporal evolution of the perturbed water surface I (apparently) cannot consider $h(t,\partial\mathcal{M}_2)=0$, because water it's free to move at the boundaries: just take a glass of water and prove it! At the same time, just outside the boundaries the problem is not defined, so I don't get the passage from physics to strict mathematics.
So, is it possible to define problems with $\boldsymbol{\phi}(t,\boldsymbol{x})\neq 0$ for some $\boldsymbol{x}\in\partial\mathcal{M}_n$, or it's not? What would happen in the glass of water problem?
 A: *

*FWIW, Dirichlet boundary conditions (BCs) are not the only type of BCs. There are also e.g. Neumann or Robin BCs. The relevant BCs depends on the physical system at hand. This is true even if no variational formulation exists.


*In the context of a variational problem, say a stationary action formulation, if the Lagrangian depends on spacetime derivatives of the fields, it is necessary to impose essential or natural BCs, such that the functional/variational derivatives exist. Or equivalently, such that Euler-Lagrange (EL) equations can be derived.
A: Let's consider a simpler problem: the vibrations of a string. We will describe it with the following Lagrangian density
$$\mathscr{L} = \frac{1}{2}\partial_a\phi\partial^a\phi\,.$$
The equation of motion is
$$0 = \partial_t^2\phi - \partial_x^2\phi\,.$$
The solution of this equation is any function of the form
$$\phi = f(t + x) + g(t - x)\,.$$
We must now choose boundary conditions to determine the physical set of functions $f$ and $g$. One possibility, as you point out, is that $\phi$ must be zero on the boundary. In this case, the solutions are standing waves. Another possibility is periodic boundary conditions, so that $\phi(0) = \phi(L)$ where $L$ is the physical extent of the system. Another common choice is that the first spatial derivative of $\phi$ is zero on the boundary. This sets the momentum transfer into the boundary to zero while still allowing the ends of the string to move.
I will now provide the general solution to the wave equation in each of these three scenarios. First, if the string is fixed on the boundary,
$$\phi = \sum_{n = -\infty}^\infty a_n \sin\left(\frac{\pi n x}{L}\right)\sin\left(\frac{\pi n t}{L} + \delta_n\right)\,.$$
Second, periodic boundary conditions
$$\phi = \sum_{n = -\infty}^\infty a_n \sin\left(\pi n\frac{x - t}{L} + \delta_n\right)\,.$$
Third, first derivative set to zero on the boundary
$$\phi = \sum_{n = -\infty}^\infty a_n \cos\left(\frac{\pi n x}{L}\right)\sin\left(\frac{\pi n t}{L} + \delta_n\right)\,.$$
Here $a_n$ are arbitrary constant coefficients, determined at some initial time.
Ultimately, the point is that you have the freedom to choose whatever boundary conditions you like, so long as they leave no residual freedom. For example, I could mix boundary condition types by saying the left end of the string must be fixed while the right end of the string must have zero first derivative. However, I could not fix one end of the string while leaving the other end "free."
