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 ...
10
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 $...
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. ...
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 ...
6
votes
Accepted
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 ...
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||...
6
votes
If FEM is exact at the nodes, why do first and second-order elements give very different results?
It is not true that the finite element solution is exact a nodes.
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 ...
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)\,\...
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 ...
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{...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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) + \...
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 ...
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 ...
4
votes
Polynomial interpolation on a regular hexagon
Let's use the polar coordinates ($\rho,\theta$), then for the six vertices of the regular hexagon defined by $\rho$=1 and polar angles $\theta_i$ there are the following equations
$
f(\theta_i) =
a_0 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
interpolation × 202finite-element × 28
python × 20
numerics × 19
polynomials × 15
b-spline × 15
finite-difference × 10
scipy × 10
matlab × 9
integration × 8
numpy × 8
quadrature × 8
error-estimation × 7
optimization × 6
algorithms × 6
discontinuous-galerkin × 6
multigrid × 6
grid × 6
linear-algebra × 5
ode × 5
computational-physics × 5
mesh × 5
approximation × 5
pde × 4
fluid-dynamics × 4