# Neumann condition and Dirichlet condition at the same point

I am studying heat equation on a 1-D bar. We now that Neumann conditions at both ends leads to a singular matrix (for finite element methods) in equilibrium. Adding an initial condition can lead to unique solution.

It turns out that if we add a Dirichlet boundary condition in equilibrium at one end, we can still have a unique solution (at least when $u_x(0)=u_x(1)=u(1)=0$ and $\int_0^1f(x)dx=0$).

My question is: does it make sense to have both insulated boundary and prescribed temperature at the same end in the real world? How can one simultaneously maintain insulation and constant temperature?

This question might be asked in physics SE, but since I met this problem from a math textbook, I decide to ask it here.

When it comes to the physics of imposing these boundary conditions, there are two different ways to ask this question:

• Is it possible to have a physical scenario in which the boundary satisfies both conditions? The answer is yes.

• Can you physically enforce those conditions by doing something locally only at the boundary point? The answer is no.

To understand why, first note that problems with this type of boundary conditions have mathematical solutions (as pointed out by Nemo in their comment). So a physical controller that is supposed to impose the boundary condition can simply solve the equation with the given boundary condition, look at the solution to see what standard initial and boundary conditions are satisfied by the solution, and impose those standard conditions. The solution would automatically satisfy the originally intended (nonstandard) boundary conditions.

So why can't this be done locally by only acting on a point? The only nob that we have to locally control the boundary conditions is to control the heat flow. That gives you the control of one variable per point. The other variables at that point would be determined by the coupling to the neighboring points (the coupling is the spatial derivative in the equation). If you put enough heat to that point to keep it at a given temperature, the temperature of the neighboring points determines the derivative of the temperature at that point. If you put enough heat to control the derivative, you lose control of the temperature.

So let me answer the question:

• How can one simultaneously maintain insulation and constant temperature?

You can fix the temperature at that point, and make sure the derivate is also zero at that point by manipulating the initial and the other boundary condition. Setting the derivate to zero is not achieved by insulation, but rather by setting up the initial condition and control on the other boundary such that the heat flow through the boundary point happens to become zero.

applying Dirichlet boundary conditions will override your Neumann boundary conditions in the case of the finite element method (I give this as an example, as you mentioned FEM in your question). Dirichlet and Neumann boundaries should not overlap.

When you impose a prescribed temperature, you are also imposing a heat flux, although implicitly. As you can imagine, that heat flux is directly related to the prescribed temperature and the temperature inside your bar. Given a prescribed temperature, you have a prescribed heat flux (one-to-one relation).

So, to answer your question, in the real world, it does not make sense to impose both, as they are not independent one from another.