Find an expression of the direction field

166 Views Asked by At

I have a directions vector field which I got empirically using quiver in Matlab. I want to find some analytical expressions that might work at least in part of the direction field. How can I find/propose some candidate analytical differential equations $f'(x,y)$? Is there a kind of catalog out there from which I can draw and see?

It's a big field, but here's a partial view of it:

enter image description here

Thanks!!

1

There are 1 best solutions below

20
On BEST ANSWER

A common method for fitting an analytical scalar field $F(\textbf{x})$ (in any dimension) to a vector field of (potentially noisy) derivatives is to expand the field in a radial basis function

$$ F(\textbf{x}) = \sum_i a_ie^{-|\textbf{x}_i-\textbf{x}|^2/2\sigma^2} $$

where you pick a grid of centres $\textbf{x}_i$. Then you can find the $a_i$ and $\sigma$ that optimise the fit to the gradients (it involves a simple matrix inversion). See here for useful reading.

Here are the details:

  • Pick a grid of $n$ points $\textbf{x}_i$ that cover the space you're interested in. It's wise to make them the most dense-packing possible. So in 2D they would form a hexagonal lattice, in 3D they would be face-centered cubic, etc. The $\sigma$ parameter will equal the lattice parameter of this grid.

  • We'll denote the 'measurements' of $\nabla F(\textbf{x})$ at each of the lattice points as $\textbf{G}_i\equiv \nabla F(\textbf{x}_i)$.

  • All we need to do is find the vector $a=(a_1,...,a_n)$ that minimises the metric

$$ E(a)= \sum_{k=1}^n \Bigg|\textbf{G}_k- \sum_{k'=1}^n a_{k'}\nabla e^{-|\textbf{x}_k-\textbf{x}_{k'}|/2\sigma^2}\Bigg|^2 $$

  • This metric is minimised when $$ Ba=c $$ where the matrix $B$ is \begin{align} B_{k,k'}&=\sum_{k''=1}^n \nabla e^{-|\textbf{x}_k-\textbf{x}_{k''}|/2\sigma^2}\cdot\nabla e^{-|\textbf{x}_{k''}-\textbf{x}_{k'}|/2\sigma^2}\\ &=\sum_{k''=1}^n \Lambda_k^{k''}\cdot\Lambda_{k''}^{k'} \end{align} and the vector $c$ is \begin{align} c_k &= \sum_{k'=1}^n \nabla e^{-|\textbf{x}_k-\textbf{x}_{k'}|/2\sigma^2}\cdot \textbf{G}_{k'} \\ &=\sum_{k'=1}^n \Lambda_k^{k'}\cdot\textbf{G}_{k'} \end{align} where, to simplify things, I've defined the vectors

$$ \Lambda_i^j\equiv\nabla e^{-|\textbf{x}_i-\textbf{x}_j|^2/2\sigma} = -(\textbf{x}_i-\textbf{x}_j)\sigma^{-2}e^{-|\textbf{x}_i-\textbf{x}_j|^2/2\sigma} $$

  • The implementation is a bit easier and more efficient if you precompute the tensor $\Lambda$ before constructing $B$ and $c$.

  • Finally, you find $a$ by applying linsolve to $B$ and $c$.