I was checking the unity condition on a smoothing kernel for SPH, however I don't understand why the integral is not giving 1.

The kernel function is $\displaystyle W(||\vec r||,h) = \frac{315}{64\pi h^8}(h^2-r^2)^3$ if $0 \leq ||\vec r|| \leq h$

I tried to approximate the integral with the following matlab code

W = @(r) (r >= 0) .* (r <= 1) * 315/(64*pi*1^4) .* (1^2-r.^2).^3;

where $h=1$ and the result is $0.7162$

What am I doing wrong and what is the purpose of having a kernel whose integral is unity, i.e. normalized?


1 Answer 1


The purpose of having a smoothing kernel with integral 1 is typically that when you have a point particle at position $x_0$ with the density function $\delta(x-x_0)$, the smoothing kernel replaces that density with $W(\|x-x_0\|,h)$. In other words, it smoothes out the Dirac delta function. Since the integral of the Dirac delta function is 1, the integral of the smoothed function also better be one.

The integral $\int_{R^3}\delta(x-x_0)\,dx = 1$ counts the number of particles you have (just one). Choosing a kernel with the wrong integral "creates" or "destroys" particles.

The integral is taken over the whole space, $$ 1 = \int_{\mathbb{R}^3} W(\|x\|,h)\,dx = 4\pi \int_0^h W(r,h)\,r^2dr, $$ using spherical coordinates. In your case, the integral is $$ 4\pi\int_0^h \frac{315}{64\pi h^8}(h^2-r^2)^3r^2\,dr = h, $$ while this should be $1$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.