0

I have a list of data. I integrate them with interpolation. Lets say is the following:

  InterpolatingFunction[{{0.01, 4.82}}, <>][x]

However, is that anyway for me to get an array of coordinates of the function after integration?

Thank you

Yincheng Liu
  • 309
  • 1
  • 8
  • 4
    See http://mathematica.stackexchange.com/questions/28337/whats-inside-interpolatingfunction1-4 -- And there are examples in most of the answers found in this search: http://mathematica.stackexchange.com/search?q=InterpolatingFunction+coordinates – Michael E2 Nov 07 '15 at 17:02

1 Answers1

2

I am not quite sure what you want but this may help. First I generate some data

data = Table[{x, x + Sin[2 \[Pi] x]}, {x, 0.01, 4.82, 0.1}];

This plots as

ListPlot[data, Frame -> True, PlotTheme -> "Scientific"]

Mathematica graphics

Now we make an interpolation function and then integrate

f = Interpolation[data];
g = Integrate[f[x], x]

Interestingly the x from the integration gets built in to the new fuction. Someone might like to explain this

Mathematica graphics

I remove the [x] at the end by taking the head

g1 = Head[g];

Now we can plot the integrated function

p1 = Plot[g1[x], {x, 0.01, 4.82}, Frame -> True, 
  PlotTheme -> "Scientific"]

Mathematica graphics

If we want to go back to coordinates then there are several ways. If we wish to use the same x values as before then can do the following

cc = Transpose[{data[[All, 1]], g1[#] & /@ data[[All, 1]]}];

and plot

Show[p1, ListPlot[cc, PlotStyle -> {Green}]]

Mathematica graphics

Is this what you are after?

Hugh
  • 16,387
  • 3
  • 31
  • 83