@@ -818,7 +818,8 @@ def __simulate(self, verbose):
818818 lambda self , parachute_porosity = parachute .porosity : setattr (
819819 self , "parachute_porosity" , parachute_porosity
820820 ),
821- lambda self , added_mass_coefficient = parachute .added_mass_coefficient : setattr (
821+ lambda self ,
822+ added_mass_coefficient = parachute .added_mass_coefficient : setattr (
822823 self ,
823824 "parachute_added_mass_coefficient" ,
824825 added_mass_coefficient ,
@@ -1068,25 +1069,30 @@ def __simulate(self, verbose):
10681069 i += 1
10691070 # Create flight phase for time after inflation
10701071 callbacks = [
1071- lambda self , parachute_cd_s = parachute .cd_s : setattr (
1072+ lambda self ,
1073+ parachute_cd_s = parachute .cd_s : setattr (
10721074 self , "parachute_cd_s" , parachute_cd_s
10731075 ),
1074- lambda self , parachute_radius = parachute .radius : setattr (
1076+ lambda self ,
1077+ parachute_radius = parachute .radius : setattr (
10751078 self ,
10761079 "parachute_radius" ,
10771080 parachute_radius ,
10781081 ),
1079- lambda self , parachute_height = parachute .height : setattr (
1082+ lambda self ,
1083+ parachute_height = parachute .height : setattr (
10801084 self ,
10811085 "parachute_height" ,
10821086 parachute_height ,
10831087 ),
1084- lambda self , parachute_porosity = parachute .porosity : setattr (
1088+ lambda self ,
1089+ parachute_porosity = parachute .porosity : setattr (
10851090 self ,
10861091 "parachute_porosity" ,
10871092 parachute_porosity ,
10881093 ),
1089- lambda self , added_mass_coefficient = parachute .added_mass_coefficient : setattr (
1094+ lambda self ,
1095+ added_mass_coefficient = parachute .added_mass_coefficient : setattr (
10901096 self ,
10911097 "parachute_added_mass_coefficient" ,
10921098 added_mass_coefficient ,
@@ -1690,9 +1696,7 @@ def udot_rail2(self, t, u, post_processing=False): # pragma: no cover
16901696 # Hey! We will finish this function later, now we just can use u_dot
16911697 return self .u_dot_generalized (t , u , post_processing = post_processing )
16921698
1693- def u_dot (
1694- self , t , u , post_processing = False
1695- ): # pylint: disable=too-many-locals,too-many-statements
1699+ def u_dot (self , t , u , post_processing = False ): # pylint: disable=too-many-locals,too-many-statements
16961700 """Calculates derivative of u state vector with respect to time
16971701 when rocket is flying in 6 DOF motion during ascent out of rail
16981702 and descent without parachute.
@@ -2238,9 +2242,7 @@ def u_dot_generalized_3dof(self, t, u, post_processing=False):
22382242
22392243 return u_dot
22402244
2241- def u_dot_generalized (
2242- self , t , u , post_processing = False
2243- ): # pylint: disable=too-many-locals,too-many-statements
2245+ def u_dot_generalized (self , t , u , post_processing = False ): # pylint: disable=too-many-locals,too-many-statements
22442246 """Calculates derivative of u state vector with respect to time when the
22452247 rocket is flying in 6 DOF motion in space and significant mass variation
22462248 effects exist. Typical flight phases include powered ascent after launch
@@ -4075,7 +4077,9 @@ def add(self, flight_phase, index=None): # TODO: quite complex method
40754077 new_index = (
40764078 index - 1
40774079 if flight_phase .t < previous_phase .t
4078- else index + 1 if flight_phase .t > next_phase .t else index
4080+ else index + 1
4081+ if flight_phase .t > next_phase .t
4082+ else index
40794083 )
40804084 flight_phase .t += adjust
40814085 self .add (flight_phase , new_index )
0 commit comments