I am attempting to create an interactive animation using Manipulate[]
that allows me to move a point(or small sphere) around in a vector field to illustrate divergence. As it moves through the vector field I would like the point (or sphere) to animate by repeatedly expanding or contracting at a rate proportional to the divergence at that point.
With this, my students will be able to see whether the divergence is positive (pulsating outward) or negative (pulsating inward) at that point. They will also have a rough idea of the magnitude of the divergence by noticing relative speed of the pulses.
Here is my base code.
Manipulate[
Show[VectorPlot3D[{x^2, y, z}, {x, -3, 3}, {y, -3, 3}, {z, -3, 3},
VectorStyle -> {"Arrow3D", Opacity[.3]}, VectorPoints -> 5,
VectorScale -> {1/5, 1/5, Automatic}, Boxed -> False,
AxesOrigin -> {0, 0, 0}],
Graphics3D[{Red, PointSize[Large], Point[{xp, yp, zp}]}]], {xp, 0,
3}, {yp, 0, 3}, {zp, 0, 3}]
I'm guessing I need to animate the Pointsize[]
to either expand or contract. And I should do this at a speed proportional to the divergence at its location. But I'm not sure how to do this. And not sure how to do an animation that repeatedly pulses. Or maybe I should go about this differently my using the Sphere primitive in Graphics3D
?
For reference (From the Briggs Calculus Text), I would like my animation to look something like this.