Skip to content

Stable rockets with negative stability margins? #115

@giovaniceotto

Description

@giovaniceotto

Describe the bug

Rockets with slightly negative stability margins seem stable in RocketPy

To Reproduce

Run the following code:

# Helper class
from rocketpy import Environment, SolidMotor, Rocket, Flight, Function

# Prepare Motor
Pro75M1670 = SolidMotor(
    thrustSource="../../data/motors/Cesaroni_M1670.eng",
    burnOut=3.9,
    grainNumber=5,
    grainSeparation=5/1000,
    grainDensity=1815,
    grainOuterRadius=33/1000,
    grainInitialInnerRadius=15/1000,
    grainInitialHeight=120/1000,
    nozzleRadius=33/1000,
    throatRadius=11/1000,
    interpolationMethod='linear'
)

# Prepare Rocket
Calisto = Rocket(
    motor=Pro75M1670,
    radius=127/2000,
    mass=19.197-2.956,
    inertiaI=6.60,
    inertiaZ=0.0351,
    distanceRocketNozzle=-1.255,
    distanceRocketPropellant=-0.85704,
    powerOffDrag='../../data/calisto/powerOffDragCurve.csv',
    powerOnDrag='../../data/calisto/powerOnDragCurve.csv'
)
Calisto.setRailButtons([0.2, -0.5])

Nose = Calisto.addNose(length=0.55829, kind="vonKarman", distanceToCM=0.71971)
FinSet = Calisto.addFins(4, span=0.1, rootChord=0.120, tipChord=0.040, distanceToCM=-1.04956)
Tail = Calisto.addTail(topRadius=0.0635, bottomRadius=0.0435, length=0.060, distanceToCM=-1.194656)

# Prepare Environment
Env = Environment(5.2, 9.8)
Env.setAtmosphericModel(type='CostumAtmosphere', wind_v=-10)

# Simulate Different Static Margins by Varying Fin Position
simulation_results = []

for factor in [0.1, 0.3, 0.5, 0.8, 1.0]:
    # Modify rocket fin set by removing previous one and adding new one
    Calisto.aerodynamicSurfaces.remove(FinSet)
    FinSet = Calisto.addFins(4, span=0.1, rootChord=0.120, tipChord=0.040, distanceToCM=-1.04956*factor)
    # Simulate
    TestFlight = Flight(rocket=Calisto, environment=Env, inclination=90, heading=0, maxTimeStep=0.01, maxTime=2.5, terminateOnApogee=True)
    # Post process flight data
    TestFlight.postProcess()
    # Store Results
    staticMarginAtIginition = Calisto.staticMargin(0)
    staticMarginAtOutOfRail = Calisto.staticMargin(TestFlight.outOfRailTime)
    staticMarginAtSteadyState = Calisto.staticMargin(TestFlight.tFinal)
    simulation_results += [(TestFlight.attitudeAngle, 'Static Margin of {:1.2f} c'.format(staticMarginAtOutOfRail))]

Function.comparePlots(simulation_results, lower=0, upper=2.5, xlabel='Time (s)', ylabel='Attitude Angle (deg)')

Expected behavior

Negative stability margins should be unstable.... right?

Screenshots
Here is a plot of the angle that the Rocket makes with the horizontal plane after leaving the rail. Notice how the green and orange trajectories are stable even thought their stability margin is negative,

image

Metadata

Metadata

Assignees

Labels

AerodynamicsAny problem to be worked on top of RocketPy's AerodynamicBugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions