Analytical form of an Interpolated function

Click For Summary

Discussion Overview

The discussion centers around the capabilities of Mathematica's "Interpolation" function, specifically regarding the extraction of an analytical expression from interpolated data. Participants explore whether it is possible to derive a polynomial representation of the interpolated function and discuss alternative methods for obtaining such expressions.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant questions whether Mathematica can provide the polynomial used for interpolation, comparing it to Excel's functionality that displays the equation of fitted curves.
  • Another participant confirms that Mathematica does not automatically output the formula for the interpolated function, suggesting that this issue may have been previously discussed in the forum.
  • Some participants argue that interpolation does not yield a single global polynomial for all data points, but rather uses various polynomials between points, recommending the use of the "Fit" function for obtaining an analytic expression.
  • One participant expresses uncertainty about the nature of interpolated functions in Mathematica, considering the possibility of representing the interpolated function through derivatives.

Areas of Agreement / Disagreement

Participants generally disagree on the capabilities of Mathematica's interpolation function and whether it can provide a single polynomial expression for the data. Multiple competing views remain regarding the best approach to obtain an analytical form.

Contextual Notes

Participants reference the limitations of Mathematica's interpolation output and the potential need for alternative methods like "Fit" to derive a polynomial expression. There is also mention of the manual's description of working with interpolated functions, which may not align with participants' experiences.

evgenx
Messages
14
Reaction score
0
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!
 
Physics news on Phys.org


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?.
 


gsal said:
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?.

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:
 


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.
 


jackmell said:
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.

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...
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
8K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 8 ·
Replies
8
Views
63K
  • · Replies 5 ·
Replies
5
Views
5K
Replies
15
Views
42K