File:Nova toy model.gif

Nova_toy_model.gif(360 × 360 pixels, file size: 389 KB, MIME type: image/gif, looped, 252 frames)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

edit
Description
English: 2D simulation of bunch of point masses starting at rest at random positions and interacting gravitationally. This shows how a significant fraction of the mass is actually expelled during the early stages of gravitational collapse.
Date
Source https://twitter.com/j_bertolotti/status/1037655339968147456
Author Jacopo Bertolotti
Permission
(Reusing this file)
https://twitter.com/j_bertolotti/status/1030470604418428929

Mathematica 11.0 code

edit
np = 200;
m = 1;
pos = Table[RandomReal[{-1, 1}, 2], {np}];
acc = Table[
   Sum[If[j == k, 
     0, -(1/m) (
      pos[[j]] - 
       pos[[k]])/((pos[[j, 1]] - pos[[k, 1]])^2 + (pos[[j, 2]] - 
          pos[[k, 2]])^2)^(3/2)], {k, 1, np}], {j, 1, np}];
dt = 0.01;
posold = pos;
pos = posold + acc/2 dt^2;
clip = 10^0;
range = 20;
plots = {
   Graphics[Point[posold] , PlotRange -> {{-10, 10}, {-10, 10}}],
   Graphics[Point[pos] , PlotRange -> {{-10, 10}, {-10, 10}}]
   };
Do[
  acc = Table[
    Sum[If[j == k, 
      0, -(1/m) (
       pos[[j]] - 
        pos[[k]])/((pos[[j, 1]] - pos[[k, 1]])^2 + (pos[[j, 2]] - 
           pos[[k, 2]])^2)^(3/2)], {k, 1, np}], {j, 1, np}];
  acc = Clip[acc, {-clip, clip}];
  posoldold = posold;
  posold = pos;
  pos = 2 posold - posoldold + acc dt^2;
  AppendTo[plots, 
   Graphics[Point[pos] , 
    PlotRange -> {{-range, range}, {-range, range}}]];
  , 250];

Licensing

edit
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

This file, which was originally posted to https://twitter.com/j_bertolotti/status/1037655339968147456, was reviewed on 19 October 2018 by reviewer Ronhjones, who confirmed that it was available there under the stated license on that date.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current11:03, 6 September 2018Thumbnail for version as of 11:03, 6 September 2018360 × 360 (389 KB)Berto (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

Metadata