fully customizable periodic function?

132 Views Asked by At

I am looking for a bell-shaped periodic function f(x) with parameters a and b, with following characteristics: ( not sure if such function already exists or one can formulate one ) :

  • oscillating between zero and a constant non-negative number A.
  • Width of bell can be modified through parameter b.
  • customizable period of c.
  • Preferably easy to calculate its integral

Obviously such function should look like a spike with lower b numbers and conversely turn into square-like with larger b. I tried playing with Gaussian and normal distribution, it satisfies the first two requirements but fails to drop to zero at periodicals of x = c. something like the picture below

any suggestions highly appreciated !

enter image description here

2

There are 2 best solutions below

6
On BEST ANSWER

Try $$ f(x)=Ae^{-\frac{(\ln2)\left(\tan^n \frac{\pi x}{c}\right)}{\tan^n \frac{\pi b}{c}}} $$ for a proper value of $n$ (say, $n=10$).

0
On

Here is a possibility with three parameters, with $t\ge \frac{1}{2}, a,b \ge 0$:

$$f\left(x\right)=\frac{a}{\left(1-t\right)e^{-\tan^{2}\left(\frac{x}{b}\right)}+te^{\tan^{2}\left(\frac{x}{b}\right)}} $$ Periodic Bell type curve

Link to Desmos animation