How to use InterpolatingFunction generated by Mathematica 5.2 in version 8.0.1?
Asked Answered
F

0

1

Let us interpolate the same data using Mathematica 5.2, 7.0.1 and 8.0.1:

Interpolation[{{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}}] // InputForm

The outputs are:

Mathematica 5.2:

InterpolatingFunction[{{0, 5}}, 
 {2, 0, True, False, {3}, {0}}, {{0, 1, 2, 3, 4, 5}}, 
 {{0}, {1}, {3}, {4}, {3}, {0}}, {Automatic}]

Mathematica 7.0.1:

InterpolatingFunction[{{0, 5}}, {3, 1, 0, {6}, {4}, 0, 0, 0, 0}, 
 {{0, 1, 2, 3, 4, 5}}, {{0}, {1}, {3}, {4}, {3}, {0}}, {Automatic}]

Mathematica 8.0.1:

InterpolatingFunction[{{0, 5}}, {4, 3, 0, {6}, {4}, 0, 0, 0, 0, Automatic}, 
 {{0, 1, 2, 3, 4, 5}}, {{0}, {1}, {3}, {4}, {3}, {0}}, {Automatic}]

The output of Mathematica 5.2 still works when used as input in version 7.0.1 but not in version 8.0.1. It seems that support of the old-style InterpolatingFunction was dropped in version 8. Is it possible to reuse InterpolatingFunction data generated by Mathematica 5.2 in version 8.0.1?

Fiddlededee answered 9/10, 2011 at 10:9 Comment(8)
Is there any reason you don't want to extract the points from older version's InterpolatingFunction and then construct another InterpolatingFunction object in a newer version with those points?Gazo
@Leonid Not, this may be a solution. But I have no idea how to correctly extract the points from InterpolatingFunction in version 5.2 in a general way (the InterpolatingFunction may be returned by NDSolve).Fiddlededee
@Alexey, look for the built-in package: "DifferentialEquationsInterpolatingFunctionAnatomy", it contains functions that can extract range, data points, etc. from the InterpolatingFunction structure.Fraternity
@István I am looking for version-independent solution. In this way I need to convert InterpolatingFunction into data set inside of version 5.2 because it is not guaranteed (and I have not checked whether it even works in v.8) that in newer versions of Mathematica DifferentialEquations`InterpolatingFunctionAnatomy` will support the old-style InterpolatingFunction from v.5.2.Fiddlededee
@Alexey I don't remember exact details now and don't have version 5 currently installed, but I recall that this is a matter of extracting some Part(s) of InterpolatingFunction object. You can try some example to figure out which parts are responsible for the points.Gazo
I removed my posting after I realized (with Mr.Wizard's help) that I had misunderstood your question.Maldives
DifferentialEquationsInterpolatingFunctionAnatomy should be version-independent, and is the best way to extract information from interpolating functions (since as you've noticed the InputForm representation is undocumented and subject to change.)Tarbox
@István @Brett Thank you. I just realized that Mathematica 5.2 contains its own package DifferentialEquations`InterpolatingFunctionAnatomy`.Fiddlededee

© 2022 - 2024 — McMap. All rights reserved.