Parametric plot of a cycle - transition between two lines - dealing with a jump I have the following problem. I am modelling a cycle that consist of "loading" and "unloading" parts.
Firstly, the material is being loaded from the origin on the "blue line", that is the simple linear function ( $y = 2x$ ), and then I would like to perform transition to the bottom orange line that represents "unloading" of the material (now it is the linear function $y = x$ ):

I created the following solution based just on the ratios of the linear coefficients,

but it is not accurate enough. I would like to have steeper transition between the blue and orange line. I tried to use $tanh$ function as suggested here but in my situation there is a jump between linear functions and I do not know how to overcome it.
Please, do you have any advices?
Thank you very much in advance!
EDIT:
I would like to get a curve, that comes from the origin to the point $[1;2]$, then I need some transition from the upper line to the bottom line (that I need to be steep enough, using hyperbolic tangens?) and from the point that is as close as possible to the point $[1;1]$ on the bottom line go back on the curve to the origin.
Actually, I have a solution (it is my black curve), but it is not precise enought. I would like to kindly ask if anybody knows some improvement of the transition...

 A: I will show you how to think about this type of problems. Let's start from $\tanh$ function:$$\tanh x=\frac{e^x-e^{-x}}{e^x+e^{-x}}$$
Notice that this function varies between $-1$ and $1$. I want to change it to vary from $0$ on the negative side. To do that, we add $1$. So $$\tanh x+1=\frac{2e^x}{e^x+e^{-x}}$$
The transition between $0$ and $2$ happens around $x=0$. So if we want the transition to happen at different $x$, you just need to change the variable. In this case replace $x$ with $x-1$. If you want to change the slope to be more steep, multiply $x-1$ with a large number $c$ (say $c=10$).
Now you have two choices to connect the curves. We start smoothly from the lower curve in both cases. You can approach smoothly with the upper curve, or you can just truncate the $\tanh$ function. It seems like in this case you go with the second option. So we choose to truncate our connecting function at $x=1$, where $$\tanh c(x-1)+1=1$$
Then you add to the $y=x$ this function multiplied by the gap between the curves at $x=1$. In this case the gap is $1$.
So the function you have is $$y=x+1\cdot(\tanh 10(x-1)+1)$$

A: Consider a function like
$$f(x) = \frac{e^{kx}-1}{e^k-1}$$
for some $k \in \Bbb R$. We have $f(0)=0$ and $f(1)=1$, and as $k$ increases, the curve flattens toward $y=0$, making an ever more abrupt vertical transition near $x=1$. It looks like this for $k=30$:
$\hskip 4cm$ 
Let's call your two bounding line segments $L$ and $M$, so $L(x) = 2x$ and $M(x) = x$. You can use a function like $f(x)$ to transition between $L$ and $M$ like so:
$$g(x) = f(x)L(x) + (1-f(x))M(x);$$
in other words, this is just a weighted average of $L$ and $M$, with the weight almost entirely on $M$ until we get close to $x=1$. Again with $k=30$, it looks like so:
$\hskip 4cm$ 
