Skip to content

inertialsim.symbolic

Symbolic trajectories.

The symbolic module is optional. It provides exact symbolic/analytical trajectories (attitude, position, and velocity as functions of time) along with their derivatives. Symbolic pose, angular rate and specific force enable true ground-truth comparisons for testing and analysis. The module requires one additional dependency:

Classes:

Name Description
Trajectory

Base class for symbolic trajectories.

ConingRotation

Coning rotation.

ZigZagTrajectory

Zigzag trajectory.

EarthRotation

Earth rotation.

Trajectory

Trajectory(
    rotation_vector: Vector,
    position_vector: Vector,
    gravity_vector: Vector,
)

Base class for symbolic trajectories.

Define symbolic/analytical trajectories in attitude (orientation) and position. Velocity, angular rate, and specific force are analytically derived. Additional useful intermediates (Jacobians, Lie algebra derivatives, etc.) are also analytically derived. Methods to efficiently sample numerical values are provided.

Inputs must be the attitude as a rotation vector and the position as a Cartesian vector, both as functions of time and with type sympy.vector.vector.Vector. Inputs must use the symbol t for time and a single sympy.vector.coordsysrect.CoordSys3D world coordinate system named coordinates.

Parameters:

Name Type Description Default
rotation_vector Vector

Attitude in rotation vector form.

required
position_vector Vector

Position in world coordinates.

required
gravity_vector Vector

Gravity vector in world coordinates.

required

Methods:

Name Description
compose

Compose two trajectories.

rotation_vector

Return the attitude as a rotation vector.

rotation_vector_rate

Return the attitude rate as a rotation vector.

rotation_matrix

Return the attitude as a rotation matrix.

angular_rate

Return the angular rate.

rotation

Return the attitude as a Rotation instance.

extended_pose

Return the attitude, position, and velocity.

velocity

Return the velocity.

position

Return the position.

acceleration

Return the acceleration.

specific_force

Return the specific force.

plot_attitude

Plot attitude variables.

plot_translation

Plot translation variables.

plot

Plots trajectory variables.

Attributes:

Name Type Description
time
coordinates

time instance-attribute

time = symbols('t', real=True, positive=True)

coordinates instance-attribute

coordinates = CoordSys3D('coordinates')

compose

compose(
    other: Self, gravity: float = standard_magnitude()
) -> Trajectory

Compose two trajectories.

Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self}^{-1} * T_{other}\).

Parameters:

Name Type Description Default
other Self

Trajectory object to compose with.

required
gravity float

Magnitude of gravity to use in the composed result.

standard_magnitude()

Returns:

Type Description
Trajectory

New Trajectory instance.

rotation_vector

