Skip to main content
14 votes

Example of a continuous function that is difficult to approximate with polynomials

Why not simply show the absolute value function? Approximation with e.g. Legendre-polynomial expansion works, but pretty badly: Taylor expansion is of course completely useless here, always giving ...
leftaroundabout's user avatar
10 votes

Example of a continuous function that is difficult to approximate with polynomials

It's a pathological case, but you can always resort to the Weierstrass monster function. It illustrates a broader point, namely that functions that are not smooth -- e.g., that have a kink -- are ...
Wolfgang Bangerth's user avatar
9 votes
Accepted

Interpolating a mathematical function using a Hermite Cubic Finite Element Space

Short answer You are missing the Jacobian of the transformation for the derivatives. Long answer The conditions that you propose for your interpolator translate into the following system of ...
nicoguaro's user avatar
  • 8,510
8 votes

Interpolate the orbital coordinates of an object using coordinates and velocities vector

That depends on how well you know the coordinates and velocities. If you have exact values, you can get a reasonable answer using Hermite interpolation. This will give you a degree-3 polynomial in ...
Daniel Shapero's user avatar
7 votes

Fourier transform by FFT : by using cubic splines to interpolate between data points, do we change the frequency content of the Fourier transform?

The frequency content of the interpolated signal is significantly influenced by the interpolation basis. If you have a band-limited function that you have adequately sampled (i.e. satisfying Nyquist ...
coolguy1000000's user avatar
7 votes
Accepted

What are the benefits of using machine learning for interpolation over traditional interpolation methods?

First of all, interpolation and approximation are slightly different from each other. Given a sufficiently smooth function $f$ (sufficiently smooth just means that I am covering my bases, there are ...
Abdullah Ali Sivas's user avatar
7 votes

What is the difference between $u_h$ and $I_h(u)$ in finite element literature?

The other answer has everything you already need, but it's also worth pointing out that $u_h$ is computable whereas $I_hu$ is not: The latter requires you to know the exact solution, which in general ...
Wolfgang Bangerth's user avatar
6 votes

Fourier transform by FFT : by using cubic splines to interpolate between data points, do we change the frequency content of the Fourier transform?

The interpolation indeed affects the Fourier transform. @Steve already gives the correct answer in general, but I want to give you an example that helps the intuition more. Think for example that you ...
Wolfgang Bangerth's user avatar
6 votes
Accepted

Interpolation with the roots of orthogonal polynomials & Spectral expansion

I hope I understood the question correctly. They try to compute exactly the same thing, so they really are equivalent. I'll use Chebyshev polynomials because they are easy to analyze. Given a ...
Kirill's user avatar
  • 11.4k
6 votes
Accepted

Parametrized spline - oscilating second derivative

Your choice of parameterization is creating problems. Instead of spanning one in $t$ between points, span an amount proportional to the line segment between the two points in $(x,y)$ space. I've ...
LedHead's user avatar
  • 1,253
6 votes
Accepted

Evaluating an integral numerically at many points

The point of @WolfgangBangerth is exactly what I mentionend in my comment, so I'd always try this first. In the best case, with millions of partitions $[a_{i},a_{i+1}]_{i\in \{0,\ldots,N-1\}}$ (where $...
davidhigh's user avatar
  • 3,127
6 votes

Example of a continuous function that is difficult to approximate with polynomials

Approximation is not only made hard by the function to be approximated but by the interval in which the approximation should be a "good fit". And you should define the measure for a "good fit", i.e. ...
GertVdE's user avatar
  • 6,179
6 votes

Example of a continuous function that is difficult to approximate with polynomials

Polynomials are surprisingly effective at function approximation [1]. If you have at least Lipschitz continuity, then Chebyshev approximations will converge. Of course, convergence may be slow, and ...
cfdlab's user avatar
  • 3,028
6 votes

Get the roots of a Hermite interpolating polynomial

The interpolated polynomial does not have roots. Considering that the behavior outside the interpolation region holds is termed extrapolation. You can explicitly use the polynomial, given by (as I ...
nicoguaro's user avatar
  • 8,510
6 votes

What is the difference between $u_h$ and $I_h(u)$ in finite element literature?

Let's assume $u$ is the solution to the variational problem and $u_h$ is the Galerkin approximation of the solution on the subspace $V_h \subset V$. By Cea's lemma you have: \begin{equation} ||u-u_h||...
Pepe's user avatar
  • 459
5 votes

Barycentric interpolation equivalent for irregular hexahedra

A hexahedron with straight edges is the image of the unit cube under a trilinear mapping. So, if you have values on the eight vertices of a hexahedron, and you are asking to interpolate between them ...
Wolfgang Bangerth's user avatar
5 votes

What are these oscillations?

I want to mention another idea in case it helps. The truncation error of replacing $\int_{-\infty}^{\infty}$ with $\int_{-L}^L$ is on the order of $$\begin{aligned} \int_L^\infty \cos(tx)g(x)\,\...
Kirill's user avatar
  • 11.4k
5 votes
Accepted

Interpolation of function onto mesh gives different results, depending on mesh density

You assume that a property that holds for the original function $f$ is also true for the $L_2$ projection $u_h=P_h f$. In your case, the property is that if $f$ is non-negative, then $u_h$ should also ...
Wolfgang Bangerth's user avatar
5 votes

Interpolating the gradient of a cylindrically symmetric potential field expected obey the Laplace equation, especially near/across r=0

Provided that your geometry conforms to the cylindrical coordinate system, the separation of variables solution should look something like $$ \Phi(\mathbf{r}) = \sum_{n,m} a_{nm} \left\lbrace \begin{...
smh's user avatar
  • 663
5 votes
Accepted

At which stage to interpolate?

This will implicitly depend on your function, $F$, as well as the method you used to derive your $f$ and $g$. If your $F$ were, say, the constant function $F(y,z)=1$, then you'd be guaranteed to have ...
origimbo's user avatar
  • 2,249
5 votes

Polynomial interpolation on a regular hexagon

Since you are trying to find the gradient of the function in the vertices of a triangular mesh. So, we are considering an interpolation over the dual mesh defining the value on each centroid, you can ...
Subhendu Chakraborty's user avatar
5 votes

Which way is the right way to compute the integrals in finite element methods?

Quadrature and replacing the integrand by a polynomial are identical. That is how quadrature rules are derived. To see why this is true remember that quadrature evaluates the integrand at only a ...
Wolfgang Bangerth's user avatar
5 votes

If FEM is exact at the nodes, why do first and second-order elements give very different results?

They should both converge to the same limit solution, but are expected to do so at different rates of convergence. The best way to verify the convergence rates is to use a test-setting with known ...
MPIchael's user avatar
  • 2,935
5 votes
Accepted

Quintic Hermite shape functions

I mentioned how to do it for cubic polynomials in a previous answer. And has an expanded version in my blog. You can do the derivation in global coordinates and obtain the following global basis ...
nicoguaro's user avatar
  • 8,510
4 votes
Accepted

Derivation in the FEM method

The basis functions seem to be piecewise linear with $\phi_i(x_j) = \delta_{ij}$, so $$ \phi_i(x) = \begin{cases} \frac{1}{h_{i-1}}(x-x_{i-1}) \qquad &x\in[x_{i-1},x_i]\,,\\ \frac{-1}{h_{i}}(x-x_{...
Steve's user avatar
  • 541
4 votes

How does Matlab `surf` perform interpolation?

I assume you are interested in how the surf function controls the coloring of the surfaces. Most of the information is readily available at the Matlab help pages ...
Anton Menshov's user avatar
  • 8,672
4 votes
Accepted

Interpolate the orbital coordinates of an object using coordinates and velocities vector

You can interpolate values between $[a, b]$ using Hermite interpolation. You first map the interval $[a, b]$ to $[-1,1]$, and the values are computed as: $$f(x) \approx N_1(x) f(a) + N_2(x) f(b) + \...
nicoguaro's user avatar
  • 8,510
4 votes

How to reconstruct a 2D field from its integral?

There are infinite functions that have the same integral over a given domain, so you would need to make assumptions on the type of functions that you want to allow. The easiest approach that comes to ...
nicoguaro's user avatar
  • 8,510
4 votes

What are the best ways to interpolate a vector field inside (convex) polygons?

Let me try and break the problem down into two steps. Step 1: You have a polygon (one cell of your mesh) and you have scalar data $d_i$ associated with each vertex $\mathbf x_i$ of that polygon. You ...
Wolfgang Bangerth's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible