11from inspect import signature
22
3+ import math
34import numpy as np
45
56from rocketpy .tools import from_hex_decode , to_hex_encode
@@ -98,6 +99,9 @@ class Parachute:
9899 Parachute.height : float, None
99100 Length of the unique semi-axis (height) of the inflated hemispheroid
100101 parachute in meters.
102+ Parachute.initial_radius : float, None
103+ Initial radius of the parachute on deployment in meters. Used to model the
104+ parachute inflation.
101105 Parachute.porosity : float
102106 Geometric porosity of the canopy (ratio of open area to total canopy area),
103107 in [0, 1]. Affects only the added-mass scaling during descent; it does
@@ -118,6 +122,7 @@ def __init__(
118122 noise = (0 , 0 , 0 ),
119123 radius = 1.5 ,
120124 height = None ,
125+ initial_radius = None ,
121126 porosity = 0.0432 ,
122127 ):
123128 """Initializes Parachute class.
@@ -179,6 +184,9 @@ def __init__(
179184 Length of the unique semi-axis (height) of the inflated hemispheroid
180185 parachute. Default value is the radius of the parachute.
181186 Units are in meters.
187+ initial_radius : float, optional
188+ Initial radius of the parachute on deployment in meters. Used to model the
189+ parachute inflation. Default value is the parachute radius (no inflation).
182190 porosity : float, optional
183191 Geometric porosity of the canopy (ratio of open area to total canopy area),
184192 in [0, 1]. Affects only the added-mass scaling during descent; it does
@@ -202,6 +210,13 @@ def __init__(
202210 self .noise_signal_function = Function (0 )
203211 self .radius = radius
204212 self .height = height or radius
213+ self .initial_radius = initial_radius or radius
214+ self .initial_volume = (
215+ (4 / 3 )
216+ * math .pi
217+ * (self .parachute_height / self .parachute_radius )
218+ * (min (self .parachute_radius , self .rocket .radius )) ** 3
219+ )
205220 self .porosity = porosity
206221 self .added_mass_coefficient = 1.068 * (
207222 1
@@ -308,6 +323,7 @@ def to_dict(self, **kwargs):
308323 "noise" : self .noise ,
309324 "radius" : self .radius ,
310325 "height" : self .height ,
326+ "initial_radius" : self .initial_radius ,
311327 "porosity" : self .porosity ,
312328 }
313329
@@ -341,6 +357,7 @@ def from_dict(cls, data):
341357 noise = data ["noise" ],
342358 radius = data .get ("radius" , 1.5 ),
343359 height = data .get ("height" , None ),
360+ initial_radius = data .get ("initial_radius" , None ),
344361 porosity = data .get ("porosity" , 0.0432 ),
345362 )
346363
0 commit comments