Designing a Mathematical Function with Specific Criteria

66 Views Asked by At

I am currently working on a project that involves creating mathematical functions to meet specific criteria, and I am seeking guidance on designing functions that satisfy my requirements.

The criteria for the function are as follows:

  1. The function takes a single input and outputs a number within the range $(0, 1]$.
  2. The input range is $[5, 100]$.
  3. The function must be strictly increasing.
  4. A crucial requirement is that the function should exhibit a steeper slope in the initial range and gradually reduce its steepness as the input increases.

To illustrate, consider the example: if $x_1 = 5$ and $x_2 = 20$, where $x_2 = 4x_1$, the output of $x_1 = 5$ should be $\frac{1}{8}$th or $\frac{1}{10}$th of $x_2 = 20$. Similarly, for $x_3 = 20$ and $x_4 = 80$, where here also, $x_4=4x_3$, the output of $x_3 = 20$ should be $\frac{1}{3}$rd or $\frac{1}{4}$th of $x_4 = 80$. The objective is to have a larger steepness initially that diminishes as $x$ increases. I have attempted to formulate the following function:

$y = 1 - e^{-0.1x}$ for $x$ in $[5,100]$.

While this function exhibits some of the desired characteristics, I am seeking more accurate and reliable functions that meet the specified criteria.

Any suggestions or recommend alternative functions that align with these requirements?

2

There are 2 best solutions below

1
On

Procedure: Integrate a strictly decreasing non-negative function and then adjust the area accordingly.

For instance, start with $-x+100$. Then $\int_5^{100} f(t)\,dt=4512.5$ so define $$f(x)=\frac 1{4512.5}\times (-x+500)$$

Integration then gives you $$F(x)=\frac 1{4512.5}\times \left(-\frac {x^2}2+100(x-5)+\frac {25}2\right)$$

which does what you need. Modify $f(x)$ as you like. I note that, with my example, $F(5)=0$ which perhaps you didn't want. But you could drop the lower limit on the integral to $4.99$ (or whatever) to fix that.

0
On

I advise in such a case the use of Bezier functions to which you can give as many degrees of freedom you want. Of course, their natural expression is under a parametric form $x=x(t),y=y(t))$. In the case at hand, you have an initial point, say $A(5,0)$, an endpoint, say $C(10,1)$ (I don't take $(100,1)$) in order to have a not-to-elongated graphical representation), and an intermediate point $B(u,v)$ situated in the interior of rectangle $[5,10] \times [0,1]$.

Therefore, if you are a little familiar with these curves, their parametric representation is (please note the barycentric form) :

$$M=s^2 A + 2st B + t^2 C \ \text{with} \ s+t=1,$$

otherwise said :

$$\begin{cases}x(t)&=&5(1-t)^2+2at(1-t)+10t^2\\ y(t)&=&2bt(1-t)+t^2\end{cases} \ \text{with} \ 5 \le a \le 10, \ 0 \le b \le 1$$

And here are the resulting curves where we have taken separately variations on $a$ and $b$ :

enter image description here

Here is the Matlab program which has generated the previous figure :

    t=0:0.01:1;s=1-t;
    f=@(a,b,c)(plot(...
        5*s.^2+2*a*t.*s+10*t.^2,...
        2*b*t.*s+t.^2,...
        'color',c));
    b=0.8;
    for a=5:0.25:8;f(a,b,'r');end;
    a=7;
    for b=0.5:0.05:1;f(a,b,'b');end;