1
$\begingroup$

This code is used to work perfectly with Mathematica 7 and now it is not working with Mathematica 10. Any help is appreciated.

CL05 = InterpolatingFunction[{{0.5, 11.99999999999999}}, {1, 0, True, Real, {3}, {0}}, {{0.5, 0.75, 1., 1.25, 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.25, 3.5, 3.75, 4., 4.25, 4.5, 4.75, 5., 5.25, 5.5, 5.75, 6., 6.25, 6.5, 6.75, 7., 7.25, 7.5, 7.75, 8., 8.25, 8.5, 8.75, 9., 9.25, 9.5, 9.75, 10., 10.24999999999999, 10.5, 10.74999999999999, 11., 11.25, 11.49999999999999, 11.75, 11.99999999999999}}, {{0.01739227213704432}, {0.01526028474172406}, \ {0.01376257284655001}, {0.01269413117458243}, {0.01187709007513161}, \ {0.01122101218367176}, {0.01067571253959407}, {0.01021085679977087}, \ {0.009806841117247426}, {0.009450319639185076}, {0.00913182421649463}, \ {0.008844409715914348}, {0.00858283953998209}, {0.008343073191490949}, \ {0.008121931360292601}, {0.007916869839453166}, {0.007725822606228414}, \ {0.007547090248693227}, {0.007379258939179236}, {0.007221140482075994}, \ {0.00707172721146961}, {0.006930157551744231}, {0.00679568936545047}, \ {0.006667679075849193}, {0.006545565131451493}, {0.006428854776816615}, \ {0.006317113370201306}, {0.00620995568401974}, {0.00610703876416928}, \ {0.006008056026061431}, {0.005912732340045105}, {0.005820819914568142}, \ {0.005732094827246328}, {0.005646354085741025}, {0.005563413124642471}, \ {0.005483103663315336}, {0.005405271864264928}, {0.005329776743031751}, \ {0.005256488789665227}, {0.005185288769014937}, {0.005116066672829433}, \ {0.005048720801279899}, {0.004983156955272167}, {0.004919287723957928}, \ {0.004857031854348534}, {0.004796313691982971}, {0.004737062683292882}}];

$\endgroup$
3
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – user9660
    Jan 6 '15 at 21:30
  • 1
    $\begingroup$ What do you mean by "not working?" $\endgroup$
    – Cassini
    Jan 6 '15 at 21:33
  • $\begingroup$ Try Interpolation[Transpose[{Flatten@CL05[[3]], Flatten@CL05[[4]]}]]. I don't know the V7 structure, so I can't be sure about the interpolation order and other options. $\endgroup$
    – Michael E2
    Jan 7 '15 at 23:21
4
$\begingroup$

I don't know anything about the structure of an InterpolatingFunction (the documentation doesn't seem to provide much information about it), but could you just reconstruct your function like this:

data = {{0.5`, 0.01739227213704432`}, {0.75`,0.01526028474172406`}, {1.`, 0.01376257284655001`}, {1.25`,0.01269413117458243`}, {1.5`, 0.01187709007513161`}, {1.75`,0.01122101218367176`}, {2.`, 0.01067571253959407`}, {2.25`,0.01021085679977087`}, {2.5`, 0.009806841117247425`}, {2.75`,0.009450319639185077`}, {3.`, 0.00913182421649463`}, {3.25`,0.008844409715914348`}, {3.5`, 0.00858283953998209`}, {3.75`,0.00834307319149095`}, {4.`, 0.0081219313602926`}, {4.25`,0.007916869839453167`}, {4.5`, 0.007725822606228414`}, {4.75`,0.007547090248693227`}, {5.`, 0.007379258939179236`}, {5.25`,0.007221140482075994`}, {5.5`, 0.00707172721146961`}, {5.75`,0.006930157551744231`}, {6.`, 0.00679568936545047`}, {6.25`,0.006667679075849193`}, {6.5`, 0.006545565131451493`}, {6.75`,0.006428854776816615`}, {7.`, 0.006317113370201306`}, {7.25`,0.00620995568401974`}, {7.5`, 0.00610703876416928`}, {7.75`,0.006008056026061431`}, {8.`, 0.005912732340045105`}, {8.25`,0.005820819914568142`}, {8.5`, 0.005732094827246328`}, {8.75`,0.005646354085741025`}, {9.`, 0.005563413124642471`}, {9.25`,0.005483103663315336`}, {9.5`, 0.005405271864264928`}, {9.75`,0.005329776743031751`}, {10.`,0.005256488789665227`}, {10.24999999999999`,0.005185288769014937`}, {10.5`,0.005116066672829433`}, {10.74999999999999`,0.005048720801279899`}, {11.`, 0.004983156955272167`}, {11.25`,0.004919287723957928`}, {11.49999999999999`,0.004857031854348534`}, {11.75`,0.004796313691982971`}, {11.99999999999999`,0.004737062683292882`}};

CL05=Interpolation[data]
$\endgroup$
2
  • 2
    $\begingroup$ The internal structure is deliberately undocumented, I believe. The structure has been changed and refined several times. Unfortunately there was a particularly large change made around version 8.0.1 and InterpolatingFunction expressions made in V7 and earlier won't work. The best way to ensure your functions continue to work is to keep their definitions around in the format above (i.e. as the output of a documented generator of InterpolatingFunction objects, such as Interpolation.) $\endgroup$
    – Stefan R
    Jan 6 '15 at 21:56
  • $\begingroup$ See here: mathematica.stackexchange.com/a/28341/5 $\endgroup$
    – rm -rf
    Jan 7 '15 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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