I am looking for a $\mathcal{C}^\infty$ periodic function $f: [0,\ 2\pi]\rightarrow [-1,\ 1]$ with the following properties, for an arbitrary $\epsilon \in \mathbb{R}^+$:
- $f(0) = -\epsilon$, $f'(0)=0$
- $f(\frac{\pi}{4})=-1$, $f'(\frac{\pi}{4})=0$
- $f(\frac{\pi}{2})=0$
- $f(\frac{3\pi}{2})=1$, $f'(\frac{3\pi}{2})=0$
- $f(\pi)=\epsilon$, $f'(\pi)=0$
- then it is symmetric with respect to vertical axis $(x=\pi)$
I have been looking for functions of the form $\sum_{i}a_i \sin(\omega_i t + \phi_i)$ with no success (up to i=4 with Mathematica struggling), but I'm not sure where to stop the search in this direction.
Is there a better way to search?
Put $$ \phi(x) = \begin{cases} e^{-1/x}, & x>0,\\ 0, & x\leq 0 \end{cases}, $$ which is well known to be smooth. Then $$ \psi(x) = \frac{\phi(x)}{\phi(1-x)+\phi(x)}$$ satisfies $\psi(x)=0$ for $x \leq 0$, and $\psi(x) = 1$ for $x \geq 1$, and has a smooth transition from $\phi(0)=0$ to $\phi(1)=1$ through the interval $[0,1]$. In particular, $\psi'=0$ both at $0$ and $1$.
You can rescale the range and the transition interval of $\psi$ to fit your purposes, and define your $f$ piecewise using these constructions.
See also this article.