Skip to content
This repository was archived by the owner on Oct 30, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,149 changes: 1,149 additions & 0 deletions getting_started copy.ipynb

Large diffs are not rendered by default.

997 changes: 997 additions & 0 deletions rocketpy/Dispersion.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions rocketpy/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ def __init__(
self.datum = datum

# Save date
self.date = date
if date != None:
self.setDate(date, timeZone)
else:
Expand All @@ -373,6 +374,8 @@ def __init__(
self.setAtmosphericModel("StandardAtmosphere")

# Save latitude and longitude
self.lat = latitude
self.lon = longitude
if latitude != None and longitude != None:
self.setLocation(latitude, longitude)
else:
Expand All @@ -389,6 +392,7 @@ def __init__(
self.initialEW = convert[5]

# Save elevation
self.elevation = elevation
self.setElevation(elevation)

# Recalculate Earth Radius
Expand Down
1 change: 1 addition & 0 deletions rocketpy/Flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ def __init__(
self.initialSolution = initialSolution
self.timeOvershoot = timeOvershoot
self.terminateOnApogee = terminateOnApogee
self.verbose = verbose

# Modifying Rail Length for a better out of rail condition
upperRButton = max(self.rocket.railButtons[0])
Expand Down
10 changes: 10 additions & 0 deletions rocketpy/Motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ def __init__(
-------
None
"""

#Save parameters
self.thrustSource = thrustSource
self.burnOut = burnOut
self.nozzleRadius = nozzleRadius
self.throatRadius = throatRadius
self.reshapeThrustCurve = reshapeThrustCurve
self.interpolationMethod = interpolationMethod


# Thrust parameters
self.interpolate = interpolationMethod
self.burnOutTime = burnOut
Expand Down
25 changes: 25 additions & 0 deletions rocketpy/Rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,13 @@ def addNose(self, length, kind, distanceToCM):
self : Rocket
Object of the Rocket class.
"""

# Save parameters for Dispersion
self.noseLength = length
self.noseKind = kind
self.noseDistanceToCM = distanceToCM


# Analyze type
if kind == "conical":
k = 1 - 1 / 3
Expand Down Expand Up @@ -524,6 +531,11 @@ def addFins(
Object of the Rocket class.
"""

# Save parameters for Dispersion
self.numberOfFins = n
self.finRadius = radius
self.finAirfoil = airfoil

# Retrieve parameters for calculations
Cr = rootChord
Ct = tipChord
Expand Down Expand Up @@ -749,6 +761,15 @@ def addParachute(
noiseSignal and noisyPressureSignal which are filled in during
Flight simulation.
"""

# Save parameters for Dispersion
self.parachuteName = name
self.parachuteCdS = CdS
self.parachuteTrigger = trigger
self.parachuteSamplingRate = samplingRate
self.parachuteLag = lag
self.parachuteNoise = noise

# Create a parachute
parachute = Parachute(name, CdS, trigger, samplingRate, lag, noise)

Expand Down Expand Up @@ -787,11 +808,15 @@ def setRailButtons(self, distanceToCM, angularPosition=45):
-------
None
"""


# Order distance to CM
if distanceToCM[0] < distanceToCM[1]:
distanceToCM.reverse()
# Save
self.railButtons = self.railButtonPair(distanceToCM, angularPosition)
self.RBdistanceToCM = distanceToCM
self.angularPosition = angularPosition

return None

Expand Down
1 change: 1 addition & 0 deletions rocketpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
from .Function import Function
from .Motor import HybridMotor, SolidMotor
from .Rocket import Rocket
from .Dispersion import Dispersion
from .utilities import *
1 change: 1 addition & 0 deletions teste.disp_errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Completed 10 iterations successfully. Total CPU time: 17.6875 s. Total wall time: 19.050102710723877 s
11 changes: 11 additions & 0 deletions teste.disp_inputs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{'rocketMass': 19.90652137182852, 'burnOut': 4.122751149659427, 'railLength': 5.565123045049819}
{'rocketMass': 20.040442434623223, 'burnOut': 4.040194754660794, 'railLength': 5.4460671407624535}
{'rocketMass': 19.930837701395934, 'burnOut': 3.468467598491397, 'railLength': 5.150566738117259}
{'rocketMass': 19.8506753734651, 'burnOut': 3.0803468079703005, 'railLength': 5.821128682799574}
{'rocketMass': 20.040395390137192, 'burnOut': 3.4398519219680628, 'railLength': 5.0211721343161}
{'rocketMass': 19.92409646924012, 'burnOut': 4.114787103323786, 'railLength': 5.2566996814270395}
{'rocketMass': 19.83694037126801, 'burnOut': 4.363111003241498, 'railLength': 5.428369692561595}
{'rocketMass': 20.170452293227846, 'burnOut': 4.235807754853636, 'railLength': 5.049820100552791}
{'rocketMass': 20.168066054386124, 'burnOut': 4.369091258708742, 'railLength': 5.921815945979148}
{'rocketMass': 19.91857803920068, 'burnOut': 4.342779134206488, 'railLength': 5.080259704139901}
Completed 10 iterations successfully. Total CPU time: 17.6875 s. Total wall time: 19.050102710723877 s
11 changes: 11 additions & 0 deletions teste.disp_outputs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{'outOfRailTime': 0.39364752882342674, 'outOfRailVelocity': 23.393901564816144, 'apogeeTime': 23.48209630922026, 'apogeeAltitude': 2567.5769822795232, 'apogeeX': -241.77524247257443, 'apogeeY': 877.5895761489942, 'impactTime': 150.4764074480069, 'impactX': 547.4755585200927, 'impactY': 572.4876365926631, 'impactVelocity': -19.462199163839447, 'initialStaticMargin': 2.2172168363626756, 'outOfRailStaticMargin': 2.2959121643050797, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.485714285714288, 'drogueInflatedTime': 24.985714285714288, 'drogueInflatedVelocity': 39.7631366423571, 'executionTime': 1.328125, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 235.99104212868633}
{'outOfRailTime': 0.3948759737597698, 'outOfRailVelocity': 23.319771149981346, 'apogeeTime': 23.4028291433462, 'apogeeAltitude': 2545.3078375989367, 'apogeeX': -241.06417203223654, 'apogeeY': 872.8585625767016, 'impactTime': 148.97167317343016, 'impactX': 537.0216691616343, 'impactY': 571.393383082964, 'impactVelocity': -19.52766516726175, 'initialStaticMargin': 2.2222979195834713, 'outOfRailStaticMargin': 2.300890920849731, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.40952380952381, 'drogueInflatedTime': 24.90952380952381, 'drogueInflatedVelocity': 39.77449604815257, 'executionTime': 1.34375, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 234.4425381986718}
{'outOfRailTime': 0.39383938438037336, 'outOfRailVelocity': 23.379426763634843, 'apogeeTime': 23.46794207038415, 'apogeeAltitude': 2563.5792893018133, 'apogeeX': -241.66211213218298, 'apogeeY': 876.7672315674648, 'impactTime': 150.20226074219605, 'impactX': 545.5025868758161, 'impactY': 572.4551802719707, 'impactVelocity': -19.47410279394695, 'initialStaticMargin': 2.2181438376033484, 'outOfRailStaticMargin': 2.2968129802515764, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.476190476190478, 'drogueInflatedTime': 24.976190476190478, 'drogueInflatedVelocity': 39.78032246823763, 'executionTime': 1.703125, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 235.71407446451917}
{'outOfRailTime': 0.3930704664495948, 'outOfRailVelocity': 23.418332470677253, 'apogeeTime': 23.515367492889425, 'apogeeAltitude': 2576.967280631924, 'apogeeX': -242.10277007283392, 'apogeeY': 879.6372495529988, 'impactTime': 151.10771800521675, 'impactX': 551.7575545784338, 'impactY': 573.2154731676559, 'impactVelocity': -19.43483438695117, 'initialStaticMargin': 2.215080359624552, 'outOfRailStaticMargin': 2.2938029229466124, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.523809523809526, 'drogueInflatedTime': 25.023809523809526, 'drogueInflatedVelocity': 39.78158608378997, 'executionTime': 1.4375, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 236.64866640993696}
{'outOfRailTime': 0.39500696060662027, 'outOfRailVelocity': 23.325764409221105, 'apogeeTime': 23.402730892947652, 'apogeeAltitude': 2545.268387833093, 'apogeeX': -241.04337919100507, 'apogeeY': 872.8104354829267, 'impactTime': 148.96979322782306, 'impactX': 537.0293697505082, 'impactY': 571.3452280041232, 'impactVelocity': -19.527642212283883, 'initialStaticMargin': 2.2222961450651133, 'outOfRailStaticMargin': 2.3009208054590156, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.40952380952381, 'drogueInflatedTime': 24.90952380952381, 'drogueInflatedVelocity': 39.77324414527358, 'executionTime': 2.15625, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 234.43854100088942}
{'outOfRailTime': 0.393786187885889, 'outOfRailVelocity': 23.383441067614577, 'apogeeTime': 23.47201858836762, 'apogeeAltitude': 2564.719672077175, 'apogeeX': -241.6949708415784, 'apogeeY': 877.0039280151173, 'impactTime': 150.28163849653603, 'impactX': 546.1156054888656, 'impactY': 572.3842677454285, 'impactVelocity': -19.47080301448961, 'initialStaticMargin': 2.2178870418425163, 'outOfRailStaticMargin': 2.2965634374473396, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.476190476190478, 'drogueInflatedTime': 24.976190476190478, 'drogueInflatedVelocity': 39.76614816730068, 'executionTime': 2.546875, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 235.79377306150013}
{'outOfRailTime': 0.3929585800142951, 'outOfRailVelocity': 23.426281445945772, 'apogeeTime': 23.52347772692958, 'apogeeAltitude': 2579.2615570345256, 'apogeeX': -242.17290460742268, 'apogeeY': 880.1177661016592, 'impactTime': 151.26832676009747, 'impactX': 552.9942843408794, 'impactY': 573.080316911245, 'impactVelocity': -19.42810182800753, 'initialStaticMargin': 2.2145533013720162, 'outOfRailStaticMargin': 2.2932898618648787, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.523809523809526, 'drogueInflatedTime': 25.023809523809526, 'drogueInflatedVelocity': 39.753529828392345, 'executionTime': 1.953125, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 236.80796514901837}
{'outOfRailTime': 0.3955845155910141, 'outOfRailVelocity': 23.239490423502964, 'apogeeTime': 23.32661064243672, 'apogeeAltitude': 2524.1052140855963, 'apogeeX': -240.41223767499687, 'apogeeY': 868.4084069471148, 'impactTime': 147.5418539513837, 'impactX': 527.1436049410614, 'impactY': 570.3680499438507, 'impactVelocity': -19.591010733074842, 'initialStaticMargin': 2.2271743136835758, 'outOfRailStaticMargin': 2.305552942215501, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.333333333333336, 'drogueInflatedTime': 24.833333333333336, 'drogueInflatedVelocity': 39.778177727954976, 'executionTime': 1.1875, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 232.9728405593581}
{'outOfRailTime': 0.395702891244475, 'outOfRailVelocity': 23.25256596431927, 'apogeeTime': 23.328153215748333, 'apogeeAltitude': 2524.534808308825, 'apogeeX': -240.40043656304366, 'apogeeY': 868.4449324828357, 'impactTime': 147.5709274420821, 'impactX': 527.396121496818, 'impactY': 570.2834551160805, 'impactVelocity': -19.589849853526715, 'initialStaticMargin': 2.2270853048997874, 'outOfRailStaticMargin': 2.305499311444709, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.333333333333336, 'drogueInflatedTime': 24.833333333333336, 'drogueInflatedVelocity': 39.770636265523834, 'executionTime': 1.71875, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 233.001280524876}
{'outOfRailTime': 0.3937427949045639, 'outOfRailVelocity': 23.386723682784606, 'apogeeTime': 23.47499691340987, 'apogeeAltitude': 2565.5736138519483, 'apogeeX': -241.71498339389854, 'apogeeY': 877.1714488168865, 'impactTime': 150.34230311624643, 'impactX': 546.5900688232151, 'impactY': 572.3173877624449, 'impactVelocity': -19.468105805968417, 'initialStaticMargin': 2.217676713980707, 'outOfRailStaticMargin': 2.2963590866966, 'finalStaticMargin': 3.0897188014956276, 'numberOfEvents': 1, 'drogueTriggerTime': 23.476190476190478, 'drogueInflatedTime': 24.976190476190478, 'drogueInflatedVelocity': 39.75527823501804, 'executionTime': 2.265625, 'lateralWind': -3.7535914518728144, 'frontalWind': -6.317898247256396, 'maxVelocity': 235.85313212739368}
Completed 10 iterations successfully. Total CPU time: 17.6875 s. Total wall time: 19.050102710723877 s
1,320 changes: 1,320 additions & 0 deletions teste.disp_outputs.txt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.