@@ -764,27 +764,28 @@ def __simulate(self, verbose):
764764 index = phase_index + i ,
765765 )
766766 i += 1
767- # Create flight phase for time after inflation
767+ # Create flight phase for time after inflation
768768 callbacks = [
769- lambda self , parachute_cd_s = parachute .cd_s : setattr (
770- self , "parachute_cd_s" , parachute_cd_s
771- ),
772- lambda self , parachute_radius = parachute .radius : setattr (
773- self , "parachute_radius" , parachute_radius
774- ),
775- lambda self , parachute_height = parachute .height : setattr (
776- self , "parachute_height" , parachute_height
777- ),
778- lambda self , parachute_porosity = parachute .porosity : setattr (
779- self , "parachute_porosity" , parachute_porosity
780- ),
781- lambda self ,
782- added_mass_coefficient = parachute .added_mass_coefficient : setattr (
783- self ,
784- "parachute_added_mass_coefficient" ,
785- added_mass_coefficient ,
786- ),
787- ]
769+ lambda self , parachute_cd_s = parachute .cd_s : setattr (
770+ self , "parachute_cd_s" , parachute_cd_s
771+ ),
772+ lambda self , parachute_radius = parachute .radius : setattr (
773+ self , "parachute_radius" , parachute_radius
774+ ),
775+ lambda self , parachute_height = parachute .height : setattr (
776+ self , "parachute_height" , parachute_height
777+ ),
778+ lambda self ,
779+ parachute_porosity = parachute .porosity : setattr (
780+ self , "parachute_porosity" , parachute_porosity
781+ ),
782+ lambda self ,
783+ added_mass_coefficient = parachute .added_mass_coefficient : setattr (
784+ self ,
785+ "parachute_added_mass_coefficient" ,
786+ added_mass_coefficient ,
787+ ),
788+ ]
788789 self .flight_phases .add_phase (
789790 node .t + parachute .lag ,
790791 self .u_dot_parachute ,
@@ -1502,17 +1503,17 @@ def u_dot(self, t, u, post_processing=False): # pylint: disable=too-many-locals
15021503 # Thrust correction parameters
15031504 pressure = self .env .pressure .get_value_opt (z )
15041505 # Determine current behavior
1505- if self .rocket .motor .burn_start_time < t < self .rocket .motor .burn_out_time :
1506+ if self .rocket .motor .burn_start_time < t < self .rocket .motor .burn_out_time :
15061507 # Motor burning
15071508 # Retrieve important motor quantities
1508- # Inertias
1509- motor_I_33_at_t = self .rocket .motor .I_33 .get_value_opt (t )
1510- motor_I_11_at_t = self .rocket .motor .I_11 .get_value_opt (t )
1511- motor_I_33_derivative_at_t = self .rocket .motor .I_33 .differentiate (
1512- t , dx = 1e-6
1513- )
1514- motor_I_11_derivative_at_t = self .rocket .motor .I_11 .differentiate (
1515- t , dx = 1e-6
1509+ # Inertias
1510+ motor_I_33_at_t = self .rocket .motor .I_33 .get_value_opt (t )
1511+ motor_I_11_at_t = self .rocket .motor .I_11 .get_value_opt (t )
1512+ motor_I_33_derivative_at_t = self .rocket .motor .I_33 .differentiate (
1513+ t , dx = 1e-6
1514+ )
1515+ motor_I_11_derivative_at_t = self .rocket .motor .I_11 .differentiate (
1516+ t , dx = 1e-6
15161517 )
15171518 # Mass
15181519 mass_flow_rate_at_t = self .rocket .motor .mass_flow_rate .get_value_opt (t )
@@ -1530,20 +1531,20 @@ def u_dot(self, t, u, post_processing=False): # pylint: disable=too-many-locals
15301531 else :
15311532 # Motor stopped
15321533 # Inertias
1533- (
1534- motor_I_33_at_t ,
1535- motor_I_11_at_t ,
1536- motor_I_33_derivative_at_t ,
1537- motor_I_11_derivative_at_t ,
1534+ (
1535+ motor_I_33_at_t ,
1536+ motor_I_11_at_t ,
1537+ motor_I_33_derivative_at_t ,
1538+ motor_I_11_derivative_at_t ,
15381539 ) = (0 , 0 , 0 , 0 )
15391540 # Mass
15401541 mass_flow_rate_at_t , propellant_mass_at_t = 0 , 0
15411542 # thrust
15421543 net_thrust = 0
15431544
15441545 # Retrieve important quantities
1545- # Inertias
1546- rocket_dry_I_33 = self .rocket .dry_I_33
1546+ # Inertias
1547+ rocket_dry_I_33 = self .rocket .dry_I_33
15471548 rocket_dry_I_11 = self .rocket .dry_I_11
15481549 # Mass
15491550 rocket_dry_mass = self .rocket .dry_mass # already with motor's dry mass
@@ -1552,15 +1553,15 @@ def u_dot(self, t, u, post_processing=False): # pylint: disable=too-many-locals
15521553 propellant_mass_at_t + rocket_dry_mass
15531554 )
15541555 # Geometry
1555- # b = -self.rocket.distance_rocket_propellant
1556- b = (
1557- - (
1558- self .rocket .center_of_propellant_position .get_value_opt (0 )
1559- - self .rocket .center_of_dry_mass_position
1560- )
1561- * self .rocket ._csys
1562- )
1563- c = self .rocket .nozzle_to_cdm
1556+ # b = -self.rocket.distance_rocket_propellant
1557+ b = (
1558+ - (
1559+ self .rocket .center_of_propellant_position .get_value_opt (0 )
1560+ - self .rocket .center_of_dry_mass_position
1561+ )
1562+ * self .rocket ._csys
1563+ )
1564+ c = self .rocket .nozzle_to_cdm
15641565 nozzle_radius = self .rocket .motor .nozzle_radius
15651566 # Prepare transformation matrix
15661567 a11 = 1 - 2 * (e2 ** 2 + e3 ** 2 )
@@ -1611,7 +1612,7 @@ def u_dot(self, t, u, post_processing=False): # pylint: disable=too-many-locals
16111612 else :
16121613 R3 += air_brakes_force
16131614 # Off center moment
1614- M1 += self .rocket .cp_eccentricity_y * R3
1615+ M1 += self .rocket .cp_eccentricity_y * R3
16151616 M2 -= self .rocket .cp_eccentricity_x * R3
16161617 # Get rocket velocity in body frame
16171618 vx_b = a11 * vx + a21 * vy + a31 * vz
0 commit comments