# How to smooth second derivative of selected mesh?

I have a mesh that I want to smooth by minimizing the second derivative of it, while taking into account non-selected vertices (for the edge condition of this derivative).

For example, let the following be a 1-Dimensional line of connected vertices (connected left to right):

      .       .
.       .


Where the last two are NOT selected. They determine the slope at the end though. So, after smoothing 100% (only changing the vertical coordinate here) the result should look like:

              .
.
.
.


where the second derivative has been reduced to zero.

Of course, for a 2D mesh the mathematics are a lot more complex and you need an edge condition on all sides; but hopefully you get the picture.