ggdisturbance#
-
namespace saltro
-
namespace disturbances
-
class GGDisturbance : public Disturbance#
- #include <ggdisturbance.h>
Gravity gradient (GG) disturbance model.
Computes torque due to the differential gravitational force (gravity gradient) acting on a spatially extended spacecraft. The torque arises because the spacecraft’s geometry extends over a distance comparable to the gravitational field gradient.
The gravity gradient torque is approximated as:
\[ \boldsymbol{\tau}_{\text{gg}} = 3 \frac{\mu}{r^5} \mathbf{r} \times (\mathbf{J}\,\mathbf{r}) \]where:
\(\mu\) is Earth’s gravitational parameter
\(\mathbf{r}\) is the spacecraft position (body-fixed frame)
\(\mathbf{J}\) is the spacecraft’s moment of inertia tensor
This effect is typically small but important for high-precision attitude control and for large spacecraft with substantial moment of inertia asymmetry.
Public Types
-
using Vec3 = Eigen::Vector3d#
-
using Mat33 = Eigen::Matrix3d#
-
using BaseState = ::Disturbance::BaseState#
-
using Mat34 = ::Disturbance::Mat34#
-
using Mat44 = ::Disturbance::Mat44#
-
using T443 = ::Disturbance::T443#
Public Functions
-
GGDisturbance() = default#
Default constructor; initializes with identity inertia.
-
explicit GGDisturbance(const Mat33 &inertia)#
Construct a gravity gradient disturbance with specified inertia.
- Parameters:
inertia – 3×3 moment of inertia tensor (kg·m²).
-
inline void setInertia(const Mat33 &inertia)#
Set the spacecraft’s moment of inertia tensor.
- Parameters:
inertia – 3×3 inertia matrix.
-
inline const Mat33 &inertia() const#
Get the spacecraft’s moment of inertia tensor.
- Returns:
Const reference to the 3×3 inertia matrix.
-
virtual Vec3 torque(const BaseState &x, const DisturbanceConfig &dist_cfg) const override#
Compute gravity gradient torque.
The position vector must be in the body-fixed reference frame for correct computation of the cross product with the inertia tensor.
- Parameters:
x – Base state (quaternion for frame transformations).
dist_cfg – Disturbance configuration (unused for GG).
- Returns:
3D gravity gradient torque.
-
Vec3 torque(const BaseState &x, const DisturbanceConfig &dist_cfg, const Vec3 &r_body, const Mat33 &J) const#
Compute gravity gradient torque with explicit position.
Extended interface allowing direct position input in body frame.
- Parameters:
x – Base state.
dist_cfg – Disturbance configuration.
r_body – Position vector in body frame (m).
J – Inertia tensor (kg·m²).
- Returns:
3D gravity gradient torque.
-
Mat34 dtorque_dq(const BaseState &x, const DisturbanceConfig &dist_cfg, const Vec3 &r_body, const Mat33 &J, const Mat34 &dr_dq) const#
Jacobian of gravity gradient torque with respect to quaternion.
- Parameters:
x – Base state.
dist_cfg – Disturbance configuration.
r_body – Position in body frame.
J – Inertia tensor.
dr_dq – Jacobian of position with respect to quaternion (4×3).
- Returns:
3×4 Jacobian matrix.
-
T443 ddtorque_dqdq(const BaseState &x, const DisturbanceConfig &dist_cfg, const Vec3 &r_body, const Mat33 &J, const Mat34 &dr_dq, const std::array<Mat44, 3> &d2r_dq2) const#
Hessian of gravity gradient torque with respect to quaternion.
- Parameters:
x – Base state.
dist_cfg – Disturbance configuration.
r_body – Position in body frame.
J – Inertia tensor.
dr_dq – Jacobian of position with respect to quaternion.
d2r_dq2 – Array of three 4×4 Hessian matrices for position.
- Returns:
Tensor3 with 3 slices of 4×4 matrices.
-
class GGDisturbance : public Disturbance#
-
namespace disturbances