Equation for a Smooth Staircase Function – Functions

functions

I am looking for a smooth staircase equation $f(h,w,x)$ that is a function of the step height $h$, step width $w$ in the range $x$.

I cannot use the unit step or other similar functions since they are just one step. I have been experimenting with various sigmoid curves and while I can get a single smooth step I cannot get to realize the staircase shape. The closest staircase function I have found is given in this paper in equation (18) and depicted in Fig. 4 and it is a close example of what I want (i.e generate a staircase in the range $x$ for arbitrary step heights and widths) but it is not smooth at all.

Regarding smooth steps, a likely starting point I found is here but it gives a smooth function of just a single step. I have been unable to modify the equation to make it into a staircase. I would like to specify arbitrary step heights and widths and generate a smooth staircase in the range $x$ specified.

Edit (Extra info):
The smooth function I mention above has the problem that the upper, horizontal line is not equal in length to the lower, horizontal line which is why I have been unable to adapt it into a staircase function

Edit 2
Including some pictures
What I'm getting
Desired function

Edit 2
Plot of $s$ with a steep slope showing a different width on the first horizontal line
enter image description here

Best Answer

We can start with a simple soft staircase function:

$$ f(x) = x - sin \space x $$

and then feed it into itself:

$$ y(x) = f(f(x)) $$

then again:

$$ y(x) = f(f(f(x))) $$

and again:

$$ y(x) = f^4(x) $$

As you can see, each iteration makes the "flat" part of the step longer, and the rise steeper.

enter image description here enter image description here enter image description here enter image description here

The period and the height of each step is $ 2 \pi $, so multiply $x$ by $2 \pi / w$ and $y$ by $h / 2 \pi$ to reach your desired scale.

In reality, the curve is only truly flat (zero derivative) at the centre of each step — at every $ 2 \pi k $ — and only close to flat on either side of that point.

Configurability is limited: The softness of the step can only be specified in integer amounts (the number of times we reapply $f$ to itself), and it requires many/infinite applications to make the step really sharp.

Related Question