Documentation for jbiu/

Generated by IDLdoc

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

astro/

potential_newton.pro


top source potential_newton

Astro

result = potential_newton(x, y, z, xpart, ypart, zpart, mass, lengthunit=lengthunit, massunit=massunit, astro=astro, softening=softening, lomem=lomem)

Calculates the gravitational potential from a particle distribution at a list of positions.

Return value

This function returns the gravitational potential at each X,Y,Z position. If there are NPOS positions, Result is a vector of length NPOS.

Parameters

x in

X coordinates at which to calculate potential.

y in

Y coordinates at which to calculate potential.

z in

Z coordinates at which to calculate potential.

xpart in

X coordinates of particle positions defining the mass distribution.

ypart in

Y coordinates of particle positions defining the mass distribution.

zpart in

Z coordinates of particle positions defining the mass distribution.

mass in

Mass of each particle.

Keywords

lengthunit in

Length unit, in cm (or kpc if /ASTRO is set). Default: 1kpc.

massunit in

Mass unit, in grams (or solar masses if /ASTRO is set). Default: 1 solar mass.

astro in

If /ASTRO is set then LENGTHUNIT and MASSUNIT are given in kpc and solar masses respectively, otherwise they are in CGS (Lengthunit in cm, Massunit in grams).

softening in

Plummer softening length. Default: 0 (no softening).

lomem in

If /LOMEM is set then sacrifice efficiency for lower memory usage

Examples

Calculate the gravitational potential on a line along the x-axis from 6 point masses placed at the vertices of a cube: xmasspos = [-1,-1,-1,-1,1,1,1,1] ymasspos = [-1,-1,1,1,-1,-1,1,1] zmasspos = [-1,1,-1,1,-1,1,-1,1] masses = REPLICATE(1.,8) xlinepos = 0.1*FINDGEN(20) ylinepos = REPLICATE(0.,20) zlinepos = REPLICATE(0.,20) potentials = POTENTIAL_NEWTON(xlinepos, ylinepos, zlinepos, xmasspos, ymasspos, zmasspos, masses)

Author information

History:

Written by: Jeremy Bailin 10 June 2008 Public release in JBIU

File attributes

Modification date: Wed Apr 15 16:07:43 2009
Lines: 145