How to come up with a function to match these conditions

91 Views Asked by At

enter image description here

As shown in the graph, the goal is to find a function which satisfy the following conditions:

  1. Go through $(y_0,b)$
  2. Go through $(y_D,a)$, be at least first-order continuous at this point
  3. The slope around $x=y_0$ is close to $-D$ (approximately linear)
  4. Except at $y_D$, the function is smooth in the range (0,0.5).
  5. Beyond $x=y_D$, the function is constantly $a$.
  6. The function is always greater or equal $a$ in the range above.
  7. The function must be monotonically decreasing.

(The graph I included is a good representation of what the function should look like.)

(Note that D might be large enough so that a straight line crossing (y0,b) with slope $-D$ will be beneath $a$ at $y_D$.)

The answer can be either analytical or numerical.

For now, I have a proposed candidate: \begin{equation} f(x)=a+(b-a) \cdot e^{-D\cdot(x-y_0)}\cdot(\frac{b\cdot y_D}{y_D-y_0}-\frac{b}{y_D-y_0}\cdot x) \end{equation}

The problem with this function is that at $y_0$ the slope is not quite close to $-D$, and it is quite sensitive to other parameters, such as $a$ and $y_D$.

1

There are 1 best solutions below

1
On

For suitable $h(x)$ let $$ f(x)=\frac{h(\frac{2x-y_D-y_0}{y_D-y_0})\cdot a + h(-\frac{2x-y_D-y_0}{y_D-y_0})\cdot(b-D(x-y_0))}{h(\frac{2x-y_D-y_0}{y_D-y_0})+h(-\frac{2x-y_D-y_0}{y_D-y_0})}.$$ This makes $f(x)\approx a$ if $h(\frac{2x-y_D-y_0}{y_D-y_0})\gg h(-\frac{2x-y_D-y_0}{y_D-y_0})$ and $f(x)\approx b-D(x-y_0)$ if $h(\frac{2x-y_D-y_0}{y_D-y_0})\ll h(-\frac{2x-y_D-y_0}{y_D-y_0})$. Basically, we want $h(t)\gg h(-t)$ for $t\ge \frac12$. So $h(t)=e^{kt}$ for $k\gg 0$ should be fine.