Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Analytical form of an Interpolated function

  1. Apr 19, 2012 #1
    Analytical form of an "Interpolated" function

    Hallo,

    I have a question on the use of "Interpolation" function in Mathematica.
    I am wondering whether it is possible to extract an analytical expression
    for a function built using the "Interpolation" option. Say, I have the following
    function of two variable f(x,y) represented on a grid:

    Ra=Interpolation[{
    {{ 2.777897, 0.000000}, -0.202683},
    {{ 2.777897, 0.043633}, -0.203579},
    {{ 2.777897, 0.087266}, -0.200988},
    {{ 2.777897, 0.130900}, -0.192908},
    {{ 2.777897, 0.174533}, -0.176695},
    {{ 2.777897, 0.218166}, -0.155857},
    {{ 2.777897, 0.261799}, -0.129889},

    {{ 2.815692, 0.000000}, -0.202618},
    {{ 2.815692, 0.043633}, -0.203585},
    {{ 2.815692, 0.087266}, -0.201401},
    {{ 2.815692, 0.130900}, -0.194172},
    {{ 2.815692, 0.174533}, -0.179481},
    {{ 2.815692, 0.218166}, -0.163498},
    {{ 2.815692, 0.261799}, -0.140403},

    {{ 2.853486, 0.000000}, -0.201962},
    {{ 2.853486, 0.043633}, -0.203003},
    {{ 2.853486, 0.087266}, -0.201219},
    {{ 2.853486, 0.130900}, -0.194830},
    {{ 2.853486, 0.174533}, -0.181844},
    {{ 2.853486, 0.218166}, -0.170511},
    {{ 2.853486, 0.261799}, -0.150171},

    {{ 2.891281, 0.000000}, -0.200745},
    {{ 2.891281, 0.043633}, -0.201863},
    {{ 2.891281, 0.087266}, -0.200472},
    {{ 2.891281, 0.130900}, -0.194926},
    {{ 2.891281, 0.174533}, -0.184095},
    {{ 2.891281, 0.218166}, -0.176901},
    {{ 2.891281, 0.261799}, -0.159191},

    {{ 2.929075, 0.000000}, -0.198999},
    {{ 2.929075, 0.043633}, -0.200197},
    {{ 2.929075, 0.087266}, -0.199196},
    {{ 2.929075, 0.130900}, -0.194513},
    {{ 2.929075, 0.174533}, -0.186552},
    {{ 2.929075, 0.218166}, -0.182673},
    {{ 2.929075, 0.261799}, -0.167464},

    {{ 2.966870, 0.000000}, -0.196757},
    {{ 2.966870, 0.043633}, -0.198037},
    {{ 2.966870, 0.087266}, -0.197426},
    {{ 2.966870, 0.130900}, -0.193666},
    {{ 2.966870, 0.174533}, -0.189150},
    {{ 2.966870, 0.218166}, -0.187834},
    {{ 2.966870, 0.261799}, -0.174997},

    {{ 3.004664, 0.000000}, -0.194050},
    {{ 3.004664, 0.043633}, -0.195418},
    {{ 3.004664, 0.087266}, -0.195205},
    {{ 3.004664, 0.130900}, -0.192492},
    {{ 3.004664, 0.174533}, -0.191623},
    {{ 3.004664, 0.218166}, -0.192395},
    {{ 3.004664, 0.261799}, -0.181796},

    {{ 3.042459, 0.000000}, -0.190913},
    {{ 3.042459, 0.043633}, -0.192374},
    {{ 3.042459, 0.087266}, -0.192580},
    {{ 3.042459, 0.130900}, -0.191144},
    {{ 3.042459, 0.174533}, -0.193806},
    {{ 3.042459, 0.218166}, -0.196366},
    {{ 3.042459, 0.261799}, -0.187872},

    {{ 3.080253, 0.000000}, -0.187381},
    {{ 3.080253, 0.043633}, -0.188943},
    {{ 3.080253, 0.087266}, -0.189609},
    {{ 3.080253, 0.130900}, -0.189813},
    {{ 3.080253, 0.174533}, -0.195628},
    {{ 3.080253, 0.218166}, -0.199759},
    {{ 3.080253, 0.261799}, -0.193240},

    {{ 3.118048, 0.000000}, -0.183492},
    {{ 3.118048, 0.043633}, -0.185166},
    {{ 3.118048, 0.087266}, -0.186363},
    {{ 3.118048, 0.130900}, -0.188646},
    {{ 3.118048, 0.174533}, -0.197061},
    {{ 3.118048, 0.218166}, -0.202589},
    {{ 3.118048, 0.261799}, -0.197915},

    {{ 3.155842, 0.000000}, -0.179285},
    {{ 3.155842, 0.043633}, -0.181090},
    {{ 3.155842, 0.087266}, -0.182933},
    {{ 3.155842, 0.130900}, -0.187658},
    {{ 3.155842, 0.174533}, -0.198096},
    {{ 3.155842, 0.218166}, -0.204871},
    {{ 3.155842, 0.261799}, -0.201916},

    {{ 3.193637, 0.000000}, -0.174801},
    {{ 3.193637, 0.043633}, -0.176764},
    {{ 3.193637, 0.087266}, -0.179435},
    {{ 3.193637, 0.130900}, -0.186750},
    {{ 3.193637, 0.174533}, -0.198733},
    {{ 3.193637, 0.218166}, -0.206622},
    {{ 3.193637, 0.261799}, -0.205261}
    }]

    Mathematica makes an "Interpolated" function by a polynomial of 3rd or 4th oder out of this.
    The question is if there is an elegant option to extract the coefficients of this polynomial
    (besides that of taking the 1st, 2nd, etc derivatives of the function, which is quite tedious).
    Many thanks!
     
  2. jcsd
  3. Apr 19, 2012 #2
    Re: Analytical form of an "Interpolated" function

    I do not know any Mathematica...I am just curious...do you mean to tell me that Mathematica CAN interpolate this data and come up with a polynomial, but it won't tell you which one it is?

    I mean, I have done simple y=f(x) interpolation in Excel and, on the graph, one has the option of printing the equation Excel came up with...linear, quadratic, exponential, polynomial, whatever...Mathematica does not do that? Or that's the part you don't know how to do?.
     
  4. Apr 20, 2012 #3
    Re: Analytical form of an "Interpolated" function

    Yes, as far as I know Mathematica does not output automatically the formula of the function obtained with "Interpolation". I am sure that this issue has been posted before at the forum but unfortunately I cannot find the thread :frown:
     
  5. Apr 20, 2012 #4
    Re: Analytical form of an "Interpolated" function

    I don't think so. Interpolation works by interpolating between points using various polynomials. It does not use a global polynomial for all the data. Try using Fit or other functions to come up with an analytic expression for the data.
     
  6. Apr 20, 2012 #5
    Re: Analytical form of an "Interpolated" function

    Are you sure? As far as I remember, in the manual, it is written that one can work with "interpolated" functions like with normal functions. So it should be a function. Ok, I might try to represent my "Interpolated" function with a polynomial, via 1s,2nd etc derivatives. Maybe it will work...
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook