Animate flow lines of time-dependent 3D dynamical systemHow can I create a fountain effect?Creating a Dynamic Time Index Slider for List Animate PlotCreate a point on a phase portrait and draw a trajectory flow following the vector lines by time-passingSpeed of flow of time in Dynamic ClockGauges
Heyawacky: Ace of Cups
What is the question mark?
What does 〇〇〇〇 mean when combined with おじさん?
Output with the same length always
What allows us to use imaginary numbers?
Will some rockets really collapse under their own weight?
Expressing a chain of boolean ORs using ILP
Why does "auf der Strecke bleiben" mean "to fall by the wayside"?
Airline power sockets shut down when I plug my computer in. How can I avoid that?
Typesetting "hollow slash"
How to mock ApexTestQueueItem, AsyncApexJob, and ApexTestResult for test coverage?
Meaning of だけはわからない
Why do we use low resistance cables to minimize power losses?
Java methods to add and authenticate users in MySQL
Has there ever been a truly bilingual country prior to the contemporary period?
Is this really better analyzed in G minor than in Bb?
Did Michelle Obama have a staff of 23; and Melania have a staff of 4?
How to render "have ideas above his station" into German
Can I use my OWN published papers' images in my thesis without Copyright infringment
Doesn't the speed of light limit imply the same electron can be annihilated twice?
Has the speed of light ever been measured in vacuum?
Quick destruction of a helium filled airship?
What are some tips and tricks for finding the cheapest flight when luggage and other fees are not revealed until far into the booking process?
Attacking the Hydra
Animate flow lines of time-dependent 3D dynamical system
How can I create a fountain effect?Creating a Dynamic Time Index Slider for List Animate PlotCreate a point on a phase portrait and draw a trajectory flow following the vector lines by time-passingSpeed of flow of time in Dynamic ClockGauges
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
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)=(xlambda^t,ylambda^-t,z+t)$, $lambda>1$ arbitrary; for my example, I'm restricting to the region $[0,1]times[0,1]timesmathbbR$. 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]
Here's the output:
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?
graphics3d dynamic animation experimental-mathematics
$endgroup$
add a comment |
$begingroup$
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)=(xlambda^t,ylambda^-t,z+t)$, $lambda>1$ arbitrary; for my example, I'm restricting to the region $[0,1]times[0,1]timesmathbbR$. 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]
Here's the output:
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?
graphics3d dynamic animation experimental-mathematics
$endgroup$
$begingroup$
Is capital Phi the vector field or the flow? You say vector field, but you never integrate it; instead, it seems to be used to compute the "orbit" (= trajectory?) of the seed points, as if it were the flow.
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2 - When I said vector field, I mean vector field in the sense of a map from $mathbbR^m$ to $mathbbR^n$ for some $m,ngeq 1$. I'm not sure if this is standard terminology, but to me as far as I'm concerned: For each $t_0$, $Phi_t_0$ ($Phi$ evaluated at time $t=t_0$) is a "vector field," and the family $t_0inmathbbR$ is a "flow".
$endgroup$
– cstover
7 hours ago
$begingroup$
A "flow" is a function $Phi_t(x,y,z)$ that gives the position at time $t$ of the particle that started at the point $(x,y,z)$. Formally, it is a vector field in the way that coordinates are vectors. The flow of a vector field $F$ satisfies $partial_t Phi_t = F$ at all $(x,y,z)$ and $t$ if $F=F(x,y,z,t)$ is time-dependent. So that a "flow" is related to a "vector field," and I think it is traditional to keep the terms separated. I was asking whether your vector field was more like the flow $Phi$ or the vector field $F$. I think you're saying it's the flow. Thanks.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2 - I think you're right. Thanks for explaining! I appreciate any chance to clear up gaps in my understanding.
$endgroup$
– cstover
7 hours ago
add a comment |
$begingroup$
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)=(xlambda^t,ylambda^-t,z+t)$, $lambda>1$ arbitrary; for my example, I'm restricting to the region $[0,1]times[0,1]timesmathbbR$. 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]
Here's the output:
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?
graphics3d dynamic animation experimental-mathematics
$endgroup$
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)=(xlambda^t,ylambda^-t,z+t)$, $lambda>1$ arbitrary; for my example, I'm restricting to the region $[0,1]times[0,1]timesmathbbR$. 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]
Here's the output:
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?
graphics3d dynamic animation experimental-mathematics
graphics3d dynamic animation experimental-mathematics
asked 8 hours ago
cstovercstover
537 bronze badges
537 bronze badges
$begingroup$
Is capital Phi the vector field or the flow? You say vector field, but you never integrate it; instead, it seems to be used to compute the "orbit" (= trajectory?) of the seed points, as if it were the flow.
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2 - When I said vector field, I mean vector field in the sense of a map from $mathbbR^m$ to $mathbbR^n$ for some $m,ngeq 1$. I'm not sure if this is standard terminology, but to me as far as I'm concerned: For each $t_0$, $Phi_t_0$ ($Phi$ evaluated at time $t=t_0$) is a "vector field," and the family $t_0inmathbbR$ is a "flow".
$endgroup$
– cstover
7 hours ago
$begingroup$
A "flow" is a function $Phi_t(x,y,z)$ that gives the position at time $t$ of the particle that started at the point $(x,y,z)$. Formally, it is a vector field in the way that coordinates are vectors. The flow of a vector field $F$ satisfies $partial_t Phi_t = F$ at all $(x,y,z)$ and $t$ if $F=F(x,y,z,t)$ is time-dependent. So that a "flow" is related to a "vector field," and I think it is traditional to keep the terms separated. I was asking whether your vector field was more like the flow $Phi$ or the vector field $F$. I think you're saying it's the flow. Thanks.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2 - I think you're right. Thanks for explaining! I appreciate any chance to clear up gaps in my understanding.
$endgroup$
– cstover
7 hours ago
add a comment |
$begingroup$
Is capital Phi the vector field or the flow? You say vector field, but you never integrate it; instead, it seems to be used to compute the "orbit" (= trajectory?) of the seed points, as if it were the flow.
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2 - When I said vector field, I mean vector field in the sense of a map from $mathbbR^m$ to $mathbbR^n$ for some $m,ngeq 1$. I'm not sure if this is standard terminology, but to me as far as I'm concerned: For each $t_0$, $Phi_t_0$ ($Phi$ evaluated at time $t=t_0$) is a "vector field," and the family $t_0inmathbbR$ is a "flow".
$endgroup$
– cstover
7 hours ago
$begingroup$
A "flow" is a function $Phi_t(x,y,z)$ that gives the position at time $t$ of the particle that started at the point $(x,y,z)$. Formally, it is a vector field in the way that coordinates are vectors. The flow of a vector field $F$ satisfies $partial_t Phi_t = F$ at all $(x,y,z)$ and $t$ if $F=F(x,y,z,t)$ is time-dependent. So that a "flow" is related to a "vector field," and I think it is traditional to keep the terms separated. I was asking whether your vector field was more like the flow $Phi$ or the vector field $F$. I think you're saying it's the flow. Thanks.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2 - I think you're right. Thanks for explaining! I appreciate any chance to clear up gaps in my understanding.
$endgroup$
– cstover
7 hours ago
$begingroup$
Is capital Phi the vector field or the flow? You say vector field, but you never integrate it; instead, it seems to be used to compute the "orbit" (= trajectory?) of the seed points, as if it were the flow.
$endgroup$
– Michael E2
8 hours ago
$begingroup$
Is capital Phi the vector field or the flow? You say vector field, but you never integrate it; instead, it seems to be used to compute the "orbit" (= trajectory?) of the seed points, as if it were the flow.
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2 - When I said vector field, I mean vector field in the sense of a map from $mathbbR^m$ to $mathbbR^n$ for some $m,ngeq 1$. I'm not sure if this is standard terminology, but to me as far as I'm concerned: For each $t_0$, $Phi_t_0$ ($Phi$ evaluated at time $t=t_0$) is a "vector field," and the family $t_0inmathbbR$ is a "flow".
$endgroup$
– cstover
7 hours ago
$begingroup$
@MichaelE2 - When I said vector field, I mean vector field in the sense of a map from $mathbbR^m$ to $mathbbR^n$ for some $m,ngeq 1$. I'm not sure if this is standard terminology, but to me as far as I'm concerned: For each $t_0$, $Phi_t_0$ ($Phi$ evaluated at time $t=t_0$) is a "vector field," and the family $t_0inmathbbR$ is a "flow".
$endgroup$
– cstover
7 hours ago
$begingroup$
A "flow" is a function $Phi_t(x,y,z)$ that gives the position at time $t$ of the particle that started at the point $(x,y,z)$. Formally, it is a vector field in the way that coordinates are vectors. The flow of a vector field $F$ satisfies $partial_t Phi_t = F$ at all $(x,y,z)$ and $t$ if $F=F(x,y,z,t)$ is time-dependent. So that a "flow" is related to a "vector field," and I think it is traditional to keep the terms separated. I was asking whether your vector field was more like the flow $Phi$ or the vector field $F$. I think you're saying it's the flow. Thanks.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
A "flow" is a function $Phi_t(x,y,z)$ that gives the position at time $t$ of the particle that started at the point $(x,y,z)$. Formally, it is a vector field in the way that coordinates are vectors. The flow of a vector field $F$ satisfies $partial_t Phi_t = F$ at all $(x,y,z)$ and $t$ if $F=F(x,y,z,t)$ is time-dependent. So that a "flow" is related to a "vector field," and I think it is traditional to keep the terms separated. I was asking whether your vector field was more like the flow $Phi$ or the vector field $F$. I think you're saying it's the flow. Thanks.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2 - I think you're right. Thanks for explaining! I appreciate any chance to clear up gaps in my understanding.
$endgroup$
– cstover
7 hours ago
$begingroup$
@MichaelE2 - I think you're right. Thanks for explaining! I appreciate any chance to clear up gaps in my understanding.
$endgroup$
– cstover
7 hours ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You can use ParametricPlot3D
to get smoother orbits:
SeedRandom[1]
seeds = RandomReal[-1, 1, 50, 3];
Animate[ParametricPlot3D[Evaluate[func[seeds[[#]], t] & /@ Range[Length@seeds]],
t, 0, tmax,
BoxRatios -> 1,
PlotStyle -> Arrowheads[Medium],
ImageSize->400,
PlotRange -> -60, 60, -1, 1, -10, 10] /. Line -> Arrow,
tmax, .1, 10]
$endgroup$
$begingroup$
That's amazing! I tried for a while to use built-in functions such asParametricPlot3D
, but I never could get the arguments quite right. Okay, follow-up question: Is there a way to use this this implementation to animate as all of orbit 1, followed by all of orbit 2, followed by....?
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, do you want to keep or remove orbit 1 in the picture when orbit 2 is rendered?
$endgroup$
– kglr
7 hours ago
$begingroup$
I would like to keep orbit 1 when orbit 2 is rendered, and keep both when orbit 3 is rendered, etc. But, if it's not too much trouble, I would appreciate seeing how to do one version with them kept and one with them erased...just to become a better programmer.
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, I will update with a version that shows subsets of orbits sequentially.
$endgroup$
– kglr
7 hours ago
$begingroup$
Thank you kindly!
$endgroup$
– cstover
6 hours ago
add a comment |
$begingroup$
Not exactly what was asked, but another way to visualize the flow, based on How can I create a fountain effect?:
DynamicModule[x0, y0, z0, last = 0, lam = 1.5, n = 500, colors,
replace,
last = Clock[Infinity];
x0, y0, z0 = RandomReal[-1, 1, 3, n];
colors = RandomColor[n];
Graphics3D[
GraphicsComplex[
Dynamic@
With[t = Clock[Infinity],
With[dt = (t - last)/2, With[dl = lam^dt,
last = t;
x0 = x0*dl; y0 = y0/dl; z0 = z0 + dt; (* integration of velocity *)
replace = Pick[Range@n, UnitStep[z0 - 1], 1];
With[pick = UnitStep[z0 - 1],
x0[[replace]] = RandomReal[-1, 1, Length@replace];
y0[[replace]] = RandomReal[-1, 1, Length@replace];
z0[[replace]] = RandomReal[-1, -1 + dt, Length@replace]
];
Transpose@x0, y0, z0
]]],
Point[Range@n, VertexColors -> colors]
], PlotRange -> -2, 2, -2, 2, -1, 1, Axes -> True,
AxesLabel -> x, y, z
],
Initialization :> (x0, y0, z0 = RandomReal[-1, 1, 3, n])
]
The integration is based on the ODE for $Phi$, which is autonomous and linear and can be done by scalings and translation:
$$d over dt,(x,y,z) = (x log lambda, -y log lambda, 1)$$
$endgroup$
1
$begingroup$
That's really neat! While this may not be the question I asked, it's a hugely rewarding answer that I think will help me learn a lot! Thank you so much!
$endgroup$
– cstover
3 hours ago
$begingroup$
Michael, wow! Several +1s for the self-link to your previous work (especially the gravity hose, WOW!) and for this answer also. So this can be a constructive comment, please, can you elaborate on how much the RAM usage is impacted with depictions such as these? Very exquisite work.
$endgroup$
– CA Trevillian
2 hours ago
$begingroup$
@CATrevillian Thanks. The graphics take up about 60K for the colors and 12-13K for the coordinates. The coordinate data gets copied at each step, plus 4K for the computation ofreplace
, and the arraysx0
,y0
,z0
are partially overwritten (but not copied, I think) at each step and stay packed (I think). IfGraphicsComplex
&VertexColors
are efficient, then it's conceivable that only the 13K of coordinate data needs to be shipped to the GPU at each step since the basic graphics structure does not change (but I don't know anything about how GPUs actually work).
$endgroup$
– Michael E2
1 hour ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f203839%2fanimate-flow-lines-of-time-dependent-3d-dynamical-system%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can use ParametricPlot3D
to get smoother orbits:
SeedRandom[1]
seeds = RandomReal[-1, 1, 50, 3];
Animate[ParametricPlot3D[Evaluate[func[seeds[[#]], t] & /@ Range[Length@seeds]],
t, 0, tmax,
BoxRatios -> 1,
PlotStyle -> Arrowheads[Medium],
ImageSize->400,
PlotRange -> -60, 60, -1, 1, -10, 10] /. Line -> Arrow,
tmax, .1, 10]
$endgroup$
$begingroup$
That's amazing! I tried for a while to use built-in functions such asParametricPlot3D
, but I never could get the arguments quite right. Okay, follow-up question: Is there a way to use this this implementation to animate as all of orbit 1, followed by all of orbit 2, followed by....?
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, do you want to keep or remove orbit 1 in the picture when orbit 2 is rendered?
$endgroup$
– kglr
7 hours ago
$begingroup$
I would like to keep orbit 1 when orbit 2 is rendered, and keep both when orbit 3 is rendered, etc. But, if it's not too much trouble, I would appreciate seeing how to do one version with them kept and one with them erased...just to become a better programmer.
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, I will update with a version that shows subsets of orbits sequentially.
$endgroup$
– kglr
7 hours ago
$begingroup$
Thank you kindly!
$endgroup$
– cstover
6 hours ago
add a comment |
$begingroup$
You can use ParametricPlot3D
to get smoother orbits:
SeedRandom[1]
seeds = RandomReal[-1, 1, 50, 3];
Animate[ParametricPlot3D[Evaluate[func[seeds[[#]], t] & /@ Range[Length@seeds]],
t, 0, tmax,
BoxRatios -> 1,
PlotStyle -> Arrowheads[Medium],
ImageSize->400,
PlotRange -> -60, 60, -1, 1, -10, 10] /. Line -> Arrow,
tmax, .1, 10]
$endgroup$
$begingroup$
That's amazing! I tried for a while to use built-in functions such asParametricPlot3D
, but I never could get the arguments quite right. Okay, follow-up question: Is there a way to use this this implementation to animate as all of orbit 1, followed by all of orbit 2, followed by....?
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, do you want to keep or remove orbit 1 in the picture when orbit 2 is rendered?
$endgroup$
– kglr
7 hours ago
$begingroup$
I would like to keep orbit 1 when orbit 2 is rendered, and keep both when orbit 3 is rendered, etc. But, if it's not too much trouble, I would appreciate seeing how to do one version with them kept and one with them erased...just to become a better programmer.
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, I will update with a version that shows subsets of orbits sequentially.
$endgroup$
– kglr
7 hours ago
$begingroup$
Thank you kindly!
$endgroup$
– cstover
6 hours ago
add a comment |
$begingroup$
You can use ParametricPlot3D
to get smoother orbits:
SeedRandom[1]
seeds = RandomReal[-1, 1, 50, 3];
Animate[ParametricPlot3D[Evaluate[func[seeds[[#]], t] & /@ Range[Length@seeds]],
t, 0, tmax,
BoxRatios -> 1,
PlotStyle -> Arrowheads[Medium],
ImageSize->400,
PlotRange -> -60, 60, -1, 1, -10, 10] /. Line -> Arrow,
tmax, .1, 10]
$endgroup$
You can use ParametricPlot3D
to get smoother orbits:
SeedRandom[1]
seeds = RandomReal[-1, 1, 50, 3];
Animate[ParametricPlot3D[Evaluate[func[seeds[[#]], t] & /@ Range[Length@seeds]],
t, 0, tmax,
BoxRatios -> 1,
PlotStyle -> Arrowheads[Medium],
ImageSize->400,
PlotRange -> -60, 60, -1, 1, -10, 10] /. Line -> Arrow,
tmax, .1, 10]
edited 7 hours ago
answered 7 hours ago
kglrkglr
211k10 gold badges242 silver badges484 bronze badges
211k10 gold badges242 silver badges484 bronze badges
$begingroup$
That's amazing! I tried for a while to use built-in functions such asParametricPlot3D
, but I never could get the arguments quite right. Okay, follow-up question: Is there a way to use this this implementation to animate as all of orbit 1, followed by all of orbit 2, followed by....?
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, do you want to keep or remove orbit 1 in the picture when orbit 2 is rendered?
$endgroup$
– kglr
7 hours ago
$begingroup$
I would like to keep orbit 1 when orbit 2 is rendered, and keep both when orbit 3 is rendered, etc. But, if it's not too much trouble, I would appreciate seeing how to do one version with them kept and one with them erased...just to become a better programmer.
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, I will update with a version that shows subsets of orbits sequentially.
$endgroup$
– kglr
7 hours ago
$begingroup$
Thank you kindly!
$endgroup$
– cstover
6 hours ago
add a comment |
$begingroup$
That's amazing! I tried for a while to use built-in functions such asParametricPlot3D
, but I never could get the arguments quite right. Okay, follow-up question: Is there a way to use this this implementation to animate as all of orbit 1, followed by all of orbit 2, followed by....?
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, do you want to keep or remove orbit 1 in the picture when orbit 2 is rendered?
$endgroup$
– kglr
7 hours ago
$begingroup$
I would like to keep orbit 1 when orbit 2 is rendered, and keep both when orbit 3 is rendered, etc. But, if it's not too much trouble, I would appreciate seeing how to do one version with them kept and one with them erased...just to become a better programmer.
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, I will update with a version that shows subsets of orbits sequentially.
$endgroup$
– kglr
7 hours ago
$begingroup$
Thank you kindly!
$endgroup$
– cstover
6 hours ago
$begingroup$
That's amazing! I tried for a while to use built-in functions such as
ParametricPlot3D
, but I never could get the arguments quite right. Okay, follow-up question: Is there a way to use this this implementation to animate as all of orbit 1, followed by all of orbit 2, followed by....?$endgroup$
– cstover
7 hours ago
$begingroup$
That's amazing! I tried for a while to use built-in functions such as
ParametricPlot3D
, but I never could get the arguments quite right. Okay, follow-up question: Is there a way to use this this implementation to animate as all of orbit 1, followed by all of orbit 2, followed by....?$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, do you want to keep or remove orbit 1 in the picture when orbit 2 is rendered?
$endgroup$
– kglr
7 hours ago
$begingroup$
@cstover, do you want to keep or remove orbit 1 in the picture when orbit 2 is rendered?
$endgroup$
– kglr
7 hours ago
$begingroup$
I would like to keep orbit 1 when orbit 2 is rendered, and keep both when orbit 3 is rendered, etc. But, if it's not too much trouble, I would appreciate seeing how to do one version with them kept and one with them erased...just to become a better programmer.
$endgroup$
– cstover
7 hours ago
$begingroup$
I would like to keep orbit 1 when orbit 2 is rendered, and keep both when orbit 3 is rendered, etc. But, if it's not too much trouble, I would appreciate seeing how to do one version with them kept and one with them erased...just to become a better programmer.
$endgroup$
– cstover
7 hours ago
$begingroup$
@cstover, I will update with a version that shows subsets of orbits sequentially.
$endgroup$
– kglr
7 hours ago
$begingroup$
@cstover, I will update with a version that shows subsets of orbits sequentially.
$endgroup$
– kglr
7 hours ago
$begingroup$
Thank you kindly!
$endgroup$
– cstover
6 hours ago
$begingroup$
Thank you kindly!
$endgroup$
– cstover
6 hours ago
add a comment |
$begingroup$
Not exactly what was asked, but another way to visualize the flow, based on How can I create a fountain effect?:
DynamicModule[x0, y0, z0, last = 0, lam = 1.5, n = 500, colors,
replace,
last = Clock[Infinity];
x0, y0, z0 = RandomReal[-1, 1, 3, n];
colors = RandomColor[n];
Graphics3D[
GraphicsComplex[
Dynamic@
With[t = Clock[Infinity],
With[dt = (t - last)/2, With[dl = lam^dt,
last = t;
x0 = x0*dl; y0 = y0/dl; z0 = z0 + dt; (* integration of velocity *)
replace = Pick[Range@n, UnitStep[z0 - 1], 1];
With[pick = UnitStep[z0 - 1],
x0[[replace]] = RandomReal[-1, 1, Length@replace];
y0[[replace]] = RandomReal[-1, 1, Length@replace];
z0[[replace]] = RandomReal[-1, -1 + dt, Length@replace]
];
Transpose@x0, y0, z0
]]],
Point[Range@n, VertexColors -> colors]
], PlotRange -> -2, 2, -2, 2, -1, 1, Axes -> True,
AxesLabel -> x, y, z
],
Initialization :> (x0, y0, z0 = RandomReal[-1, 1, 3, n])
]
The integration is based on the ODE for $Phi$, which is autonomous and linear and can be done by scalings and translation:
$$d over dt,(x,y,z) = (x log lambda, -y log lambda, 1)$$
$endgroup$
1
$begingroup$
That's really neat! While this may not be the question I asked, it's a hugely rewarding answer that I think will help me learn a lot! Thank you so much!
$endgroup$
– cstover
3 hours ago
$begingroup$
Michael, wow! Several +1s for the self-link to your previous work (especially the gravity hose, WOW!) and for this answer also. So this can be a constructive comment, please, can you elaborate on how much the RAM usage is impacted with depictions such as these? Very exquisite work.
$endgroup$
– CA Trevillian
2 hours ago
$begingroup$
@CATrevillian Thanks. The graphics take up about 60K for the colors and 12-13K for the coordinates. The coordinate data gets copied at each step, plus 4K for the computation ofreplace
, and the arraysx0
,y0
,z0
are partially overwritten (but not copied, I think) at each step and stay packed (I think). IfGraphicsComplex
&VertexColors
are efficient, then it's conceivable that only the 13K of coordinate data needs to be shipped to the GPU at each step since the basic graphics structure does not change (but I don't know anything about how GPUs actually work).
$endgroup$
– Michael E2
1 hour ago
add a comment |
$begingroup$
Not exactly what was asked, but another way to visualize the flow, based on How can I create a fountain effect?:
DynamicModule[x0, y0, z0, last = 0, lam = 1.5, n = 500, colors,
replace,
last = Clock[Infinity];
x0, y0, z0 = RandomReal[-1, 1, 3, n];
colors = RandomColor[n];
Graphics3D[
GraphicsComplex[
Dynamic@
With[t = Clock[Infinity],
With[dt = (t - last)/2, With[dl = lam^dt,
last = t;
x0 = x0*dl; y0 = y0/dl; z0 = z0 + dt; (* integration of velocity *)
replace = Pick[Range@n, UnitStep[z0 - 1], 1];
With[pick = UnitStep[z0 - 1],
x0[[replace]] = RandomReal[-1, 1, Length@replace];
y0[[replace]] = RandomReal[-1, 1, Length@replace];
z0[[replace]] = RandomReal[-1, -1 + dt, Length@replace]
];
Transpose@x0, y0, z0
]]],
Point[Range@n, VertexColors -> colors]
], PlotRange -> -2, 2, -2, 2, -1, 1, Axes -> True,
AxesLabel -> x, y, z
],
Initialization :> (x0, y0, z0 = RandomReal[-1, 1, 3, n])
]
The integration is based on the ODE for $Phi$, which is autonomous and linear and can be done by scalings and translation:
$$d over dt,(x,y,z) = (x log lambda, -y log lambda, 1)$$
$endgroup$
1
$begingroup$
That's really neat! While this may not be the question I asked, it's a hugely rewarding answer that I think will help me learn a lot! Thank you so much!
$endgroup$
– cstover
3 hours ago
$begingroup$
Michael, wow! Several +1s for the self-link to your previous work (especially the gravity hose, WOW!) and for this answer also. So this can be a constructive comment, please, can you elaborate on how much the RAM usage is impacted with depictions such as these? Very exquisite work.
$endgroup$
– CA Trevillian
2 hours ago
$begingroup$
@CATrevillian Thanks. The graphics take up about 60K for the colors and 12-13K for the coordinates. The coordinate data gets copied at each step, plus 4K for the computation ofreplace
, and the arraysx0
,y0
,z0
are partially overwritten (but not copied, I think) at each step and stay packed (I think). IfGraphicsComplex
&VertexColors
are efficient, then it's conceivable that only the 13K of coordinate data needs to be shipped to the GPU at each step since the basic graphics structure does not change (but I don't know anything about how GPUs actually work).
$endgroup$
– Michael E2
1 hour ago
add a comment |
$begingroup$
Not exactly what was asked, but another way to visualize the flow, based on How can I create a fountain effect?:
DynamicModule[x0, y0, z0, last = 0, lam = 1.5, n = 500, colors,
replace,
last = Clock[Infinity];
x0, y0, z0 = RandomReal[-1, 1, 3, n];
colors = RandomColor[n];
Graphics3D[
GraphicsComplex[
Dynamic@
With[t = Clock[Infinity],
With[dt = (t - last)/2, With[dl = lam^dt,
last = t;
x0 = x0*dl; y0 = y0/dl; z0 = z0 + dt; (* integration of velocity *)
replace = Pick[Range@n, UnitStep[z0 - 1], 1];
With[pick = UnitStep[z0 - 1],
x0[[replace]] = RandomReal[-1, 1, Length@replace];
y0[[replace]] = RandomReal[-1, 1, Length@replace];
z0[[replace]] = RandomReal[-1, -1 + dt, Length@replace]
];
Transpose@x0, y0, z0
]]],
Point[Range@n, VertexColors -> colors]
], PlotRange -> -2, 2, -2, 2, -1, 1, Axes -> True,
AxesLabel -> x, y, z
],
Initialization :> (x0, y0, z0 = RandomReal[-1, 1, 3, n])
]
The integration is based on the ODE for $Phi$, which is autonomous and linear and can be done by scalings and translation:
$$d over dt,(x,y,z) = (x log lambda, -y log lambda, 1)$$
$endgroup$
Not exactly what was asked, but another way to visualize the flow, based on How can I create a fountain effect?:
DynamicModule[x0, y0, z0, last = 0, lam = 1.5, n = 500, colors,
replace,
last = Clock[Infinity];
x0, y0, z0 = RandomReal[-1, 1, 3, n];
colors = RandomColor[n];
Graphics3D[
GraphicsComplex[
Dynamic@
With[t = Clock[Infinity],
With[dt = (t - last)/2, With[dl = lam^dt,
last = t;
x0 = x0*dl; y0 = y0/dl; z0 = z0 + dt; (* integration of velocity *)
replace = Pick[Range@n, UnitStep[z0 - 1], 1];
With[pick = UnitStep[z0 - 1],
x0[[replace]] = RandomReal[-1, 1, Length@replace];
y0[[replace]] = RandomReal[-1, 1, Length@replace];
z0[[replace]] = RandomReal[-1, -1 + dt, Length@replace]
];
Transpose@x0, y0, z0
]]],
Point[Range@n, VertexColors -> colors]
], PlotRange -> -2, 2, -2, 2, -1, 1, Axes -> True,
AxesLabel -> x, y, z
],
Initialization :> (x0, y0, z0 = RandomReal[-1, 1, 3, n])
]
The integration is based on the ODE for $Phi$, which is autonomous and linear and can be done by scalings and translation:
$$d over dt,(x,y,z) = (x log lambda, -y log lambda, 1)$$
answered 6 hours ago
Michael E2Michael E2
158k13 gold badges216 silver badges514 bronze badges
158k13 gold badges216 silver badges514 bronze badges
1
$begingroup$
That's really neat! While this may not be the question I asked, it's a hugely rewarding answer that I think will help me learn a lot! Thank you so much!
$endgroup$
– cstover
3 hours ago
$begingroup$
Michael, wow! Several +1s for the self-link to your previous work (especially the gravity hose, WOW!) and for this answer also. So this can be a constructive comment, please, can you elaborate on how much the RAM usage is impacted with depictions such as these? Very exquisite work.
$endgroup$
– CA Trevillian
2 hours ago
$begingroup$
@CATrevillian Thanks. The graphics take up about 60K for the colors and 12-13K for the coordinates. The coordinate data gets copied at each step, plus 4K for the computation ofreplace
, and the arraysx0
,y0
,z0
are partially overwritten (but not copied, I think) at each step and stay packed (I think). IfGraphicsComplex
&VertexColors
are efficient, then it's conceivable that only the 13K of coordinate data needs to be shipped to the GPU at each step since the basic graphics structure does not change (but I don't know anything about how GPUs actually work).
$endgroup$
– Michael E2
1 hour ago
add a comment |
1
$begingroup$
That's really neat! While this may not be the question I asked, it's a hugely rewarding answer that I think will help me learn a lot! Thank you so much!
$endgroup$
– cstover
3 hours ago
$begingroup$
Michael, wow! Several +1s for the self-link to your previous work (especially the gravity hose, WOW!) and for this answer also. So this can be a constructive comment, please, can you elaborate on how much the RAM usage is impacted with depictions such as these? Very exquisite work.
$endgroup$
– CA Trevillian
2 hours ago
$begingroup$
@CATrevillian Thanks. The graphics take up about 60K for the colors and 12-13K for the coordinates. The coordinate data gets copied at each step, plus 4K for the computation ofreplace
, and the arraysx0
,y0
,z0
are partially overwritten (but not copied, I think) at each step and stay packed (I think). IfGraphicsComplex
&VertexColors
are efficient, then it's conceivable that only the 13K of coordinate data needs to be shipped to the GPU at each step since the basic graphics structure does not change (but I don't know anything about how GPUs actually work).
$endgroup$
– Michael E2
1 hour ago
1
1
$begingroup$
That's really neat! While this may not be the question I asked, it's a hugely rewarding answer that I think will help me learn a lot! Thank you so much!
$endgroup$
– cstover
3 hours ago
$begingroup$
That's really neat! While this may not be the question I asked, it's a hugely rewarding answer that I think will help me learn a lot! Thank you so much!
$endgroup$
– cstover
3 hours ago
$begingroup$
Michael, wow! Several +1s for the self-link to your previous work (especially the gravity hose, WOW!) and for this answer also. So this can be a constructive comment, please, can you elaborate on how much the RAM usage is impacted with depictions such as these? Very exquisite work.
$endgroup$
– CA Trevillian
2 hours ago
$begingroup$
Michael, wow! Several +1s for the self-link to your previous work (especially the gravity hose, WOW!) and for this answer also. So this can be a constructive comment, please, can you elaborate on how much the RAM usage is impacted with depictions such as these? Very exquisite work.
$endgroup$
– CA Trevillian
2 hours ago
$begingroup$
@CATrevillian Thanks. The graphics take up about 60K for the colors and 12-13K for the coordinates. The coordinate data gets copied at each step, plus 4K for the computation of
replace
, and the arrays x0
, y0
, z0
are partially overwritten (but not copied, I think) at each step and stay packed (I think). If GraphicsComplex
& VertexColors
are efficient, then it's conceivable that only the 13K of coordinate data needs to be shipped to the GPU at each step since the basic graphics structure does not change (but I don't know anything about how GPUs actually work).$endgroup$
– Michael E2
1 hour ago
$begingroup$
@CATrevillian Thanks. The graphics take up about 60K for the colors and 12-13K for the coordinates. The coordinate data gets copied at each step, plus 4K for the computation of
replace
, and the arrays x0
, y0
, z0
are partially overwritten (but not copied, I think) at each step and stay packed (I think). If GraphicsComplex
& VertexColors
are efficient, then it's conceivable that only the 13K of coordinate data needs to be shipped to the GPU at each step since the basic graphics structure does not change (but I don't know anything about how GPUs actually work).$endgroup$
– Michael E2
1 hour ago
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f203839%2fanimate-flow-lines-of-time-dependent-3d-dynamical-system%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Is capital Phi the vector field or the flow? You say vector field, but you never integrate it; instead, it seems to be used to compute the "orbit" (= trajectory?) of the seed points, as if it were the flow.
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2 - When I said vector field, I mean vector field in the sense of a map from $mathbbR^m$ to $mathbbR^n$ for some $m,ngeq 1$. I'm not sure if this is standard terminology, but to me as far as I'm concerned: For each $t_0$, $Phi_t_0$ ($Phi$ evaluated at time $t=t_0$) is a "vector field," and the family $t_0inmathbbR$ is a "flow".
$endgroup$
– cstover
7 hours ago
$begingroup$
A "flow" is a function $Phi_t(x,y,z)$ that gives the position at time $t$ of the particle that started at the point $(x,y,z)$. Formally, it is a vector field in the way that coordinates are vectors. The flow of a vector field $F$ satisfies $partial_t Phi_t = F$ at all $(x,y,z)$ and $t$ if $F=F(x,y,z,t)$ is time-dependent. So that a "flow" is related to a "vector field," and I think it is traditional to keep the terms separated. I was asking whether your vector field was more like the flow $Phi$ or the vector field $F$. I think you're saying it's the flow. Thanks.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2 - I think you're right. Thanks for explaining! I appreciate any chance to clear up gaps in my understanding.
$endgroup$
– cstover
7 hours ago