Documentation
¶
Overview ¶
Package orbit steps stars through a potential and reports their nearest pass to the galactic centre. It is the reference, in 64-bit floats, that the kernel in gpu/orbit is held to.
Inside, lengths are kiloparsecs and speeds kilometres per second, so the unit of time is one kiloparsec per kilometre per second, about 978 million years, and a potential's gm is in kiloparsecs times kilometres per second squared. The surface is measure's types.
Index ¶
- func Back(field Potential, star State, span measure.Duration, steps int) (*Pass, *State, error)
- func Kiloparsecs(count float64) measure.Length
- func Step(span measure.Duration, steps int) (float64, error)
- func Units(count float64) measure.Duration
- type Bulge
- type Disc
- type Halo
- type Kepler
- type MilkyWay
- type Model
- func (model Model) BulgeShape() (exponent, cutoff float64)
- func (model Model) DiscShape() (scaleLength, height float64)
- func (model Model) HaloShape() float64
- func (model Model) Shares() (bulge, disc, halo float64)
- func (model Model) Sun() (distance, circular float64)
- func (model Model) WithBulge(share, exponent, cutoff float64) Model
- func (model Model) WithDisc(share, scaleLength, height float64) Model
- func (model Model) WithHalo(share, scale float64) Model
- type Numbers
- type Pass
- type Place
- type Potential
- type Pull
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Back ¶
Back runs a star's orbit back over a span, in so many steps, and reports its nearest pass to the centre over them, and its state at the start of the span.
It refuses a span that is not positive, no steps, and an orbit that ran away, through the centre or past what a float holds.
func Kiloparsecs ¶
Kiloparsecs is a length of so many kiloparsecs.
Types ¶
type Bulge ¶
type Bulge struct {
// contains filtered or unexported fields
}
Bulge is a bulge whose density falls as a power of the distance from the centre with an exponential cut-off: proportional to r to the exponent, times e to the minus (r over the cut-off) squared, as galpy's PowerSphericalPotentialwCutoff. The exponent is negative.
Its pull is that of the mass within the distance, which the regularised lower incomplete gamma function gives, of order half of three plus the exponent.
func (Bulge) GM ¶
GM is the whole bulge's mass times the gravitational constant, in kiloparsecs times kilometres per second squared.
func (Bulge) Order ¶
Order is the incomplete gamma function's order for the mass within a distance: half of three plus the exponent.
func (Bulge) Pull ¶
Pull is the pull of the mass within the distance, toward the centre. At the centre itself it is not a number.
type Disc ¶
type Disc struct {
// contains filtered or unexported fields
}
Disc is a Miyamoto-Nagai disc: a Plummer sphere stretched along the plane by a scale length, with a scale height, both in kiloparsecs.
func (Disc) GM ¶
GM is the disc's mass times the gravitational constant, in kiloparsecs times kilometres per second squared.
func (Disc) Pull ¶
Pull is the disc's pull: in the plane as a point mass at the reach, out of it the same scaled by the lift's share of the hypotenuse.
type Halo ¶
type Halo struct {
// contains filtered or unexported fields
}
Halo is a Navarro-Frenk-White halo: a density that falls as the distance near the centre and as its cube far out, turning at a scale radius in kiloparsecs.
Its gm is of the mass of a scale: four pi times the density's scale times the radius cubed, times the gravitational constant.
func (Halo) GM ¶
GM is the mass of a scale times the gravitational constant, in kiloparsecs times kilometres per second squared.
func (Halo) Pull ¶
Pull is the pull of the mass within the distance, toward the centre. At the centre itself it is not a number.
type Kepler ¶
type Kepler struct {
// contains filtered or unexported fields
}
Kepler is the pull of one point mass at the centre.
func (Kepler) GM ¶
GM is the body's mass times the gravitational constant, in kiloparsecs times kilometres per second squared.
type MilkyWay ¶
type MilkyWay struct {
// contains filtered or unexported fields
}
MilkyWay is the galaxy's pull as a model has it: a bulge whose density is a power law with an exponential cut-off, a Miyamoto-Nagai disc and a Navarro-Frenk-White halo, and the black hole at the centre as a point mass.
Each part is normalised by its share of the radial force at the Sun's distance in the model, where the circular speed is the model's.
Bovy 2015 says MWPotential2014 does not contain the black hole. It is added here, from the measured mass of Sgr A*, since the inner parsecs are this search's regime; its pull is a part in twenty thousand of the galaxy's at the Sun.
The model lives at its own distance for the Sun and its own circular speed there. A caller placing the Sun at its measured distance does that in the transform, as galpy does, not by rescaling the model.
That seam is open. At the measured distance, 8.277 kpc, the model's circular speed is about 219 km/s (220 at 8 kpc, falling as the curve's slope has it) and the Sun's about 231 with its own motion added; the galactocentric frame's Sun goes 251.5 along the rotation.
The 20 km/s between them is carried by every star the frame places until the model is placed at the frame's Sun, as galpy's ro and vo do, or the frame's Sun is given the model's speed. That choice is not made here.
func NewMilkyWay ¶
NewMilkyWay is the galaxy of a model, with the given black hole at the centre: the caller makes it, as a point of the ledger's sgr-a-mass for the real one.
It refuses a model the physics cannot hold: no circle for the Sun, a negative share, a bulge whose well diverges, or a part with no size.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is a galaxy's numbers as Bovy 2015 gives MWPotential2014's: the Sun's distance from the centre and the circular speed there, which the model is normalised to; each part's share of the radial force there; and each part's shape.
Lengths are kiloparsecs, the speed is kilometres per second, shares and the exponent are plain numbers. A model is built from the Sun's circle with each part added: NewModel(8, 220).WithBulge(0.05, -1.8, 1.9) and so on, as MWPotential2014 does from the research ledger.
func MWPotential2014 ¶
func MWPotential2014() Model
MWPotential2014 is the model as the research ledger has it from the paper's table 1: the Sun at 8 kpc circling at 220 km/s, the bulge a twentieth of the force there, the disc three fifths, the halo the rest.
func NewModel ¶
NewModel is a model of a galaxy where the Sun is so many kiloparsecs from the centre, circling at so many kilometres per second, with no parts yet.
func (Model) BulgeShape ¶
BulgeShape is the bulge's density exponent and its cut-off in kiloparsecs.
func (Model) Sun ¶
Sun is the Sun's distance from the centre in kiloparsecs and the circular speed there in kilometres per second.
func (Model) WithBulge ¶
WithBulge is the model with its bulge: the bulge's share of the radial force at the Sun, its density's exponent and its cut-off in kiloparsecs.
type Numbers ¶
type Numbers struct {
// contains filtered or unexported fields
}
Numbers is a star's place in kiloparsecs and its motion in kilometres per second along each axis.
type Pass ¶
type Pass struct {
// contains filtered or unexported fields
}
Pass is a star's nearest sampled pass to the centre over a span: how near it came, how long ago, and the step's shares of the pass there.
Positions are sampled at each step's end, so the pass is the nearest of those, not the orbit's own pericentre; more steps bring the two together.
How many steps is set by the nearest pass itself: a step dt resolves a pass at a distance r at a speed v under a pull a when v dt over r and a dt squared over r are both small, and the leapfrog's errors are of the size of the first's square and of the second.
Those two are the step's shares, and the pass carries them from the step it was found at, so a caller can tell a resolved pass from a plunge the steps missed: a star that fell through the inner parsecs between two samples has a pass with large shares.
orbittest.Resolved is the same measure from a point mass's closed form, and the tests hold the kernel to this reference where it is under a tenth. A run that wants the passes through the inner parsecs sizes its steps by the nearest pass it means to see.
func NewPass ¶
NewPass is a pass so many kiloparsecs from the centre, so many units of time ago, with the step's shares of it in the star's motion and in the pull.
func (Pass) Steps ¶
Steps is the step's shares of the pass: how far the star moved in one step, and how much the pull moved it over one step squared, each as a share of the pass's distance. Both small means the steps resolved the pass.
A pass through the centre itself has shares that are not finite, since no step resolves it.
type Place ¶
type Place struct {
// contains filtered or unexported fields
}
Place is a position from the galactic centre.
type Potential ¶
type Potential interface {
// Pull is the acceleration at a place: the change in a star's
// velocity there over one unit of time.
Pull(at Place) Pull
}
Potential is what pulls on a star.
type Pull ¶
type Pull struct {
// contains filtered or unexported fields
}
Pull is an acceleration: the change of velocity over one unit of time along each galactic axis, in kilometres per second.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is a star's place and motion.
func StateOf ¶
StateOf is a star at x, y and z kiloparsecs from the centre, moving vx, vy and vz kilometres per second along the axes.
func (State) Motion ¶
Motion is how the star moves. Nothing stepped here moves faster than light, so the error is for a state built from numbers that do.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package orbittest is what orbit's tests and gpu/orbit's share: a centre to orbit, the closed forms of a point mass's orbits, and how well a run of steps resolves one.
|
Package orbittest is what orbit's tests and gpu/orbit's share: a centre to orbit, the closed forms of a point mass's orbits, and how well a run of steps resolves one. |