# How can I extract the raw data points with which NDSolve uses internally to make the InterpolatingFunction? [duplicate]

I have a set of ODEs solved with NDSolve which returns InterpolatingFunctions. When I am trying to plot them, it takes a long time to render. I am guessing that adaptive subdivision for the sharp features makes it slow. My question is: since the interpolation was done internally before NDSolve returns, is there any way we can obtain the list of data points NDSolve used to interpolate? Thanks.

• – Michael E2 Apr 21 '20 at 19:49
• – Michael E2 Apr 21 '20 at 19:54

iF = y /. NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}][[1]]


You can access the list of Properties of InterpolatingFunction object using

 PropertyList[iF]

 {"Coordinates", "DerivativeOrder", "Domain", "ElementMesh", "Evaluate",
"GetPolynomial", "Grid", "InterpolationMethod", "InterpolationOrder",
"MethodInformation", "Methods", "OutputDimensions", "Periodicity", "PlottableQ",
"Properties", "QuantityUnits", "Unpack", "ValuesOnGrid"}


or

  iF["Methods"]


same list

You can access the property p using iF[p]. For example,

iF["InterpolationOrder"]

 {3}

iF["Coordinates"] // Short[#, 3] &


iF["Grid"] // Short[#, 3] &


iF["ValuesOnGrid"] // Short[#, 3] &


etc.

• Wonderful. Thanks. – QIZE SHU Apr 21 '20 at 22:34
• From @MichaelE2's last link, you can also ListPlot[iF]. – Chris K Apr 22 '20 at 0:25