rotation_vector(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the attitude as a rotation vector.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Rotation vector.

rotation_vector_rate

rotation_vector_rate(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the attitude rate as a rotation vector.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Rotation vector rate.

rotation_matrix

rotation_matrix(
    time: ArrayLike | None = None,
) -> Matrix | NDArray

Return the attitude as a rotation matrix.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Matrix | NDArray

Rotation matrix.

angular_rate

angular_rate(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the angular rate.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Angular rate.

rotation

rotation(time: ArrayLike) -> Rotation

Return the attitude as a Rotation instance.

Returns a geometry.Rotation instance with data sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Array of sampling times.

required

Returns:

Type Description
Rotation

Rotation instance.

extended_pose

extended_pose(time: ArrayLike) -> ExtendedPose

Return the attitude, position, and velocity.

Returns a geometry.ExtendedPose instance with data sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Array of sampling times.

required

Returns:

Type Description
ExtendedPose

ExtendedPose instance.

velocity

velocity(time: ArrayLike | None = None) -> Vector | NDArray

Return the velocity.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Velocity vector.

position

position(time: ArrayLike | None = None) -> Vector | NDArray

Return the position.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Position vector.

acceleration

acceleration(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the acceleration.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Acceleration vector in world/navigation coordinates.

specific_force

specific_force(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the specific force.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Specific force vector.

plot_attitude

plot_attitude(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]

Plot attitude variables.

Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
plots tuple[TimeSeries, TimeSeries, TimeSeries]

Tuple containing three plot handles.

plot_translation

plot_translation(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]

Plot translation variables.

Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
plots tuple[Scatter, TimeSeries, TimeSeries]

Tuple containing three plot handles.

plot

plot(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[
    tuple[TimeSeries, TimeSeries, TimeSeries],
    tuple[Scatter, TimeSeries, TimeSeries],
]

Plots trajectory variables.

Plots attitude and translation variables. See plot_attitude and plot_translation for details.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
attitude_plots tuple[TimeSeries, TimeSeries, TimeSeries]

Tuple containing three plot handles.

translation_plots tuple[Scatter, TimeSeries, TimeSeries]

Tuple containing three plot handles.

ConingRotation

ConingRotation(
    amplitude: float | None = None,
    frequency: float | None = None,
)

Bases: Trajectory

Coning rotation.

Coning motion is rotation of a fixed magnitude about a rotation vector that oscillates out-of-phase around two axes. See Reference [33] for further details.

\[ \mathbf{\phi}_{coning}(t) = \begin{bmatrix} \theta \sin \omega t \\ \theta \cos \omega t \\ 0 \end{bmatrix} \]

The rotation vector inscribes a cone in the world frame. Coning motion results in an angular rate that has a constant component in the third axis. Naive integration schemes will rectify this fixed component into a linear drift. For this reason, it is a standard test case.

As a pure rotation, by default, gravity is set to zero.

Amplitude, \(\theta\), is the amplitude of the rotation in radians and is typically small resulting from vibration. Frequency, \(\omega\) should be the frequency in Hz, which is converted internally to angular frequency. If both or either are None, they are represented symbolically.

Parameters:

Name Type Description Default
amplitude float | None

Amplitude of coning rotation.

None
frequency float | None

Frequency of coning rotation.

None

Methods:

Name Description
compose

Compose two trajectories.

rotation_vector

Return the attitude as a rotation vector.

rotation_vector_rate

Return the attitude rate as a rotation vector.

rotation_matrix

Return the attitude as a rotation matrix.

angular_rate

Return the angular rate.

rotation

Return the attitude as a Rotation instance.

extended_pose

Return the attitude, position, and velocity.

velocity

Return the velocity.

position

Return the position.

acceleration

Return the acceleration.

specific_force

Return the specific force.

plot_attitude

Plot attitude variables.

plot_translation

Plot translation variables.

plot

Plots trajectory variables.

Attributes:

Name Type Description
time
coordinates

time instance-attribute

time = symbols('t', real=True, positive=True)

coordinates instance-attribute

coordinates = CoordSys3D('coordinates')

compose

compose(
    other: Self, gravity: float = standard_magnitude()
) -> Trajectory

Compose two trajectories.

Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self}^{-1} * T_{other}\).

Parameters:

Name Type Description Default
other Self

Trajectory object to compose with.

required
gravity float

Magnitude of gravity to use in the composed result.

standard_magnitude()

Returns:

Type Description
Trajectory

New Trajectory instance.

rotation_vector

rotation_vector(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the attitude as a rotation vector.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Rotation vector.

rotation_vector_rate

rotation_vector_rate(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the attitude rate as a rotation vector.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Rotation vector rate.

rotation_matrix

rotation_matrix(
    time: ArrayLike | None = None,
) -> Matrix | NDArray

Return the attitude as a rotation matrix.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Matrix | NDArray

Rotation matrix.

angular_rate

angular_rate(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the angular rate.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Angular rate.

rotation

rotation(time: ArrayLike) -> Rotation

Return the attitude as a Rotation instance.

Returns a geometry.Rotation instance with data sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Array of sampling times.

required

Returns:

Type Description
Rotation

Rotation instance.

extended_pose

extended_pose(time: ArrayLike) -> ExtendedPose

Return the attitude, position, and velocity.

Returns a geometry.ExtendedPose instance with data sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Array of sampling times.

required

Returns:

Type Description
ExtendedPose

ExtendedPose instance.

velocity

velocity(time: ArrayLike | None = None) -> Vector | NDArray

Return the velocity.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Velocity vector.

position

position(time: ArrayLike | None = None) -> Vector | NDArray

Return the position.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Position vector.

acceleration

acceleration(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the acceleration.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Acceleration vector in world/navigation coordinates.

specific_force

specific_force(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the specific force.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Specific force vector.

plot_attitude

plot_attitude(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]

Plot attitude variables.

Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
plots tuple[TimeSeries, TimeSeries, TimeSeries]

Tuple containing three plot handles.

plot_translation

plot_translation(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]

Plot translation variables.

Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
plots tuple[Scatter, TimeSeries, TimeSeries]

Tuple containing three plot handles.

plot

plot(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[
    tuple[TimeSeries, TimeSeries, TimeSeries],
    tuple[Scatter, TimeSeries, TimeSeries],
]

Plots trajectory variables.

Plots attitude and translation variables. See plot_attitude and plot_translation for details.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
attitude_plots tuple[TimeSeries, TimeSeries, TimeSeries]

Tuple containing three plot handles.

translation_plots tuple[Scatter, TimeSeries, TimeSeries]

Tuple containing three plot handles.

ZigZagTrajectory

ZigZagTrajectory(
    attitude_amplitudes: ArrayLike | None = None,
    attitude_frequencies: ArrayLike | None = None,
    position_amplitudes: ArrayLike | None = None,
    position_frequencies: ArrayLike | None = None,
    gravity: float = standard_magnitude(),
)

Bases: Trajectory

Zigzag trajectory.

The attitude is defined by independent oscillations in roll, pitch, and yaw. The position is defined by a Figure-8 pattern in the x-y plane and oscillations in the z-axis. This approximates the motion of a holonomic vehicle, like a drone, translating and rotation in all axes independently. The effect of gravity is modeled by a constant vertical value.

\[ \mathbf{\phi}_{zigzag}(t) = \begin{bmatrix} \theta_{x} \sin \omega_{x} t \\ \theta_{y} \cos \omega_{y} t \\ \theta_{z} \sin \omega_{z} t \\ \end{bmatrix} \]
\[ \mathbf{p}_{zigzag}(t) = \begin{bmatrix} A_{x} \sin \omega_{px} t \\ A_{y} \sin \omega_{py} t \cos \omega_{py} t \\ A_{z} \cos \omega_{pz} t \\ \end{bmatrix} \]

Attitude amplitudes must be an array of values for the x, y, z axes in radians. Position amplitudes must be an array of values for the x, y, z axes in meters. Frequencies must be an array of values in Hz, which are converted internally to angular frequencies. If any amplitude or frequency inputs are None, they are represented symbolically.

By default, standard gravity (9.80665 m/s/s) is applied in the vertical axis.

Example

The following example results in an attitude with large changes in yaw angle at low frequency (± 70 degrees once every 50 seconds), with smaller, higher frequency changes in roll and pitch. The position follows a 100m long Figure-8 path in x, y and oscillates ± 5 meters in z.

zigzag = ZigZagTrajectory(
    attitude_amplitudes=np.deg2rad([2.0, 3.0, 70.0]),
    attitude_frequencies=[0.25, 0.4, 0.02],
    position_amplitudes=[100, 75, 5],
    position_frequencies=[0.009, 0.011, 0.034],
)

Parameters:

Name Type Description Default
attitude_amplitudes ArrayLike | None

Attitude (rotation) amplitudes.

None
attitude_frequencies ArrayLike | None

Attitude (rotation) frequencies.

None
position_amplitudes ArrayLike | None

Position amplitudes.

None
position_frequencies ArrayLike | None

Position frequencies.

None
gravity float

Magnitude of gravity.

standard_magnitude()

Methods:

Name Description
compose

Compose two trajectories.

rotation_vector

Return the attitude as a rotation vector.

rotation_vector_rate

Return the attitude rate as a rotation vector.

rotation_matrix

Return the attitude as a rotation matrix.

angular_rate

Return the angular rate.

rotation

Return the attitude as a Rotation instance.

extended_pose

Return the attitude, position, and velocity.

velocity

Return the velocity.

position

Return the position.

acceleration

Return the acceleration.

specific_force

Return the specific force.

plot_attitude

Plot attitude variables.

plot_translation

Plot translation variables.

plot

Plots trajectory variables.

Attributes:

Name Type Description
time
coordinates

time instance-attribute

time = symbols('t', real=True, positive=True)

coordinates instance-attribute

coordinates = CoordSys3D('coordinates')

compose

compose(
    other: Self, gravity: float = standard_magnitude()
) -> Trajectory

Compose two trajectories.

Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self}^{-1} * T_{other}\).

Parameters:

Name Type Description Default
other Self

Trajectory object to compose with.

required
gravity float

Magnitude of gravity to use in the composed result.

standard_magnitude()

Returns:

Type Description
Trajectory

New Trajectory instance.

rotation_vector

rotation_vector(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the attitude as a rotation vector.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Rotation vector.

rotation_vector_rate

rotation_vector_rate(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the attitude rate as a rotation vector.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Rotation vector rate.

rotation_matrix

rotation_matrix(
    time: ArrayLike | None = None,
) -> Matrix | NDArray

Return the attitude as a rotation matrix.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Matrix | NDArray

Rotation matrix.

angular_rate

angular_rate(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the angular rate.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Angular rate.

rotation

rotation(time: ArrayLike) -> Rotation

Return the attitude as a Rotation instance.

Returns a geometry.Rotation instance with data sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Array of sampling times.

required

Returns:

Type Description
Rotation

Rotation instance.

extended_pose

extended_pose(time: ArrayLike) -> ExtendedPose

Return the attitude, position, and velocity.

Returns a geometry.ExtendedPose instance with data sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Array of sampling times.

required

Returns:

Type Description
ExtendedPose

ExtendedPose instance.

velocity

velocity(time: ArrayLike | None = None) -> Vector | NDArray

Return the velocity.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Velocity vector.

position

position(time: ArrayLike | None = None) -> Vector | NDArray

Return the position.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Position vector.

acceleration

acceleration(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the acceleration.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Acceleration vector in world/navigation coordinates.

specific_force

specific_force(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the specific force.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Specific force vector.

plot_attitude

plot_attitude(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]

Plot attitude variables.

Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
plots tuple[TimeSeries, TimeSeries, TimeSeries]

Tuple containing three plot handles.

plot_translation

plot_translation(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]

Plot translation variables.

Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
plots tuple[Scatter, TimeSeries, TimeSeries]

Tuple containing three plot handles.

plot

plot(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[
    tuple[TimeSeries, TimeSeries, TimeSeries],
    tuple[Scatter, TimeSeries, TimeSeries],
]

Plots trajectory variables.

Plots attitude and translation variables. See plot_attitude and plot_translation for details.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
attitude_plots tuple[TimeSeries, TimeSeries, TimeSeries]

Tuple containing three plot handles.

translation_plots tuple[Scatter, TimeSeries, TimeSeries]

Tuple containing three plot handles.

EarthRotation

EarthRotation(angular_rate: ArrayLike | None = None)

Bases: Trajectory

Earth rotation.

Earth's rotation relative to inertial space. Earth rotates around a fixed axis at an approximately constant rate. See the geodesy.datums and geodesy.EarthRate modules for more details and to calculate standard rotation rates.

This trajectory defines a pure rotation with translation and gravity components set to zero. Since Earth is in gravitational freefall this is sufficient for the standard definition of an inertial frame in inertial navigation.

If the angular_rate input is not supplied it will be represented by the symbolic values \(\omega_{x}\), \(\omega_{y}\), and \(\omega_{z}\) in the world/navigation frame.

Parameters:

Name Type Description Default
angular_rate ArrayLike | None

Angular rate of Earth (rad/s) relative to inertial space.

None

Methods:

Name Description
compose

Compose two trajectories.

rotation_vector

Return the attitude as a rotation vector.

rotation_vector_rate

Return the attitude rate as a rotation vector.

rotation_matrix

Return the attitude as a rotation matrix.

angular_rate

Return the angular rate.

rotation

Return the attitude as a Rotation instance.

extended_pose

Return the attitude, position, and velocity.

velocity

Return the velocity.

position

Return the position.

acceleration

Return the acceleration.

specific_force

Return the specific force.

plot_attitude

Plot attitude variables.

plot_translation

Plot translation variables.

plot

Plots trajectory variables.

Attributes:

Name Type Description
time
coordinates

time instance-attribute

time = symbols('t', real=True, positive=True)

coordinates instance-attribute

coordinates = CoordSys3D('coordinates')

compose

compose(
    other: Self, gravity: float = standard_magnitude()
) -> Trajectory

Compose two trajectories.

Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self}^{-1} * T_{other}\).

Parameters:

Name Type Description Default
other Self

Trajectory object to compose with.

required
gravity float

Magnitude of gravity to use in the composed result.

standard_magnitude()

Returns:

Type Description
Trajectory

New Trajectory instance.

rotation_vector

rotation_vector(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the attitude as a rotation vector.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Rotation vector.

rotation_vector_rate

rotation_vector_rate(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the attitude rate as a rotation vector.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Rotation vector rate.

rotation_matrix

rotation_matrix(
    time: ArrayLike | None = None,
) -> Matrix | NDArray

Return the attitude as a rotation matrix.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Matrix | NDArray

Rotation matrix.

angular_rate

angular_rate(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the angular rate.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Angular rate.

rotation

rotation(time: ArrayLike) -> Rotation

Return the attitude as a Rotation instance.

Returns a geometry.Rotation instance with data sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Array of sampling times.

required

Returns:

Type Description
Rotation

Rotation instance.

extended_pose

extended_pose(time: ArrayLike) -> ExtendedPose

Return the attitude, position, and velocity.

Returns a geometry.ExtendedPose instance with data sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Array of sampling times.

required

Returns:

Type Description
ExtendedPose

ExtendedPose instance.

velocity

velocity(time: ArrayLike | None = None) -> Vector | NDArray

Return the velocity.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Velocity vector.

position

position(time: ArrayLike | None = None) -> Vector | NDArray

Return the position.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Position vector.

acceleration

acceleration(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the acceleration.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Acceleration vector in world/navigation coordinates.

specific_force

specific_force(
    time: ArrayLike | None = None,
) -> Vector | NDArray

Return the specific force.

Returns a symbolic representation if the time input is None (default) or a numeric array sampled at the input times if supplied.

Parameters:

Name Type Description Default
time ArrayLike | None

Array of sampling times.

None

Returns:

Type Description
Vector | NDArray

Specific force vector.

plot_attitude

plot_attitude(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]

Plot attitude variables.

Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
plots tuple[TimeSeries, TimeSeries, TimeSeries]

Tuple containing three plot handles.

plot_translation

plot_translation(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]

Plot translation variables.

Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
plots tuple[Scatter, TimeSeries, TimeSeries]

Tuple containing three plot handles.

plot

plot(
    time: ArrayLike, title_prefix: str = ""
) -> tuple[
    tuple[TimeSeries, TimeSeries, TimeSeries],
    tuple[Scatter, TimeSeries, TimeSeries],
]

Plots trajectory variables.

Plots attitude and translation variables. See plot_attitude and plot_translation for details.

Parameters:

Name Type Description Default
time ArrayLike

Sampling times.

required
title_prefix str

Prefix for plot titles.

''

Returns:

Name Type Description
attitude_plots tuple[TimeSeries, TimeSeries, TimeSeries]

Tuple containing three plot handles.

translation_plots tuple[Scatter, TimeSeries, TimeSeries]

Tuple containing three plot handles.