Modify fit or function to match certain values I have following values:
x = [0, 12.5, 25, 50, 75, 87.5, 100]
y = [0.0, 0.2, 0.31, 0.5, 0.66, 0.76, 1.0]

These values represent display values from a device that provides something like a charging status. My problem is that the display (which is a mechanical hand) is not providing the correct values. When everything is correct, it should be a straight linear curve (x against x). But what I see is y against x.
What I would like to do: How can I create a function that takes into account these values and provides the correct valuse I would like to have?
My idea is: Fit the measured values and create a function which shifts the data points such that they ly on a straight line, finally.
Does that make sense?
Goal: How do I get the correct values? It looks like I have to shift the values below 50 % downwards and the values above 50 % upwards.

 A: If you can measure $y$ for all values of $x$, then you're done...
From the comments above, when there's no uncertainty, there's no need to "fit" any curve. What you have is a function $y = f(x)$ where $y$ is what you're measuring. To get $x$ from this, you simply take the inverse function $x = f^{-1}(y)$, where $f^{-1}$ could be as simple as a piecewise function, for example, $f^{-1}(0.2) = 12.5$
If you cannot measure $y$ for all values of $x$, you could interpolate using spline interpolation (Python reference).
A: Looking at the scatterplot, the data seemed to me as if it were similar to a sine wave plus a straight line. I fitted the data to several trigonometric functions of this type, and found that a hyperbolic cosine (cosh) with linear growth appears to fit the data well. The below equation and three fitted parameter values yield R-squared = 0.9978 and RMSE): 0.0149
amplitude = 8.6803997548024585E-03
center = 7.3734550922795378E+01
width = 1.5909052889748179E+02

pi = 3.14159265358979323846

y = amplitude * cosh(pi * (x - center) / width) * x


