Tag Info

Hot answers tagged interpolation

How can I adaptively simplify a curved shape?

We can use the Ramer-Douglas-Peucker algorithm to reduce the number of points. This algorithm was originally devised for processing map data. ...
• 236k
Accepted

Inflection point and curvature

Let's rename things slightly to make it more consistent g = Fit[newdata, {1, x, x^2, x^3, x^4}, x]; To find inflection points, you can just put (blue) points ...
• 14.2k
Accepted

Easy way to plot ODE solutions from NDSolve?

I wanted to share some undocumented techniques that give quick rough plots of NDSolve solutions. The keys points are this, the second one being quite handy at ...
• 237k

My Girlfriend is going to prison...Save her with Math

Similar to previous answers, only I don't make the instantaneous absorption assumption since it isn't really necessary. The equation can be found here on page three, where ka and ke are the rates of ...
• 19.7k
Accepted

Data extraction from a picture of a graph

This is not a complete solution, but might get you on the way. With a little bit of trial and error you can identify the coordinates of the blocks and the key in the image: ...
• 85.1k
Accepted

How to Take Derivative of Interpolating Function?

Use Derivative. If your interpolating function is called if, then its derivative is computed by ...
• 236k

...
• 61.9k

Extracting the function from InterpolatingFunction object

In M11+ you can use the "GetPolynomial" method of an interpolating function to obtain the corresponding piecewise expression (but only when using the default "Hermite" method): ...
• 131k
Accepted

Morphing between two functions

You might be interested in the approach with optimal transport. Let $F(x)=\int_{-\infty}^x f(y)\,dy$ and $G(x)=\int_{-\infty}^x g(y)\,dy$ be the repartition functions. Then \$T(x)=G^{-1}\bigl(F(x)\...
• 2,553

How do you calculate the 2d area between list points?

Assuming you want the area of the polygon made of the points. At first we'll order the points: orderedPoints=points[[FindShortestTour[points][[2]]]]; Then lets ...
• 5,385

2D smoothing spline interpolation

Update Since version 12, this functionality in integrated in Mathematica via the Option FitRegularization Following on @Ajasja's answer in the spirit of this answer one can in fact provide ...
• 23k

My Girlfriend is going to prison...Save her with Math

Assuming the simplest kinetic model for elimination (and making the simplifying assumption of "instant absorption" to peak concentration): ...
• 61.9k
Accepted

FindMaximum of Interpolated data set

NMaximize is good for finding global maxima: NMaximize[{f[x], 26 < x < 6908}, x] (* {28.9179, {x -> 177.957}} *) For <...
• 5,424
Accepted

Interpolating noisy data

Using Quantile regression might produce results you want -- you have to experiment with the number of knots or the knots locations. Get data: ...
• 37.9k
Accepted

Meaning of InterpolationOrder -> All for multidimensional interpolation

This is code that has been written many moons ago... here is an example: ...
• 40k
Accepted

Integration of Interpolated function take an unacceptable amount of time

The code in the question takes about 40 seconds on my computer. Turning off SymbolicProcessing, as suggested by Tim Laska in a comment, reduces the run time to ...
• 61.7k
Accepted

Interpolation[] gives negative values when all the initial data is positive

One good way to interpolate a function of this nature is to take its Log, interpolate, and take Exp of the result. ...
• 13.8k

Plotting a directed contour with self-intersections

Something to get you started: ...
• 34.1k

Extracting the function from InterpolatingFunction object

You could use Series. What's necessary is to know which abscissa values were used for the interpolation. Let's generate some fake data. ...
• 11.5k
Accepted

How to speed up integration of interpolation function?

The way to deal with this is to use the special setting Method -> "InterpolationPointsSubdivision" of NIntegrate[], which ...
Accepted

How to calculate the control points of a Bézier curve?

Here is my approach: ...
• 625

...
• 160k

Extracting the function from InterpolatingFunction object

Here is a (mostly) general routine that (tries to) convert a one-dimensional InterpolatingFunction[] into an equivalent ...
Accepted

Complex continuation of an interpolated function

There are limitations to extending polynomial interpolation on a real interval to the complex plane. The limitations are related to the Bernstein ellipse (see also Trefethen, Approximation Theory and ...
• 237k
Accepted

How do you interpolate outside the range of data?

You can use the undocumented argument "ExtrapolationHandler", which I learned about here, together with ConditionalExpression as ...
• 70.8k
Accepted

Interpolation on an unstructured mesh

Here is how to do it, just let ToElementMesh create the mesh: ...
• 40k

The only usage for the option InterpolationOrder in NDSolve is to be set to All?

First, InterpolationOrder can be set to integer and make a difference, but there are limitations. Whether the settings other than ...
• 237k

How can I adaptively simplify a curved shape?

Here is my attempt to use ParametricPlot for obtaining an adaptive approximation of the shape. It is based on the code of glyph to ...
• 61.9k

How can I adaptively simplify a curved shape?

Here I present a very simple angle-based polygon reduction algorithm as described in the chapter "A Simple Algorithm" of David Eberly's "Polyline Reduction". The only addition is ...
• 61.9k