aggregation
cosmic_warp.physics.aggregation
compute_forces
compute_forces(
state: State,
vehicle: VehicleConfig,
flags: SimulationFlags,
thrust_force_body: vec3d,
) -> vec3d
Compute total forces acting on spacecraft.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
State
|
Current spacecraft state |
required |
vehicle
|
VehicleConfig
|
Vehicle configuration (mass, etc.) |
required |
flags
|
SimulationFlags
|
Simulation flags |
required |
thrust_force_body
|
vec3d
|
Total thruster force in the body frame [N] (from thruster_wrench, computed once per step) |
required |
Returns:
| Type | Description |
|---|---|
vec3d
|
Total force vector in inertial frame [N] |
Source code in cosmic_warp/physics/aggregation.py
compute_nongravity_forces
compute_nongravity_forces(
state: State,
vehicle: VehicleConfig,
flags: SimulationFlags,
thrust_force_body: vec3d,
) -> vec3d
Forces that do not scale with the spacecraft mass (drag and thrust), in the inertial frame [N]. Split out so integrators can treat them apart from gravity, which is proportional to the (changing) mass.
Source code in cosmic_warp/physics/aggregation.py
compute_torques
compute_torques(
state: State,
vehicle: VehicleConfig,
flags: SimulationFlags,
thrust_torque: vec3d,
) -> vec3d
Compute total torques acting on spacecraft.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
State
|
Current spacecraft state |
required |
vehicle
|
VehicleConfig
|
Vehicle configuration (inertia, etc.) |
required |
flags
|
SimulationFlags
|
Simulation flags |
required |
thrust_torque
|
vec3d
|
Total thruster torque in the body frame [N*m] (from thruster_wrench, computed once per step) |
required |
Returns:
| Type | Description |
|---|---|
vec3d
|
Total torque vector in body frame [N*m] |