What is the noise / equation used in this vector field animation?

127 Views Asked by At

I was looking the Divergence and curl: The language of Maxwell's equations, fluid flow, and more 3Blue1Brown video and at 0:55 there is a really beautiful animation of the vector field that looks a bit like wind over a field but I have no idea of what could be behind it? Is it some sort of noise generator?

1

There are 1 best solutions below

4
On BEST ANSWER

This is more of a complement to the question, rather than a complete answer:

If you look at the animation carefully, the tip of the vectors is following some sort of an ellipse-like (not an ellipse) trajectory, while its centre is stationary at each coordinate. The tip's trajectory can be defined as:

$$ (r, \theta) = (\sqrt{2}\sin(k_rT + \phi_r), k_t t + \phi_t)$$

Since both angle and radius seem periodic with time. Also, as the max radius occurs at the same orientation always, we have $k_t$ = $k_r$. Now, these k's and $\phi$'s are a function of the coordinate it is on.

There seems to be around 30 vectors along each row and 16 along each column, and the rotation seems to vary linearly. I do not think it follows any physical phenomena. However, the reason it may look like waves/wind is that the phases and the angular velocity ($k_r=k_t$) of each vector are varied in small increments.

Finally, since the source code says that 3b1b made this particular animation externally(;-;), I made a tool for the interested reader to play around with(for 16x20 arrows, and it's in glsl). I haven't yet made the arrows follow the locus written above to get some more intuition about the patterns.

I observed that you can make simple linear and radial waves (and their combination) by adding them as different phases or sinusoids. You could get some interesting results by trying superpositions or better functions to model $k$'s and $\phi$'s.


Edit: (it's closer to an answer now)

Okay so I tried modelling the tip more like an ellipse and it gave much better results. It would be fair to assume all of the trajectories are exact ellipses(including $b\rightarrow 0$ & a). The hence becomes, $$ r = \frac{b}{\sqrt{1-(e\cos{(\theta+\phi_r)})^2}}, \text{ and, }\theta = k t + \phi_t$$

where b and e are the minor axis and eccentricity respectively.

This time, I'll give some more intuition about the variables:

  1. $\phi_r$ changes the angle an ellipse is inclined at. Since almost all of the arrows look like they achieve a maximum at $(2k+1)\pi/4$, I suggest keeping this fixed.
  2. $\phi_t$ changes the rotation phase, so two arrows with $\phi_t$ 0 and $\pi/2$ resp. should be perpendicular to each other.
  3. a, b are the major and minor axes of the ellipse. Putting b very close to zero makes it go in a straight line. Making a and b equal will just make it a circle.

Interesting patterns emerge when you set $\phi_t$ & $k$ as some function of space. This is what I get if I put $$ \phi_t = |x+y|+|x-y| $$ and $k \in \{1, -1\}$ randomly:

enter image description here

The tool has some other, more complicated, functions as well. But the point is by changing $\phi_t$, we can make some waves following the same equation. Now all we need to do is find out what exact function does it look like.