Skip to content

Commit a66fc53

Browse files
committed
ENH: add reset function
1 parent b9a97a4 commit a66fc53

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

rocketpy/rocket/aero_surface.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,8 +1978,9 @@ def __init__(
19781978
brakes drag coefficient will be used for the entire rocket instead.
19791979
Default is False.
19801980
deployment_level : float, optional
1981-
Current deployment level, ranging from 0 to 1. Deployment level is the
1982-
fraction of the total airbrake area that is Deployment. Default is 0.
1981+
Initial deployment level, ranging from 0 to 1. Deployment level is
1982+
the fraction of the total airbrake area that is Deployment. Default
1983+
is 0.
19831984
name : str, optional
19841985
Name of the air brakes. Default is "AirBrakes".
19851986
@@ -1997,6 +1998,7 @@ def __init__(
19971998
self.reference_area = reference_area
19981999
self.clamp = clamp
19992000
self.override_rocket_drag = override_rocket_drag
2001+
self.initial_deployment_level = deployment_level
20002002
self.deployment_level = deployment_level
20012003
self.prints = _AirBrakesPrints(self)
20022004
self.plots = _AirBrakesPlots(self)
@@ -2023,6 +2025,12 @@ def deployment_level(self, value):
20232025
)
20242026
self._deployment_level = value
20252027

2028+
def _reset(self):
2029+
"""Resets the air brakes to their initial state. This is ran at the
2030+
beginning of each simulation to ensure the air brakes are in the correct
2031+
state."""
2032+
self.deployment_level = self.initial_deployment_level
2033+
20262034
def evaluate_center_of_pressure(self):
20272035
"""Evaluates the center of pressure of the aerodynamic surface in local
20282036
coordinates.

0 commit comments

Comments
 (0)