Message Boards Message Boards

[WSS22] Stability in a Star-Planet-Moon three-body system

Posted 1 year ago

POSTED BY: Aman Burman
5 Replies

Your project is spectacular; the NBodyVisualize Module really shows the semi-major axis within equations in Hamiltonian form! For example, increase the mass and time step, de-structure dataCentered[tloc] or decrease the initial position & velocity.

NBodySimulation[
  "InverseSquare", {<|"Mass" -> 1, "Position" -> {0, 0, 0}, 
    "Velocity" -> {0, 0, 0}|>,
   <|"Mass" -> 1, "Position" -> {1, 1, 1}, "Velocity" -> {0, 0, 0}|>,
   <|"Mass" -> 1, "Position" -> {1, 1, 0}, 
    "Velocity" -> {0, 0, 0}|>},
  1
  ]["HamiltonEquations"]

What are some initial positions and velocities? Why not call helper functions until they are invoked? Is it possible to set dimensions like 0.700002 or e.g. -4.48, and "fix" the position to some random value around {0,0,0}?

Hamiltonian Equations

What do you know about uploading & embedding animations, for example via Liferay or removing warnings without closing the cell group? So we've got that framework, and now the Star-Planet-Moon three-body system!

NBodyVisualize[NObj_,
  m_,
  inPos_,
  inVel_,
  {t1_, t2_}] := Module[{data1, dataCentered1},
  data = NBodySimulation[
    "InverseSquare",
    Table[<|"Mass" -> m[[i]], "Position" -> inPos[[i]], 
      "Velocity" -> inVel[[i]]|>, {i, 1, NObj}],
    t2];
  dataCentered = (Table[
      data[i, "Position"][#] - data[1, "Position"][#], {i, 1, 
       NObj}]) &;
  Show[ParametricPlot3D[
    {dataCentered[tloc][[1]], dataCentered[tloc][[2]], 
     dataCentered[tloc][[3]]},
    {tloc, t1, t2},
    PlotStyle -> {Black, Green, Blue}
    ],
   Graphics3D[{PointSize[0.02], Point[dataCentered[t2]]}]]]

inPosInstance = Table[RandomReal[{-1, 1}, 3], 3]
inVelInstance = Table[RandomReal[{-0.1, 0.1}, 3], 3]

ListAnimate[Table[NBodyVisualize[3,
   {100, 10, 0.1},
   inPosInstance,
   inVelInstance,
   {t, t + 1}],
  {t, 0, .01, .001}], 10]

It sort of looks like a butterfly flap when you provide the number of objects, the scalar mass in a list for the n bodies, the n×n matrices of positions and velocities, as well as the start and end time, and the dimensions of the plot in both directions.

Animation of Star-Planet-Moon Three-Body System

POSTED BY: Dean Gladish

Thank you so much for picking my post !!

POSTED BY: Aman Burman

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team
Posted 1 year ago

Awesome project! Your plots and explanations showing, for example, when the moon gets ejected etc. and effects on the system are clear and easy to understand.

POSTED BY: Chase Marangu

Thanks so much Chase!

POSTED BY: Aman Burman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract