@@ -764,20 +764,8 @@ def __simulate(self, verbose):
764764 self .sensors ,
765765 ):
766766
767- # Calculate opening shock force
768- opening_altitude = self .y_sol [2 ]
769- opening_density = self .env .density (opening_altitude )
770- opening_velocity = (
771- (self .y_sol [3 ]) ** 2
772- + (self .y_sol [4 ]) ** 2
773- + (self .y_sol [5 ]) ** 2
774- ) ** 0.5
775-
776- parachute .opening_shock_force = (
777- parachute .calculate_opening_shock (
778- opening_density , opening_velocity
779- )
780- )
767+ # Calculates the parachute's opening shock force
768+ self .calculate_parachute_opening_shock_force (parachute )
781769
782770 # Remove parachute from flight parachutes
783771 self .parachutes .remove (parachute )
@@ -1098,6 +1086,12 @@ def __simulate(self, verbose):
10981086 phase .time_nodes .flush_after (node_index )
10991087 phase .time_nodes .add_node (self .t , [], [], [])
11001088 phase .solver .status = "finished"
1089+
1090+ # Calculates the parachute's opening shock force
1091+ self .calculate_parachute_opening_shock_force (
1092+ parachute
1093+ )
1094+
11011095 # Save parachute event
11021096 self .parachute_events .append (
11031097 [self .t , parachute ]
@@ -4130,3 +4124,18 @@ def rail_button2_bending_moment(self):
41304124 def max_rail_button2_bending_moment (self ):
41314125 """Maximum lower rail button bending moment, in N·m."""
41324126 return self .calculate_rail_button_bending_moments [3 ]
4127+
4128+ def calculate_parachute_opening_shock_force (self , parachute ):
4129+ """Calculates and stores the shock force on parachute opening
4130+ Uses the current self.y_sol and self.env.
4131+ """
4132+ # Calculate opening shock force
4133+ opening_altitude = self .y_sol [2 ]
4134+ opening_density = self .env .density (opening_altitude )
4135+ opening_velocity = (
4136+ (self .y_sol [3 ]) ** 2 + (self .y_sol [4 ]) ** 2 + (self .y_sol [5 ]) ** 2
4137+ ) ** 0.5
4138+
4139+ parachute .opening_shock_force = parachute .calculate_opening_shock (
4140+ opening_density , opening_velocity
4141+ )
0 commit comments