models.recovery¶
machwave.models.recovery
¶
HemisphericalParachute
¶
Bases: Parachute
Source code in machwave/models/recovery/parachutes.py
Parachute
¶
Bases: ABC
Base class for implementing different parachute geometries using the Strategy design pattern.
Subclasses should inherit from Parachute and override its methods to customize the behavior for specific parachute geometries.
Source code in machwave/models/recovery/parachutes.py
area
abstractmethod
property
¶
The area of the parachute. Subclasses must override this property to provide the appropriate area value.
drag_coefficient
abstractmethod
property
¶
The drag coefficient of the parachute. Subclasses must override this property to provide the appropriate drag coefficient value.
Recovery
¶
Source code in machwave/models/recovery/base.py
__init__()
¶
add_event(recovery_event)
¶
Add a recovery event to the list of events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recovery_event
|
RecoveryEvent
|
Recovery event to add. |
required |
get_drag_coefficient_and_area(height, time, velocity, propellant_mass)
¶
Calculate cumulative drag coefficient and area for active events.
We first filter the self.events list to include only the active events based on the provided conditions. Then, we calculate the cumulative drag coefficient and area directly from the filtered list using list comprehension and the sum function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
height
|
ndarray
|
Array of heights. |
required |
time
|
ndarray
|
Array of time values. |
required |
velocity
|
ndarray
|
Array of velocities. |
required |
propellant_mass
|
float
|
Instant propellant mass. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Cumulative drag coefficient and area. |
Source code in machwave/models/recovery/base.py
RecoveryEvent
¶
Bases: ABC
Source code in machwave/models/recovery/events.py
__init__(trigger_value, parachute)
¶
Initialize a RecoveryEvent object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trigger_value
|
float
|
Trigger value for the event. |
required |
parachute
|
Parachute
|
Parachute associated with the event. |
required |
Source code in machwave/models/recovery/events.py
is_active(height, time, velocity, propellant_mass)
abstractmethod
¶
Check if the recovery event is active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
height
|
ndarray
|
Array of heights. |
required |
time
|
ndarray
|
Array of time values. |
required |
velocity
|
ndarray
|
Array of velocities. |
required |
propellant_mass
|
ndarray
|
Array of propellant masses. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the recovery event is active, False otherwise. |
Source code in machwave/models/recovery/events.py
ToroidalParachute
¶
Bases: Parachute
Source code in machwave/models/recovery/parachutes.py
area
property
¶
Area of the toroidal parachute [m^2].
drag_coefficient
property
¶
Drag coefficient of the toroidal parachute.
__init__(major_radius, minor_radius)
¶
Initialize a ToroidalParachute object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
major_radius
|
float
|
Major radius of the toroidal parachute [m]. |
required |
minor_radius
|
float
|
Minor radius of the toroidal parachute [m]. |
required |