Hot answers tagged

3

SetOptions does not work with hidden options, but try the following to obtain the desired result Unprotect[NDSolve]; AppendTo[Options[NDSolve], {"ExtrapolationHandler" -> {Indeterminate &,"WarningMessage" -> False}}]; Protect[NDSolve];


3

Short Answer You need to set the InterpolationPoints to a higher value than the default in order to get a decent result out of FunctionInterpolation. For this example, 125 is the lowest I found that gives a good plot, testfun[y_, x_] := x/(1 + y^2); intfun = FunctionInterpolation[testfun[y, x], {y, -20, 20}, {x, 0, 2}, InterpolationPoints -> 125]; ...


1

Here is an adaptation of my solution to Extracting the function from InterpolatingFunction object, which converts an InterpolatingFunction to a Piecewise polynomial interpolation. pwf = Piecewise[ Map[{InterpolatingPolynomial[#1, x], x < #[[3, 1]]} &, Most[#]], InterpolatingPolynomial[Last@#1, x]] &@Partition[data, 4, 1]; {x1, x2} = ...


1

Here is some data in an array, then interpolated at a finer grid specified by desiredPoints. data = Thread[{Range[10], RandomInteger[{0, 5}, 10]}]; f = Interpolation[data]; desiredPoints = Range[2, 5, 0.1]; f[desiredPoints]



Only top voted, non community-wiki answers of a minimum length are eligible