Chris Beaumont's IDL Library

Download source code

single page | use frames     summary     class     fields     routine details     file attributes

./

poten_tree.pro

Routines

result = poten_tree(pos, mass [, theta=theta])

This function computes the potential energy of a mass distribution.

test
test2
test3

Routine details

toppoten_tree

result = poten_tree(pos, mass [, theta=theta])

This function computes the potential energy of a mass distribution. It uses a divide and conquer algorithm based on the Barnes-Hut algorithm, and scales as N(log(N)). The poten_slow program is more accurate, but scales as N^2. Generally, this procedure will calculate energies accurate to 1%

Return value

The potential energy of the system. It is assumed that G=1, so that PE = sum_i (sum j > i (m_i * m_j / r_ij) )

Parameters

pos in required

A [3, n] array of 3D particle locations

mass in required

A n element vector of masses

Keywords

theta in optional

A precision pramater which controls the algorithm. Higher values translate to faster run time and larger errors. A value of 1 is recommended, and usually achieves 1% accuracy. A value of 1.5 achieves 1% accuracy for >100 evenly distributed particles. Default is 1

toptest

test

toptest2

test2

toptest3

test3

File attributes

Modifcation date: Mon Jul 26 19:29:01 2010
Lines: 163