sailfish.physics.kepler.PointMass

class sailfish.physics.kepler.PointMass(mass: float, position_x: float, position_y: float, velocity_x: float, velocity_y: float)[source]

Bases: NamedTuple

The mass, 2D position, and 2D velocity of a point-like particle

__init__()

Methods

__init__()

count(value, /)

Return number of occurrences of value.

gravitational_acceleration(x, y, ...)

Return the gravitational acceleration due to a point mass.

gravitational_potential(x, y, softening_length)

Return the gravitational potential of a point mass, with softening.

index(value[, start, stop])

Return first index of value.

perturb([dm, dpx, dpy])

Perturb the mass and momentum of a point mass.

Attributes

angular_momentum

The angular momentum of a point mass

kinetic_energy

The kinetic energy of a point mass

mass

Alias for field number 0

position_x

Alias for field number 1

position_y

Alias for field number 2

velocity_x

Alias for field number 3

velocity_y

Alias for field number 4

property angular_momentum: float

The angular momentum of a point mass

count(value, /)

Return number of occurrences of value.

gravitational_acceleration(x: float, y: float, softening_length: float) -> (<class 'float'>, <class 'float'>)[source]

Return the gravitational acceleration due to a point mass.

gravitational_potential(x: float, y: float, softening_length: float) float[source]

Return the gravitational potential of a point mass, with softening.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

property kinetic_energy: float

The kinetic energy of a point mass

mass: float

Alias for field number 0

perturb(dm: float = 0.0, dpx: float = 0.0, dpy: float = 0.0) PointMass[source]

Perturb the mass and momentum of a point mass.

Since the point mass maintains a velocity rather than momentum, the velocity is changed according to

dv = (dp - v dm) / m

position_x: float

Alias for field number 1

position_y: float

Alias for field number 2

velocity_x: float

Alias for field number 3

velocity_y: float

Alias for field number 4