Questions tagged [interpolation]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
42 views

Numeric Integration of a numerical function

I am trying to solve this integral numerically: $$F(s)=\int_{t1}^{s}e^{-B|s-t|}\rho_{12}(t)dt$$ where $t1\leq s\leq t2$ and $\rho_{12}(t)$ is the element of density matrix $\rho(t)$, which can be ...
5 votes
3 answers
172 views

How to combine and plot interpolating functions defined over two different ranges

I have defined interpolating functions over two different ranges. ...
  • 441
1 vote
1 answer
115 views

Why does the derivative of an InterpolatingFunction fluctuate so much?

...
  • 24.6k
3 votes
2 answers
121 views

Find the inverse of Interpolating function from NDSolve

I have a system of differential equations that I have numerically integrated to produce solutions. See below: ...
  • 39
3 votes
1 answer
281 views

What is the equivalent of Python's 'interp1d' in Mathematica?

I am new to Mathematica, and I am trying to extrapolate some data points. In Python, I can easily do that using interp1d. See below: ...
0 votes
1 answer
58 views

Trouble with imported data

I have a multivariable function, I want to produce the data of that function, export the data and use the data for later purposes. However, the imported is not recognized as data. Here is an example: ...
  • 99
0 votes
0 answers
38 views

Error using Interpolate in FindRoot

I would like to Find the eigenvalues of the following functions using Interpolate function, but unfortantly it's not working correctly. Apparently the interpolation is failing to predict the values ​​...
  • 53
1 vote
2 answers
134 views

Use Wolfram Alpha to build an exponential curve that passes through 4 points [closed]

How can I build a function using Wolfram Alpha that passes through these 4 points? {0, 100}, {1, 30}, {7, 6}, {28, 3} The result I am seeking is a curve with the ...
  • 111
0 votes
1 answer
66 views

How to optimize code for obtaining large data set?

In an application, I need to find a region where some conditions must be true. However, these conditions are made of interpolating function solved by ParametricNDSolve. I will give a toy model example ...
  • 1
3 votes
2 answers
179 views

Need help to speed up the Gaussian quadrature

I am trying to compute the $L_2$-norm of the solution $y(z,t)$ of a PDE with Gauss quadrature using the following code, where $z$ is space position and $t$ is time, then to construct it as a function ...
  • 773
8 votes
4 answers
649 views

How can I find the inverse of an interpolating function?

I am numerically solving the coupled differential equations (for $t[\tau]$ and $r[\tau]$) below. Mathematica outputs two interpolating functions as solutions. I would like to invert one of these ...
  • 81
6 votes
1 answer
169 views

Convert interpolating function to a Bezier curve

I've been wondering, is there a way to convert an interpolation into a sequence of BezierCurve objects that form each step in the interpolation? There is an easy ...
  • 222k
1 vote
1 answer
133 views

"Spline" interpolation not working

I have the following sample data ...
3 votes
1 answer
57 views

How do I get the complex conjugate of my interpolation?

I import an interpolation from C++ into mathematica which I then modify. Is there a way to obtain the conjugate of the interpolation? Or do I need to use $(f g)^* = f^* g^*$ and export the conjugated ...
  • 1,143
0 votes
0 answers
36 views

Is the integration feature of an interpolated plot/function supposed to have a much larger maximum and range values in general?

So, I have imported data from a software called NextNano, plotting electron density. My first step was to define the data within the desired domain data={,},.... ...
2 votes
2 answers
155 views

Getting fluctuations in the derivative of interpolated functions [closed]

