Message Boards Message Boards

Using NBodySimulation: arbitrary potential surface to move around?

Hi All,

Inspired by a recent discussion in one of the 'live CEO-ing' broadcasts, I fooled around with NBodySImulation to see if I could make to simulate the basic 'flocking' model of animal movements. And I succeeded! see the attached notebook if you are interested. But, pushing the boundaries, I wanted to see if I could implement an arbitrary potential surface for the animals to move around on. That did not work, but in the process I realized that I don't understand the basics of how potential (rather than force) functions are implemented in the NBodySimulation function (and therefore how they should be specified, especially external potentials). And it's not in the current documentation (the sparse nature of which Stephen W. commented on the broadcast!) The notebook shows this issue at the end. Can anyone help me out by explaining how an external potential is incorporated in the simulations and how its function should be coded?

POSTED BY: Gareth Russell

I just noticed that in the final code block I am actually using the Y coordinate (#1["Position"][[2]])& rather than the X coordinate as mentioned previously. But the point still remains: it doesn't seem to affect the animals' movement in any way..

POSTED BY: Gareth Russell
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