# Questions tagged [interpolation]

Questions on the interpolation functions in Mathematica (InterpolatingFunction[], Interpolation[], ListInterpolation[], FunctionInterpolation[], InterpolatingPolynomial[], etc.)

936 questions
Filter by
Sorted by
Tagged with
1 vote
93 views

### Problem solving a function using FindRoot and then plotting it

When I run the following code: ...
43 views

### find the planar curve that passes two given points, whose tangent directions at these two points are also given

This is related to drawing the links and joints of a robot manipulator. I'd like to find a way to generate a link bwtween two given bars (joints), and the said link has to be normal to the two bars ...
329 views

### Unexpected 'switch' of partial derivatives when differentiating InterpolatingFunction

Bug introduced in 11.3 or earlier and persisting through 12.1.0 or later - Fixed in Version: 12.1.1 In short, there is a simple initial boundary-value problem for which NDSolveValue produces an ...
1 vote
223 views

### Is it possible to fit such a large range plot in mathematica?

I am trying to solve the coupled differential equation numerically with Mathematica. But the range of values are large so mathematica cannot give correct plot. Here is the code: ...
1 vote
59 views

### Axial Symmetric 2D Cylindrical Field to Cartesian 3D Field

Previously, I've used 2-dimensioned [radius, zeta] output from NDSolve ({InterpolatingFunction, InterpolatingFunction}] and used the FieldTransform to convert the axial-symmetric cylindrical slice to ...
579 views

### How can I resample a list of {x,y} data for evenly spaced points?

