Tag Info

New answers tagged

2

A similar thing happens in this question: How can the behavior of InterpolationOrder->0 be controlled? As @seismatica has pointed out, ListInterpolation[data, InterpolationOrder -> 0][0] yields data[[2]], not data[[1]] as might be expected. Thus the range of the interpolating function, over the fundamental domain does not include the first point in ...


3

End running the problem we can readily construct our own "zero order" interpolation function: myzero[t_] := (#[[1 + (Ceiling[Mod[t, 1] (Length@# - 1) ] )]]) &@ dataSource which gives your desired plot: ParametricPlot[myzero[t], {t, 0, 1}, AspectRatio -> Automatic] same closed figure as your InterpolationOrder-> 1 result note the ...


2

Perhaps too specific to OP's example case: Interpolation[{{{0}, 0, Automatic}, {{1}, 1, 0}, {{2}, 0, Automatic}, {{3}, 1, 0}, {{4}, 0. Automatic}}, InterpolationOrder -> 2] Plot[%[x], {x, 0, 4}] and Interpolation[{{{0}, 0, Automatic}, {{1}, 1, 0}, {{2}, 0, Automatic}, {{3}, 1, 0}, {{4}, 0. Automatic}}, ...


3

Based on What's inside InterpolatingFunction[{{1., 4.}}, <>]?, I would guess that a built-in way is not possible. However, one can take advantage of InterpolatingFunction to construct a Piecewise function. Here, split, does an overlapping partition starting a new list at position p, is a modification of Mr.Wizard's dPcore in this answer. ...


3

ParametricPlot3D and ParametricPlot accept a wide range of nested lists of expressions to specify a function or functions to be graphed. Let's discuss ParametricPlot3D. ParametricPlot is similar, with lists of length 2 replacing lists of length 3 where appropriate. There are two types of specifications List[expr,...] List[List[...],...] where expr ...


5

Even though OP's problem is resolved in the question's comments, I hope to provide an explanation of why the gap appears in the parametric plot. Namely, I think InterpolationOrder -> 0 (specifically as an option to ListInterpolation*) is the culprit, as it starts with a jump/step from the first data point to the second data point. As a result, the ...


1

Just for completeness purposes: data = First@ToExpression@Import["http://pastebin.com/raw.php?i=8XKGYvSy", "Data"]; f = Interpolation[data] y[x_] := -3 Show@{Plot[{f[x], y[x]}, {x, Min[First /@ data], Max[First /@ data]}, PlotRange -> All], ListPlot[data, AxesOrigin -> {0, 0}, PlotRange -> All, PlotStyle -> Red]} Where you can see ...


1

Try this: data = ToExpression@ Import["http://pastebin.com/raw.php?i=8XKGYvSy", "Data"][[1]]; Interpolation[data]



Top 50 recent answers are included