Interpolation with exact inverse

542 Views Asked by At

I need to interpolate tabulated data for a simulation model, see screenshot for a simplified example (Yes, screenshot is from Excel, but the actual simulation would be programmed in Modelica). This is easy, and there are many ways to do it, e.g. the blue line uses linear interpolation, orange line uses cubic interpolation.

enter image description here

But sometimes I will need the exact inverse of the interpolated data. If I used linear interpolation, it is easy to get the exact/analytic inverse by just swapping the columns in the data table. But I also need the segments to be connected in a C² or C³ smooth way, so I would prefer to use e.g. cubic interpolation or Akima splines.

How can I interpolate my data in a smooth AND invertible way? My data is strictly monotonous, values are finite and continuous, a unique inverse exists. It seems the aspect of inverting interpolation by just swapping the columns is not discussed in any paper or book I read so far.

2

There are 2 best solutions below

1
On

You have $n$ sorted data points $(x_i,y_i)$

What I would suggest is to use parametric splines, that is to say $$x=f(i) \qquad \text{and} \qquad y=g(i)$$ This is simple and very efficient in both directions.

Just have a look here.

0
On

You can use Steffen-splines to do it, they are monotonicity-preserving, smooth, and invertible, see https://arxiv.org/pdf/1906.02145. Maybe other monotonicity-preserving splines do the same (Fritsch-Butland), this was the first reference I found.