@@ -547,7 +547,7 @@ def __init__(
547
547
Default is 90, which points in the x direction.
548
548
initialSolution : array, Flight, optional
549
549
Initial solution array to be used. Format is
550
- initialSolution = []
550
+ initialSolution = [
551
551
self.tInitial,
552
552
xInit, yInit, zInit,
553
553
vxInit, vyInit, vzInit,
@@ -729,13 +729,15 @@ def __init__(
729
729
self .parachutes .remove (parachute )
730
730
# Create flight phase for time after detection and before inflation
731
731
# Must only be created if parachute has any lag
732
+ i = 1
732
733
if parachute .lag != 0 :
733
734
self .flightPhases .addPhase (
734
735
node .t ,
735
736
phase .derivative ,
736
737
clear = True ,
737
- index = phase_index + 1 ,
738
+ index = phase_index + i ,
738
739
)
740
+ i += 1
739
741
# Create flight phase for time after inflation
740
742
callbacks = [
741
743
lambda self , parachuteCdS = parachute .CdS : setattr (
@@ -747,7 +749,7 @@ def __init__(
747
749
self .uDotParachute ,
748
750
callbacks ,
749
751
clear = False ,
750
- index = phase_index + 2 ,
752
+ index = phase_index + i ,
751
753
)
752
754
# Prepare to leave loops and start new flight phase
753
755
phase .timeNodes .flushAfter (node_index )
@@ -1024,12 +1026,16 @@ def __init__(
1024
1026
# Remove parachute from flight parachutes
1025
1027
self .parachutes .remove (parachute )
1026
1028
# Create flight phase for time after detection and before inflation
1027
- self .flightPhases .addPhase (
1028
- overshootableNode .t ,
1029
- phase .derivative ,
1030
- clear = True ,
1031
- index = phase_index + 1 ,
1032
- )
1029
+ # Must only be created if parachute has any lag
1030
+ i = 1
1031
+ if parachute .lag != 0 :
1032
+ self .flightPhases .addPhase (
1033
+ overshootableNode .t ,
1034
+ phase .derivative ,
1035
+ clear = True ,
1036
+ index = phase_index + i ,
1037
+ )
1038
+ i += 1
1033
1039
# Create flight phase for time after inflation
1034
1040
callbacks = [
1035
1041
lambda self , parachuteCdS = parachute .CdS : setattr (
@@ -1041,7 +1047,7 @@ def __init__(
1041
1047
self .uDotParachute ,
1042
1048
callbacks ,
1043
1049
clear = False ,
1044
- index = phase_index + 2 ,
1050
+ index = phase_index + i ,
1045
1051
)
1046
1052
# Rollback history
1047
1053
self .t = overshootableNode .t
0 commit comments