11

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?

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
Markus Roellig
  • 7,703
  • 2
  • 29
  • 53
  • 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 '14 at 13:32
  • @m_Goldberg I agree, the new output format is nice. However, I also like my old InterpolatingFunctions and i would like to Keep using them :) – Markus Roellig Aug 18 '14 at 13:40
  • 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 '14 at 13:44
  • 3
    This is a bug and seems to be fixed in the upcoming V10.0.1 release. – user21 Aug 19 '14 at 09:43
  • @user21 Do you have any more information on this? Such as when V10.0.1 is going to be released. While I like the fix Mr.Wizard suggest, it would be nice if it works out of the box. – theDriver Aug 19 '14 at 21:55
  • 1
    @theDriver, my guess is more on the order of weeks than month. – user21 Aug 20 '14 at 06:38
  • @Markus Can you confirm that this is fixed in 10.0.1? – Mr.Wizard Sep 20 '14 at 18:11
  • 1
    @Mr.Wizard Look's like it's fixed now in V10.0.1. – Markus Roellig Sep 23 '14 at 12:53

1 Answers1

8

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

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371