I'm am using radial basis functions to interpolate magnetic fields, which are divergence free. I have found several research papers that state that the following takes a scalar valued Radial Basis Function (RBF) and turns it into a divergence-free matrix valued RBF:
\begin{equation} \Phi(x) = \{ \nabla \nabla^T - \nabla^2 I \} \Psi(x), \quad \quad ( 1 ) \end{equation}
where $\Psi$ is scalar valued and I is an identity matrix
According to these papers, and assuming we are using a gaussian RBF: $ \Psi(r) = e^{-\epsilon r^2}$, where $\epsilon$ is the scaling factor. In two dimensions with $ r^2 = x^2 + y^2 $, equation (1) yields
$ \Phi_{11} = -( 4 \epsilon^2 y^2 - 2 \epsilon )e^{- \epsilon r^2} $
$ \Phi_{12} = 4 \epsilon^2 x y e^{- \epsilon r^2}$
$ \Phi_{21} = \Phi_{12}$
$ \Phi_{22} = -( 4 \epsilon^2 x^2 - 2 \epsilon )e^{- \epsilon r^2} $
My first question is how do you arrive at this result? If we just focus on $\Phi_{12}$, which should just be the product of two partial derivatives, I get:
$$ \Phi_{12} = \frac{\partial \Psi(r)}{\partial x} * \frac{\partial \Psi(r)}{\partial y} $$ $$ = ( -2 \epsilon x e^{- \epsilon r^2} ) * ( -2 \epsilon y e^{- \epsilon r^2} ) $$ $$ = 4 \epsilon^2 xy e^{-2 \epsilon r^2} $$
My next question is once we arrive at the matrix valued RBF, how do you prove that it is divergence free? Since the x/y components at each point in the resulting vector field are a sum of the RBF "weights" multiplied by constants, shouldn't we be able to just take the matrix valued RBF and calculate its divergence? It should show that $ \nabla \cdot B = 0 $
In regards to the first question, my confusion was that $ \nabla \nabla^T $ actually translates to the hessian. So the matrix valued RBF would be evaluated as:
$$ \Phi(x) = \left[ \begin{matrix} \frac{\partial^2 \Psi(r)}{\partial x^2} & \frac{\partial^2 \Psi(r)}{\partial x \partial y} \\ \frac{\partial^2 \Psi(r)}{\partial y \partial x} & \frac{\partial^2 \Psi(r)}{\partial y^2} \\ \end{matrix} \right] - \left[ \begin{matrix} \nabla^2 \Psi(r) & 0 \\ 0 & \nabla^2 \Psi(r)\\ \end{matrix}\right] $$
As for the second question, since the resulting vectors are a linear combination of a matrix valued RBFs and the weights, you only need to prove that one single matrix-valued RBF is divergence-free.
$$\left( \frac{\partial \Phi_{11}}{\partial x}+ \frac{\partial \Phi_{21}}{\partial x} \right) + \left( \frac{\partial \Phi_{12}}{\partial y}+ \frac{\partial \Phi_{22}}{\partial y} \right) = 0$$