I have generated a list of {x,y} points using a position function of a particle moving in 2D space. If you run the following code you'll see a small bit of the particle's motion (I cut out most of it ...
177 views

### How to represent flux in a shape

I used Tim Laska's solution here for raytracing, and modelled 10000 photons impinging onto a cone. ...
1 vote
85 views

### lookup table data with interpolation from reference list

I have data as: ...
1 vote
1k views

### Finding a third degree polynomial that passes through given points

If I have three points xi-1,xi, xi+1 where y(xi) =1 and y(xi-1)=0, y(xi+1)=0 (basis function) and I need to define a line that passes through these points I will use the line equation y-y1=(y2-y1) /(...
424 views

### Rescaling data to make a "continuous" function

I have acquired many sets of data, which all represent a single function, but which are randomly rescaled by a constant (due to the measurement specifics). I'm looking to effectively stitch them ...
2k views

### Approximately Fit Data Without FindFit

I have some noisy data, and I'd like to analyze the derivative of the function the data approximately matches. Interpolation is normally great, but doesn't work ...
56 views

### Cannot understand meaning of "identical"

This came up in the context of plotting solutions to NDSolve, but I've reduced it to the following issue. This really has me scratching my head. ...
305 views

### How to fit spline through points in $\mathbb{R}^3$?

I have coordinates of points that represent a curve (for example, helix or centerline of moebius strip) in $\mathbb{R^3}$. I want to fit a Bspline through these points. How to do this in Mathematica? ...
84 views

### Extrapolation Handler and NIntegrate: Bug?

I have an list of data which I interpolate such that it returns the value 0 in case I give it values outside of its domain: ...
54 views

### Evaluating Interpolating functions from NDSolve to solve for a specific time, and evaluating the functions at that time

For one of my homework assignments in a mathematical modeling class, we were supposed to take a 2d system of second order differential equations, and convert it to a 4d first order system of ...
117 views

### How to make interpolation for data of closed shape?

I have a data that describes a closed shape, let here assume it is a circle ...
1 vote
126 views

### Adding an interpolated function to neural networks through ElementwiseLayer

1.Trying to add an interpolated function to neural networks. ...
71 views

### Interpolated Hyperbolic tangent as a layer of a neural network

It is necessary to specify piecewise linear interpolation of the hyperbolic tangent. And substitute this function as a layer of a neural network. I tried a lot of things, please suggest your options.) ...
55 views

### How do I combine InterpolatingPolynomial and Integrate?

I want to find a real-valued polynomial (or trig) function f[x] that yields 0 at x=-a, and ...
526 views

### Lagrange Interpolation [duplicate]

I have the following table with 90 elements, and I want to write a loop that gives me the Lagrange operators. I want to construct an interpolation with Lagrange interpolation and show the loop to ...
58 views

### Multivariate polynomial data fitting formula

A short description： consider $f(x,y,z)=x^2+y^2-z^2$ we can know that $f(1,0,1)=0,f(0,1,1)=0$ ,etc. so we can get the roots of this polynomial. Now if given the roots of polynomial, how to solve ...
231 views

### Find a continuous map between two sets of 2D points

Given two sets of points in 2D points1 and points2 inside a rectangle, I would like to find a continuous map ...
1 vote
59 views

### Why doesn't Sort work in this case ? (Only numerical values)

Context I want to interpolate a complicated symmetric function f of 2 variables x and y defined by some numerical integral involving Bessel functions. Since computing the integral itself is a bit ...
96 views

### How do I prevent the Interpolation function from giving negative values?

I've got an interpolation function: ...
84 views

### Elegant solving and plotting of multivalued solutions for a system of 2 equations with parameters using NSolve?

This looks long and complicated, but it's really not. I just tried to pose the problem well. I have to solve a relatively complicated system of equations that has 2 variables and 3 parameters. I ...
76 views

### Creating an interpolation matrix efficiently

I would like to know if there is a fast way to create the following matrix (note that the matrix is defined with arbitrary precision): ...
90 views

### Numerical integration of an interpolating function with another analytic function [closed]

I have to numerically integrate over $x$ a complicated function that has this structure $f(x,y)g(x)$ with a parameter $y$. In my case the fastest way to deal with it is generate an interpolating ...
76 views

### I am having trouble with the Show[] section of this code

Question: I am unsure how to graph the interpolated graph with the regular graph on the interval $[1,4]$. Not even the Show line works about even if I'm pretty sure ...
1 vote
87 views

### How to solve an algebraic equation with InterpolatingFunction?

How to solve the equation f[t]==0 for the function f[t] defined by differential equation,i.e. if ...
51 views

### Is it possible to obtain the algebraic expression of an InterpolatingFunction? [duplicate]

Up until now, I have been trying to obtain an expression for an InterpolatingFunction obtained from NDSolve, by using the ...
47 views

### Replacing sublists with criterion or Interpolation for a smooth curve

Supposing we have the following list (very small, can be copied into a notebook directly) ...
2k views

### 2D smoothing spline interpolation

Does Mathematica have 2D smoothing spline interpolation built in? I requires an interpolation method with smooth first derivatives and cubic bivariate splines fulfill this nicely. In python I would ...
78 views

### Testing Positivity of Interpolating Function

I have an interpolating function and I want to test whether it is positive definite over an interval. Will any of Mathematica's numerical optimisation functions work for this or is there a simpler ...
1k views

### smooth spline through airfoil coordinates

I am trying to produce a smooth spline curve through a set of airfoil coordinates. An example for the data I am trying to use is here, and I am reading the file like so to get rid of some extraneous ...
446 views

### How to make a natural cubic spline of {{x,y}, ...} data

Consider data = {{0, 0}, {1, 0}, {2, 0}, {3, 1}, {4, 0}, {5, 0}, {6, 0}}; f = Interpolation[data, InterpolationOrder -> 3, Method -> "Spline"]; Then the ...
94 views

### Find the two largest maximums of an interpolating function of a specific shape (fast)

I have an oscillating interpolating function f[x] and I would like to find the x values of the two largest maximums (or even ...
122 views

### Why do some uses of PropertyList crash the kernel?

Bug introduced in 10.1.0 or earlier and fixed in 12.1.0 While looking at the question How to evaluate the "Domain" of an InterpolationObject? I noted that using ...
337 views

### Different results using spline interpolation in Wolfram and MATLAB

I use the same data for interpolation in Mathematica and MATLAB, but the result is different. ...
241 views

### Can I Constrain ListInterpolation by Curvature?

Using image analysis, I have found the positions of a circular ring and imported them as xx and yy coordinates. I am using ...
96 views

### Generating and analyzing an Interpolating function from many interpolating functions: speed up

Is there a clever way to speed up this code? ...
2k views

### Hermite interpolation

The well known Hermite interpolation uses piecewise cubic polynomials and fits the knot values and derivatives. In contrast the Mathematica piecewise Interpolation ...
838 views

### Hermite method in Mathematica

When I solve the example below, in the results it is mentioned that Mathematica 10 has used the Hermite method. I cannot find anything about this in the Mathematica documentation. Is there nothing ...
1 vote
90 views

### NIntegrate 3D Interpolation function in a region extracted from ListContourPlot3D

I have a list of 3D volumetric data points, e.g. for every position in 3D space there is a value. What I want to do is to firstly use "Interpolation" to get a function form of the data f[x,y,z] and do ...
201 views

### How can I make ListDensityPlot show up only in a specified region?

Disclaimer: I am new to Mathematica and this is my first post here! I am trying to plot EEG data of different intensities of brain waves from an FFT to areas of the brain where they were collected. I ...
1 vote
70 views

### Interpolating a density plot

I am solving a complicated series of equations (involving FindRoot and PolyLog), and finally I get this plot Code here: ...
5k views

### Is it possible to compute with the trapezoidal rule by numerical integration?

Is it possible to compute trapezoidal rule numerical integration? I know that Mathematica has Interpolation, and that a list of points can be interpolated and then ...
1 vote
81 views

### How to convert Piecewise function to Interpolation function?

In the following piece of code I am trying to convert a Piecewise function to a simple interpolation function f[t_] ...
213 views

### How to interpolate {{xi,yi},... ,{xn,yn}} with minimum bending energy?

Thin Plate Splines are explained here, and a Mathematica implementation of that for real samples { { x1, y2, z1 }, { x2, y2, z2 }, ... , { xn, yn, zn } } is ...