# Inverse of Interpolating Function?

1. Jul 19, 2011

### gonzorascal

Hello All,

I am working with an Interpolating Function of an oscillating solution (time series) to a differential equation. I am trying to find the period and pulse width of the oscillation. To do this I would like to have an inverse of my function y[t] (so I would have t[y]). I realize this function would be multivalued (that's in part what I want to find the period). I am not having success using Mathematica's InverseFunction[] or Reduce[] commands. Does anyone have any experience or suggestions with this sort of thing (either finding Inverse Interpolating Functions or another method for period and pulse width)? Thank you.

-GR

2. Jul 19, 2011

### pmsrw3

I don't know of any way to do what you want without some programming. You can use FindRoot to Find a root near an estimate, but to get all the roots you're going to have to do some hunting. Something like Table[y[t], {t,tmin,tmax,dt}], where you choose dt small enough that you feel confident of not missing any roots, then search for places where the sign changes, then use FindRoot with Method->"Brent" to locate each root.

A better way to do this would be to use the actual grid of values stored in the interpolating function. Needs["DifferentialEquationsInterpolatingFunctionAnatomy"] will load some functions that will allow you to do this. This is documented in Mathematica under "tutorial/NDSolvePackages".