# Questions tagged [interpolation]

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

784 questions
Filter by
Sorted by
Tagged with
51 views

### Semi-periodic Interpolation

I have a set of data, e.g. damped waves in a finite box of size L, so that the data is periodic in space but not time. At a particular instant in time, i.e. taking a cross section of ...
71 views

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

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

### Why FEM not giving output at the boundary

I am trying to solve simple 3D Poisson's equation of thermal conduction due to heat generation (q) in a spherical composite, where from 0 to a (inner radius) conductivity is k1 and from a to b (outer ...
28 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 ...
257 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 ...
44 views

### Plot function approximated by Newton interpolation not being displayed

I am totally new to Mathematica and I was trying to compile this algorithm that is in our student's manual. I tried different attempts also, but without any luck: ...
200 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: ...
43 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 ...
181 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 ...
112 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. ...
32 views

### lookup table data with interpolation from reference list

I have data as: ...
70 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) /(...
309 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 ...
308 views

### Adding Regularisation to Built-in Interpolation function

tl;tr; How to improve performance of regularised Interpolation? Context Since Version 12, Mathematica now incorporates a range of (underrated IMHO) ...
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 ...
47 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. ...
180 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? ...
27 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: ...
43 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 ...
79 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 ...
97 views

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

1.Trying to add an interpolated function to neural networks. ...
46 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.) ...
38 views

### Finding the inverse of possibly non-invertible interpolation function

Consider the following sample code pts = Table[{i, i^2}, {i, -10, 10}]; foo = Interpolation[pts]; Plot[InverseFunction[foo][y], {y, 0, 10}] From the plot, we see ...
92 views

### Plotting Basis Order function

Does anyone know how could I plot the basis order functions for the following function (code below)? An example of what I should expect is https://en.wikipedia.org/wiki/Lagrange_polynomial#/media/...
42 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 ...
17 views

### Interpolate and integrate data with error messages

If I have the following code, where cp74[j] represents a very long list (e.g. {{a,b}{c,d},{e,f},{g,h},...} for different j values. ...
66 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 ...
34 views

### How to implement Extrapolation with order 0

I have data in format like below. { {{v1,v2,v3,v4,v5,v6,v7},{t1,t2,t3,t4,t5,t6,t7,t8}}, {{v1,v2,v3},{t1,t2,t3}}, {{v1,v2,v3,v4,v5},{t1,t2,t3,t4,t5}}, ... } With ...
33 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 ...
149 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 ...
46 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 ...
32 views

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

I've got an interpolation function: ...
36 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 ...
58 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): ...
35 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 ...
72 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 ...
56 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 ...
46 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 ...
36 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 ...
161 views

### Creating a numerical table of values and using an interpolation of them to transform pixels in an image by the ImageTransformation command

I am trying to carry out point "Implementing Map" on this paper Interstellar wormholes however I am using my own equations not those given (only the same method). I have generated a list of ...
41 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 ...
853 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 ...
96 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 ...
51 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 ...
105 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 ...
161 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. ...
189 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 ...