Greetings all,
I'm attempting to work out how to produce a 3D simulation of repelling particles, but I just can't seem to wrap my head around the theory behind it.

I have a list of nodes (particles) and links (connections between particles). Each link has a certain 'charge' to it, indicating the resultant distance between nodes.
I randomly give each node a co-ordinate in space, and then tell the simulator to work out the negative charges and thusly the co-ordinates of nodes to produce the correct distance between nodes.
Clear as mud? Basically each particle repels all other particles, the charge of the links between particles determines the strength of the repulsion between those particles, and thusly the distance between them.
So when I set the simulation going, it will push all the linked nodes away from each other as far as the charges suggest, moving them around in 3D space and at the end of the simulation, outputting correct co-ordinates of the nodes.

I just can't work out how to... well... do any of it. Can anyone point me off in the right direction?

JP,
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --


In reply to 3 Dimensional repelling particle simulation by JPaul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.