@@ -774,20 +774,8 @@ def __simulate(self, verbose):
774774 self .sensors ,
775775 ):
776776
777- # Calculate opening shock force
778- opening_altitude = self .y_sol [2 ]
779- opening_density = self .env .density (opening_altitude )
780- opening_velocity = (
781- (self .y_sol [3 ]) ** 2
782- + (self .y_sol [4 ]) ** 2
783- + (self .y_sol [5 ]) ** 2
784- ) ** 0.5
785-
786- parachute .opening_shock_force = (
787- parachute .calculate_opening_shock (
788- opening_density , opening_velocity
789- )
790- )
777+ # Calculates the parachute's opening shock force
778+ self .calculate_parachute_opening_shock_force (parachute )
791779
792780 # Remove parachute from flight parachutes
793781 self .parachutes .remove (parachute )
@@ -1108,6 +1096,12 @@ def __simulate(self, verbose):
11081096 phase .time_nodes .flush_after (node_index )
11091097 phase .time_nodes .add_node (self .t , [], [], [])
11101098 phase .solver .status = "finished"
1099+
1100+ # Calculates the parachute's opening shock force
1101+ self .calculate_parachute_opening_shock_force (
1102+ parachute
1103+ )
1104+
11111105 # Save parachute event
11121106 self .parachute_events .append (
11131107 [self .t , parachute ]
@@ -4371,3 +4365,18 @@ def rail_button2_bending_moment(self):
43714365 def max_rail_button2_bending_moment (self ):
43724366 """Maximum lower rail button bending moment, in N·m."""
43734367 return self .calculate_rail_button_bending_moments [3 ]
4368+
4369+ def calculate_parachute_opening_shock_force (self , parachute ):
4370+ """Calculates and stores the shock force on parachute opening
4371+ Uses the current self.y_sol and self.env.
4372+ """
4373+ # Calculate opening shock force
4374+ opening_altitude = self .y_sol [2 ]
4375+ opening_density = self .env .density (opening_altitude )
4376+ opening_velocity = (
4377+ (self .y_sol [3 ]) ** 2 + (self .y_sol [4 ]) ** 2 + (self .y_sol [5 ]) ** 2
4378+ ) ** 0.5
4379+
4380+ parachute .opening_shock_force = parachute .calculate_opening_shock (
4381+ opening_density , opening_velocity
4382+ )
0 commit comments