Drag Torque¶
Atmospheric drag acts on the spacecraft’s surfaces. When the centre of pressure and centre of mass differ, it also produces a torque. Here we follow that torque over several minutes. Drag force on the orbit is left for Forces on a Spacecraft.
At an illustrative altitude of 300 km, the 10 × 30 × 10 cm 3U body starts 45° from its flight direction, without a spin. Its centre of mass is offset 2 cm along the long axis, and drag is its only applied torque. In the animation, green is the long body axis and yellow is the flight direction. This simple model shows the first turn toward the flow, without rotational damping.
import matplotlib.pyplot as plt
import numpy as np
import ADCS
environment = ADCS.Environment(atmosphere=ADCS.SMADAtmosphere())
size = np.array([0.1, 0.3, 0.1])
faces = []
for axis in range(3):
for sign in (-1.0, 1.0):
normal = sign * np.eye(3)[axis]
faces.append(ADCS.disturbances.GeometryFace(
area=np.prod(np.delete(size, axis)),
centroid=0.5 * size[axis] * normal,
normal=normal, CD=2.2,
))
geometry = ADCS.disturbances.GeometryConfig(faces)
drag = ADCS.disturbances.Drag_Disturbance(geometry)
satellite = ADCS.Satellite(
mass=4.0,
COM=np.array([0.0, 0.02, 0.0]),
J_0=np.diag([0.0333, 0.00667, 0.0333]),
disturbances=[drag],
)
initial_state = ADCS.State(
w=np.zeros(3),
q=np.array([np.cos(np.pi / 8), 0.0, 0.0, -np.sin(np.pi / 8)]),
)
orbit = ADCS.Orbital_State(
environment=environment, J2000=0.22,
R=np.array([6678.1363, 0.0, 0.0]),
V=np.array([0.0, np.sqrt(398600.4415 / 6678.1363), 0.0]),
)
results = ADCS.simulate(
x=initial_state, satellite=satellite, os0=orbit,
environment=environment, dt=5.0, tf=390.0,
)
Geometry tip
Specify a drag coefficient for each face in the geometry. A commonly used value is \(C_D=2.2\) [1].
face = ADCS.disturbances.GeometryFace(
area=area, centroid=centroid, normal=normal, CD=2.2,
)
Plots¶
The dashed line shows the same initial attitude held fixed without torque.
run = results.first()
time = np.asarray(run.time_s) / 60
def angle_to_velocity(states):
velocity = np.array([
orbital_state.get_state_vector(x=state)["v"]
for state, orbital_state in zip(states, run.os_hist)
])
cosine = velocity[:, 1] / np.linalg.norm(velocity, axis=1)
return np.rad2deg(np.arccos(np.clip(cosine, -1.0, 1.0)))
plt.figure()
plt.plot(time, angle_to_velocity(run.state_hist), label="With drag")
plt.plot(time, angle_to_velocity([initial_state] * len(run.os_hist)),
"--", label="Without drag")
plt.xlabel("Time [min]")
plt.ylabel("Long axis to velocity [deg]")
plt.legend()
torques = np.array([
drag.torque(satellite, state, orbital_state)
for state, orbital_state in zip(run.state_hist, run.os_hist)
])
plt.figure()
for axis, label in enumerate(("x", "y", "z")):
plt.plot(time, torques[:, axis] * 1e9, label=label)
plt.xlabel("Time [min]")
plt.ylabel("Drag torque [nN m]")
plt.legend()
plt.show()
Alignment with flight direction
Drag torque
Godot animation¶
from ADCS.helpers.animations import animate_orbit_godot
from ADCS.helpers.animations.godot.overlays import Arrow, Triad
animate_orbit_godot(
results=results,
overlays=[
Triad(frame="body", px=110),
Arrow("@velocity", color="#facc15", scale="fixed_px", px=150),
],
graphics_quality="high",
)
Tips and tricks
A run stores its states and orbital states at each saved time. Query the drag model for the torque at one of those steps:
run = results.first()
state = run.state_hist[0]
orbital_state = run.os_hist[0]
drag_torque = drag.torque(satellite, state, orbital_state)