Next: 5.5.2 Integration Up: 5.5 Orbits Previous: 5.5 Orbits   Contents   Index

## 5.5.1 Initializing

There are a few programs with which orbits can be initialized:

• mkorbit is the most straightforward program. You can give simply give it all 6 phase space coordinates, and an orbit file consisting of this one point is generated. It is also possible to give the potential in which the particle is to move, and 5 phase space coordinates plus the energy, or even 4 phase space coordinates and the energy plus the total angular momentum or angular momentum along the Z axis (for axisymmetric systems).

Let's start with an example of creating a simple orbit by itself with no associated potential.

```% mkorbit out=orb1 x=1 y=0 z=0 vx=0 vy=0.2 vz=0
### Warning [mkorbit]: Potential potname= not used; set etot=0.0
pos: 1.000000 0.000000 0.000000
vel: 0.000000 0.200000 0.000000
etot: 0.000000
lz=0.200000

% tsf orb1
char History[59] "mkorbit out=orb1 x=1 y=0 z=0 vx=0 vy=0.2 vz=0 VERSION
=3.2b"
set Orbit
set Parameters
int Ndim 03
double Mass 1.00000
double IOM[3] 0.00000 0.200000 0.00000
int Nsteps 01
tes
set Potential
tes
set Path
double TimePath[1] 0.00000
double PhasePath[1][2][3] 1.00000 0.00000 0.00000 0.00000 0.200000
0.00000
tes
tes
```

• perorb is a program that for given initial conditions (similar to the ones described in mkorbit above) attempts to calculate periodic orbits in that potential. The output file will be a file with one (or more) orbits. This is a bit of an advanced program, and will not be covered here.

• stoo is a program that can take a particle position from a snapshot, and turn it into an orbit. For example, sampling some initial conditions from the positions of stars in a Plummer sphere, we could use the following small C-shell code to find some statistical properties of this selected set of orbits5.13

```    mkplummer out=p100 nbody=p100
foreach i (`nemoinp 0:100:10`)
stoo in=p100 out=orb\$i ibody=\$i
orbint orb\$i orb\$i.out 10000 0.01 10000 potname=plummer
orbstat orb\$i.out
end
```

The reverse program, otos turns an orbit into a snapshot, and may come in handy since the snapshot package has far more advanced analysis programs.

Next: 5.5.2 Integration Up: 5.5 Orbits Previous: 5.5 Orbits   Contents   Index
(c) Peter Teuben