How to come up with a function to match these conditions 
As shown in the graph, the goal is to find a function which satisfy the following conditions:


*

*Go through $(y_0,b)$

*Go through $(y_D,a)$, be at least first-order continuous at this point

*The slope around $x=y_0$ is close to $-D$ (approximately linear)

*Except at $y_D$, the function is smooth in the range (0,0.5).

*Beyond $x=y_D$, the function is constantly $a$.

*The function is always greater or equal $a$ in the range above.

*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$.
 A: What about the function
\begin{equation}
f(x)=a+\left( b-a \right)\exp\left( -\frac{D\left( y_D-y_0 \right)}{b-a}\frac{x-y_0}{y_D-x} \right)
\end{equation} 
for $x<y_D$ and $f(x)=a$ for $x\geq y_D$? Indeed,


*

*OK as the function you propose

*OK if $b>a$, $y_D>y_0$. The function has an horizontal tangent at this point.

*The derivative of the function is
$$ f'(x)=-D\left( \frac{y_D-y_0}{y_D-x} \right)^2\exp\left( -\frac{D\left( y_D-y_0 \right)}{b-a}\frac{x-y_0}{y_D-x} \right)$$
thus $f'(y_0)=-D$.\

*The function is smooth for $x\in\mathbb{R^+}$

*OK

*OK

*OK: from the expression given above, $f'(x)<0$ 


A plot for the set of parameters $a=0.4,b=1,D=20,y_0=0.02,y_D=0.2$ is given below.

A: 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.
