I've spent a bunch of time perusing Stack Exchange to try to find an answer and found nothing; hopefully this isn't a duplicate.
I have a time-dependent vector field $\Phi_t(x,y,z)=(x\lambda^t,y\lambda^{-t},z+t)$, $\lambda>1$ arbitrary; for my example, I'm restricting to the region $[0,1]\times[0,1]\times\mathbb{R}$. What I would like to do is:
- fix some $\lambda>1$;
- generate some number of random initial points;
- compute / store the orbits of these points over some length of time;
- plot these orbits in 3D with animation.
I've currently managed to do all of this except animate the flow lines.
Here's my current code:
seeds = RandomReal[{-1, 1}, {250, 3}]; (* 250 random initial points *)
lam = 1.5; (* \[Lambda]>1 fixed *)
func[{x_, y_, z_}, t_] := {x lam^t, y lam^(-t), z + t}; (* the vector field itself *)
orbit[k_] := Table[func[seeds[[k]], n], {n, 0, 9.75, 0.25}]; (* function to compute the orbit for a single initial point *)
orbits = orbit[#] & /@ Range[1, Length[seeds], 1]; (* computes orbits for all initial points *)
Graphics3D[{
{Red, Arrowheads[{-.01, .01}], Arrow[BezierCurve[orbits[[#]]]] & /@ Range[1, Length[seeds], 1]}
}, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, Boxed -> False, Axes -> True, AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}, ViewPoint -> {2.6056479300835718`, 2.1387445365836095`, 0.29388887642263006`}, ViewVertical -> {0.3985587476649791`, 0.332086389794556`, 0.8549090912915488`}, ImageSize -> 400]
This is okay, but what I'd really like is something that can either
- animate one entire flow line a little at a time, then the next flow line a little at a time, etc. (in the same plot); or
- animate all flow lines simultaneously, a little at a time.
Can anyone help me with this?
Note: By defining an auxiliary function buildorbits[k_,n_]:=orbits[[k, 1 ;; n]];
, I can animate single orbits using a very "hackish-feeling" implementation of ListAnimate
. For instance:
; is this really my best option, though?