Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Bug introduced in 10.0.0 and fixed in 10.0.1


I am encountering compatibility issues when loading DumpSave(d) definitions in V10 that have been created with earlier versions. V10 appears to be unable to digest `InterpolatingFunction from earlier version. When looking at an example functions in both versions I get the following:

Definition from the Documentation

points = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};
ifun = Interpolation[points]

In V9.0.1 this is digested as:

??ifun
Global`ifun
ifun=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}]

In V10:

??ifun
Global`ifun
ifun=InterpolatingFunction[{{0,5}},{4,3,0,{6},{4},0,0,0,0,Automatic,{},{},False},{{0,1,2,3,4,5}},{{0},{1},{3},{4},{3},{0}},{Automatic}]

Particularly the second part is not identical:

V9.0.1:

ifun[[2]]
{4,3,0,{6},{4},0,0,0,0,Automatic}

V10:

ifun[[2]]
{4,3,0,{6},{4},0,0,0,0,Automatic,{},{},False}

Can somebody explain the differences to me? Is there a way to still be able to use the old definitions (which were time consuming to create) in V10?

share|improve this question
    
The V10 documentation doesn't mention any modifications since V3, but this is clearly bogus. I think the changes were made to support the new output format for interpolation functions that V10 implemented. I like the new output format. –  m_goldberg Aug 18 at 13:32
5  
But what can you do except rebuild them? WRI giveth and WRI taketh away. I guess I advise complaining to WRI tech support. –  m_goldberg Aug 18 at 13:44
3  
This is a bug and seems to be fixed in the upcoming V10.0.1 release. –  user21 Aug 19 at 9:43
1  
@theDriver, my guess is more on the order of weeks than month. –  user21 Aug 20 at 6:38
1  
@Mr.Wizard Look's like it's fixed now in V10.0.1. –  Markus Roellig Sep 23 at 12:53

1 Answer 1

up vote 7 down vote accepted

Following How to splice together several instances of InterpolatingFunction? which I updated earlier today, before seeing this question, there are several new Properties for InterpolatingFunction expressions in version 10:

v7 = {"Coordinates", "DerivativeOrder", "Domain", "Evaluate", "Grid", 
   "InterpolationOrder", "MethodInformation", "Methods", "Properties", "ValuesOnGrid"};

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

Complement[v10, v7]
{"ElementMesh", "InterpolationMethod", "OutputDimensions",
 "Periodicity", "PlottableQ", "QuantityUnits"}

I suspect that the additional parameters correlate one or more of these. Proceeding with that assumption I searched for a mapping and found:

test1 = Array[{Quantity[#, "Second"], Quantity[#^2, "Meters"]} &, 10] // Interpolation;

test1[[2]]
test1["QuantityUnits"]
test1["PlottableQ"]
{4, 3, 0, {10}, {4}, 0, 0, 0, 0, Automatic, {"Seconds"}, "Meters", True}

{{"Seconds"}, "Meters"}

True

Older InterpolatingFunction expressions should not have any units associated (I believe) therefore you should always be able to use {},{} for those parameters. Apparently "PlottableQ" is False unless there are units so you should be able to use False there as well.

ifun9 = 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}];

ifunFixed = MapAt[Join[#, {{}, {}, False}] &, ifun9, 2];

Plot[ifunFixed[x], {x, 0, 5}]

enter image description here

share|improve this answer
    
Works like a charm. Thanks! –  Markus Roellig Aug 19 at 9:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.