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