The code I use is as follows ip = Interpolation[data, InterpolationOrder -> 3]; Plot[{ip[x], ip'[x], ip''[x]}, {x, 0.05, 0.5}] I get fluctuations for the first ...
4 votes
4 answers
260 views

Best way to smooth, interpolate and differentiate over a list of data

I have a list given by: ...
0 votes
0 answers
70 views

Interpolation with duplicate points

I have a set of data here I plotted and defined a list to only count a specific range of values. However my interpolation failed because there are duplicates of numbers in the data set. I had ...
1 vote
0 answers
88 views

How does Mathematica's B-Spline NURBS work?

I'm finding that Mathematica is getting hung up on a numerical integration and I suspect I can do it faster myself in C++. I can scoop the control points of the BSplineFunction out of the ...
3 votes
1 answer
223 views

Geogebra spline command in Mathematica

Spline(pts, order, Weight Function) Creates a spline with given order through all points. The weight function says what should be the difference of t values for point $P_i$ and $P_{(i+1)}$ given ...
  • 4,994
6 votes
1 answer
104 views

Are derivatives from interpolating functions created by NDSolve using derivatives of the spline or numerics from solving DE

For example given the code: ...
  • 707
6 votes
1 answer
141 views

Understanding Interpolation with Cubic Splines

My ultimate question: given data, what function is Interpolation with Method->"Spline" creating? I recall from my ...
  • 1,715
1 vote
0 answers
70 views

FunctionInterpolation with some datapoints to start with [closed]

Motivation: I am using FunctionInterpolation[COMSOL[x]] in combination with COMSOL to search for the interpolation of my COMSOL model. COMSOL needs a lot of time to ...
0 votes
0 answers
71 views

I am unable to plot 3D graph of integral function

I am not able to solve this integral ...
1 vote
0 answers
45 views

Can I make a VectorPlot with a domain defined by an InterpolatingFunction?

I'd like to plot a vector field in a custom domain; I can do this using ImplicitRegion and a straightforward function. However, when I replace the function with an InterpolatingFunction I get a ...
2 votes
0 answers
178 views

Call function defined in Mathematica from Matlab [closed]

Is it possible to call a defined function inside Mathematica like InterpolationFunction[...] from Matlab? Thanks!
1 vote
1 answer
95 views

Difference in interpolated data derivative and analytic function

I am trying to calculate the derivative of interpolated data but it behaves differently from the analytic solution. Detailed code that I have used follows: ...
0 votes
2 answers
64 views

Continuous partial derivative of an interpolated function

I know the values for a function v[x,y] on an irregular grid of (x,y) points. Call the table storing all these points xyvtriples. Because of the irregular grid, the Mathematica function ...
  • 23
2 votes
2 answers
133 views

Finding the minimal distance of a point from an interpolated function

I have an interpolating parametric function (solution of a set of differential equations) and I have an external point. I would like to find the minimal distance between this point and the ...
  • 403
0 votes
0 answers
20 views

Interpolating function error: stack trace value and notebook give different values for the out of bound inputs

So, I get the input out of bound error, in the notebook out put. ""Input value {3.,1.5708,3.14159} lies outside the range of data in the interpolating function." Values {3,Pi/2,Pi}. ...
1 vote
1 answer
76 views

Interpolation Function is not saved in notebook

I get the following message when an interpolation function is generated as a solution of NDSolve: I don't know why this warning is showing and I don't find anywhere where I can consult what this ...
  • 51
1 vote
0 answers
61 views

Interpolation problems for {X,Y,Z} data

I have some data in the form of {{X,Y},Z} that i want to interpolate for Z. (X takes the values from 0 to 40 and Y from 0 to 50000 and Z is from -10 to +10 and the data I have, have integer values of ...
  • 11
1 vote
0 answers
99 views

Smooth Interpolation Between Curves

I'm interested in finding a way to smoothly interpolated between graphics curves (and possibly shapes as well). My current solution is not very elegant ...
0 votes
0 answers
41 views

rotation and interpolation of x, y coordinates and displacement data

I have x, y coordinates and displacement values at these points as shown in figure. For instance if I select one point (A), I want to get the coordinates of B, which is rotated 120 degrees and find ...
  • 1
6 votes
1 answer
144 views

Fast integration of ElementMeshInterpolation[]-functions

In this simplified example I consider a small FEM-mesh ...
1 vote
0 answers
56 views

Why do the two interpolation behave not the same?

I was trying to give the interpolation of a function $f(x)=1/(1+25x^2)$, then I met the problem below: As I want to see the behavior as the interpolation order became bigger, I set it progressed. And ...
  • 188
1 vote
0 answers
128 views

How to evaluate an Integral which has Interpolating functions

I am trying to evaluate an Integral which has products of Interpolating functions inside, using NIntegrate command. It gives a wrong answer. The code that I used for performing this task is given ...
  • 583
5 votes
2 answers
233 views

Exporting data from a simply generated interpolating function

The question referenced in the link here has a title that matches my question, but the discussion is very complex and does not seem to address my issue. I have solved a partial differential equation ...
10 votes
1 answer
203 views

NIntegrate can't handle InterpolatingFunction produced by FiniteElement properly?

Bug introduced in 12.3.1 or earlier and fixed in 13.1.0 This is a problem comes out in the discussion here and I think it's worth posting a new question for it. Consider the following sample: ...
  • 55.1k
3 votes
3 answers
223 views

How to get derivative of 2D data that is randomly stored in x and y?

I have 2d data in the form {x,y,f(x,y)} which is randomly stored. the random {x,y} for specific shape (square for ...
0 votes
2 answers
103 views

Problem with multidimensional interpolation: "Data point {0,0} contains abscissa 0, which is not a real number"

I'm trying to do a multidimensional interpolation. For simplicity, say I have the following array: {{{a,b},c},{{d,e},f},{{g,h},i}} This means that I have a two-...
  • 618
3 votes
1 answer
139 views

Interpolate a discrete vector field based on vectors which are not on a grid

I have a discrete set of vectors (in 2D), which I would like to use to construct an interpolating vector field. The vectors, however, are not located on an integer lattice and so the answer given at ...
  • 203
0 votes
0 answers
41 views

2D interpolation after numerical integration

I have a function which is a result of NIntegrate and is a function of two variables. Is it possible to interpolate this function by using the above result form the ...
  • 43
0 votes
0 answers
52 views

interpolation with order zero seems to be shifted to the right [duplicate]

I'm trying to set up an InterpolatingFunction, that would be a step function. I have a series of x and ...
3 votes
2 answers
169 views

How to get "x" value from a interpolating function?

I measured a parameter over time and get this List: (where fisrt value (x) is time and second the value (y) the vale of the parameter) ...
  • 61
0 votes
1 answer
55 views

SphericalPlot the first two column as theta phi, and the third one as color from a n*3 matrix

I'm very new to Mathematica. I'm trying to spherical plot a sphere from an n-row, 3-column matrix. The radius is a constant, the first and second columns are theta and phi of the points, and the last ...
  • 1
3 votes
1 answer
111 views

How to use ConvexOptimization on a function constructed from data?

Given the following data points sampled from a convex function, how could I construct a convex function that can be minimized using ConvexOptimization? ...
  • 332
4 votes
1 answer
79 views

NIntegrate over eigenfunctions found using NDEigensystem

...
  • 664
2 votes
0 answers
86 views

Multi-dimensional interpolation of unstructured array returns unevaluated

Interpolation should work fine on an unstructured array of machine numbers with interpolation order 1. However, when both the arguments and output are multidimensional, it doesn't evaluate. The first ...
  • 1,073
0 votes
2 answers
74 views

How to make integrals of interpolated matrices constructed by other interpolated quantities?

I have the following code producing an interpolated unitary matrix: ...
  • 55

1
2 3 4 5
19