Monotonic increasing function with constraints

110 Views Asked by At

I am looking for examples of monotonically increasing functions f(x) which can satisfy the following constraints:

  • f(x=0) should be 0 and f(x>=25) should be 1.
  • I want one or more parameters in the function to control the slope of the function.

The range of x is from 0 to 50.

I was thinking of tanh functions of the form - tanh(alpha*x -beta) for monotonically increasing functions, where alpha and beta are the parameters of the function. But I don't know how to incorporate my constraint f(x=0) should be 0 and f(x>=25) should be 100.

Can you please help me with some examples of monotonically increasing functions which can satisfy my requirements?

Many thanks for your time and help!

1

There are 1 best solutions below

6
On BEST ANSWER

You have several options. You can use a function like $\min$. So let's start as you did, with $f(x)=\tanh(x/c)$, where $c$ is a parameter to control the slope. We want to change this, so that $f(25)=1$. You need to multiply by a factor, so it will look like $$f(x)=\frac{\tanh(x/c)}{\tanh(25/c)}$$ This $f(x)$ is greater than $1$. So you need to change it to $1$ for $x\ge 25$. You can do this with $\min$: $$f(x)=\min\left(\frac{\tanh(x/c)}{\tanh(25/c)},1\right)$$ Alternatively, you can define the function piecewise, where you explicitly set the value to $1$ as $x\ge 25$. This one is more versatile, since you can choose any function in [0,25] that obeys your criteria. You can impose restrictions on the derivative at $0$ and $25$ for example.