In order to solve a Physics problem, I have to model an axisymmetric well or pit on a plane. I am looking for a function $f(x)$ that is smooth and monotonic in the domain $(0,1)$, where the origin corresponds to the bottom of the pit $f(0)=-1$ and the pit meets the plane at 1 with $f(1)=0$. There are some necessary, must-have requirements:
- The first derivative of the function at $0^+$ must be zero
- The first and second derivatives of the function at $1^-$ must be zero
With these two requirements, I have come up with $$ f(x) = -\frac{1}{4} \left(1+\cos (\pi x) \right)^2 $$ See the plot in Wolfram Alpha
But ideally, I would like to have more control over the shape of the pit, especially I would like to
- Specify the second derivative of the function at $0^+$
- Have some kind of "transition lengthscale", meaning I can make it arbitrarily similar to a square-well, or on the other hand make it have a gentle rise.
Does anyone have any ideas? Thanks a lot.
The typical mathematician's way to do this is by the process of convolution with an approximate identity. The convolution of a function $f$ with another function $g$ is defined by $$ (f*g)(x) = \int_{-\infty}^\infty f(y)g(x-y)~dy = \int_{-\infty}^\infty f(x-y)g(y)~dy, $$ provided the above integrals are well defined, which they are as long as $f$ and $g$ satisfy some appropriate decay conditions. Certainly if $f$ and $g$ are zero outside of a bounded domain.
The reason to consider such a thing is that if you choose the proper $g$, then convolution with $g$ tends to provide a smooth approximation to $f$. For example, suppose $g$ has the properties
Then define $g^\epsilon(x) = \frac{1}{\epsilon}g(\frac{x}{\epsilon})$. Then for all piecewise continuous $f$ such that $\int_{-\infty}^\infty f(y)~dy < \infty$,
$$ (f*g^\epsilon)(x) \to f(x) $$ as $\epsilon\to 0$, and moreover $f*g^\epsilon$ is a smooth function. We call such $g$ an approximation to the identity, or a mollifier. There are many commonly used mollifiers; the standard mollifier $\eta$ can be found at http://en.wikipedia.org/wiki/Mollifier#Concrete_example.
So to construct your desired smooth well function, start with a piecewise continuous function $f$ that has the properties you desire. I suggest something like $$ f_\delta(x) = \begin{cases} 0 & x < \delta, x > 1-\delta\\ -1 & \delta \leq x \leq 1-\delta \end{cases} $$ where $\delta>0$ is a small real number. (This is just a square well from $\delta$ to $1-\delta$, and it has zero derivatives at $0$ and $1$.) Convolve with the standard mollifier to get $f_\delta * \eta^\epsilon$. Then this function is smooth, and for $\epsilon$ very small it will be an excellent approximation to $f_\delta$; in particular you can check it will have $zero$ derivatives at $0$ and $1$. You can vary the $\delta$ to vary the length of the well, or modify the function $f_\delta$ appropriately to better suit your exact purpose. The point is to find a function $f$ that does what you want, and use convolution to smooth it out.