I'm getting an unexpected error message from the following code. I'm trying to interpolate a function, defining the function value and its derivative.
ys6 = RandomReal[NormalDistribution[], 20]
dys6 = Join[
{0.0},
(ys6[[3 ;; -1]] - ys6[[1 ;; -3]])/2,
{0.0}
]
ydata6 = Transpose@{Table[{x}, {x, 20}], ys6, dys6}
sf2 = Interpolation[ydata6, Method -> "Spline"]
At this point I get the error Interpolation::mspl
: "The Spline method could not be used because the data could not be coerced to machine real numbers". What does this mean? What data can't be coerced to real?
The following:
hf1 = Interpolation[ydata6, Method -> "Hermite"]
...works without error and produces the expected result. In fact, despite producing an error message, the "Spline" method also returns an InterpolatingFunction, which plotting shows to be superimposable with hf1
.
(Mathematica 10, MacOS. Attached notebook has complete example.)
Attachments: