Skip to content

Commit

Permalink
ENH: add reset function
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusStano committed Apr 15, 2024
1 parent b9a97a4 commit a66fc53
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions rocketpy/rocket/aero_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1978,8 +1978,9 @@ def __init__(
brakes drag coefficient will be used for the entire rocket instead.
Default is False.
deployment_level : float, optional
Current deployment level, ranging from 0 to 1. Deployment level is the
fraction of the total airbrake area that is Deployment. Default is 0.
Initial deployment level, ranging from 0 to 1. Deployment level is
the fraction of the total airbrake area that is Deployment. Default
is 0.
name : str, optional
Name of the air brakes. Default is "AirBrakes".
Expand All @@ -1997,6 +1998,7 @@ def __init__(
self.reference_area = reference_area
self.clamp = clamp
self.override_rocket_drag = override_rocket_drag
self.initial_deployment_level = deployment_level
self.deployment_level = deployment_level
self.prints = _AirBrakesPrints(self)
self.plots = _AirBrakesPlots(self)
Expand All @@ -2023,6 +2025,12 @@ def deployment_level(self, value):
)
self._deployment_level = value

def _reset(self):
"""Resets the air brakes to their initial state. This is ran at the
beginning of each simulation to ensure the air brakes are in the correct
state."""
self.deployment_level = self.initial_deployment_level

def evaluate_center_of_pressure(self):
"""Evaluates the center of pressure of the aerodynamic surface in local
coordinates.
Expand Down

0 comments on commit a66fc53

Please sign in to comment.