# Complicated Interpolation (Multivalued)

1. Aug 14, 2012

### ZombieKitty

Hi,

I'm trying to interpolate a data set of classical trajectories, but I'm having trouble because the data is basically a multivalued function. The data maps out a periodic function: for every x value, there are about 7 y values.

Does anyone have any advice as to how to approach this? Most of the interpolation routines I'm trying to implement require that x1< x2< xn.. which isn't the case since it's periodic.

Also, I can think of a few tricks to get around it for the simplest case, which basically looks sinusoidal but flipped vertically.. but some of the other data sets are much more complicated (though still periodic).

Any direction would be greatly appreciated. Thanks!

2. Aug 14, 2012

### mathman

Can you switch y and x?

3. Aug 14, 2012

### ZombieKitty

The problem with that is that I need to interpolate at very specific x values. If I were to switch x and y, I'd now be feeding my routine a particular y value and it'd be returning the corresponding x... but this is not necessarily at the x value I need. Does that make sense?

I'm now thinking that if I can fit the data to a particular polynomial.. I can easily find any values I need, granted that it's possible to find a well-fitting function. I'm confident this will work for some of the simpler data sets, but not so sure with the more complicated data.