actuator#
-
class Actuator#
- #include <actuator.h>
Base class for spacecraft actuators (torque-producing devices).
Abstract base class defining the interface for actuators (e.g., reaction wheels, magnetorquers). Each actuator produces torque in a fixed direction (axis) with bounded control authority (u_max).
Derived classes must implement methods for:
Torque computation: computing the torque vector from a scalar control input
Jacobians: first derivatives of torque with respect to state and control
Hessians: second derivatives for optimization algorithms
Public Types
-
using Vec3 = Eigen::Matrix<double, 3, 1>#
-
using BaseState = Eigen::Matrix<double, 7, 1>#
-
using Mat13 = Eigen::Matrix<double, 1, 3>#
-
using Mat73 = Eigen::Matrix<double, 7, 3>#
Public Functions
-
Actuator() = delete#
-
Actuator(const Vec3 &axis, double u_max)#
Construct an actuator with specified axis and control limit.
- Parameters:
axis – Unit vector specifying the torque direction in body frame.
u_max – Control input magnitude limit (amplitude constraint).
-
virtual ~Actuator() = default#
-
const Vec3 &axis() const noexcept#
Get the torque axis vector.
- Returns:
Const reference to the unit vector along the torque axis.
-
double u_max() const noexcept#
Get the maximum control input magnitude.
- Returns:
The control input saturation limit.
-
double clamp(double u) const noexcept#
Clamp a control input to the saturation limits.
Returns \(\text{clamp}(u, -u_{\max}, u_{\max})\).
- Parameters:
u – Input control value.
- Returns:
Saturated control input in \([-u_{\max}, u_{\max}]\).
-
virtual Vec3 torque(double u, const BaseState &x) const#
Compute the torque vector produced by this actuator.
Returns the torque vector as a function of control input and spacecraft state.
- Parameters:
u – Control input (typically in [-u_max, u_max]).
x – Base state vector (7D: [av; q; …]).
- Returns:
3D torque vector in body frame (Newton-meters).
-
virtual Mat13 dtorq_du(double u, const BaseState &x) const#
Jacobian of torque with respect to control input.
Returns \(\frac{\partial \boldsymbol{\tau}}{\partial u}\) as a 1×3 row vector.
- Parameters:
u – Control input.
x – Base state.
- Returns:
1×3 Jacobian matrix.
-
virtual Mat73 dtorq_dbasestate(double u, const BaseState &x) const#
Jacobian of torque with respect to base state.
Returns \(\frac{\partial \boldsymbol{\tau}}{\partial \mathbf{x}}\) as a 7×3 matrix.
- Parameters:
u – Control input.
x – Base state (7D).
- Returns:
7×3 Jacobian matrix.
-
virtual T113 ddtorq_dudu(double u, const BaseState &x) const#
Hessian of torque with respect to control input (second derivatives).
Returns a 3-slice tensor of \(\frac{\partial^2 \tau_i}{\partial u^2}\).
- Parameters:
u – Control input.
x – Base state.
- Returns:
Tensor3 with 3 slices of 1×1 matrices (one per torque component).
-
virtual T173 ddtorq_dudbasestate(double u, const BaseState &x) const#
Hessian of torque with respect to control input and base state.
Returns mixed partial derivatives \(\frac{\partial^2 \tau_i}{\partial u \partial x_j}\).
- Parameters:
u – Control input.
x – Base state.
- Returns:
Tensor3 with 3 slices of 1×7 matrices.
-
virtual T773 ddtorq_dbasestatedbasestate(double u, const BaseState &x) const#
Hessian of torque with respect to base state (full second derivatives).
Returns \(\frac{\partial^2 \tau_i}{\partial x_j \partial x_k}\) for each component i.
- Parameters:
u – Control input.
x – Base state.
- Returns:
Tensor3 with 3 slices of 7×7 matrices.
Public Static Attributes
-
static constexpr int input_len = 1#
Protected Attributes
-
double u_max_#
Control input magnitude limit.