Flight Class#
- class rocketpy.Flight.Flight(rocket, environment, rail_length, inclination=80, heading=90, initial_solution=None, terminate_on_apogee=False, max_time=600, max_time_step=inf, min_time_step=0, rtol=1e-06, atol=[0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 1e-06, 1e-06, 1e-06, 1e-06, 0.001, 0.001, 0.001], time_overshoot=True, verbose=False, name='Flight', equations_of_motion='standard')[source]#
Keeps all flight information and has a method to simulate flight.
- Other classes
- env#
Environment object describing rail length, elevation, gravity and weather condition. See Environment class for more details.
- Type:
- parachutes#
Direct link to parachutes of the Rocket. See Rocket class for more details.
- Type:
Parachutes
- frontal_surface_wind#
Surface wind speed in m/s aligned with the launch rail.
- Type:
float
- lateral_surface_wind#
Surface wind speed in m/s perpendicular to launch rail.
- Type:
float
- Helper classes
- Helper functions
- time_iterator[source]#
Helper iterator function to generate time discretization points.
- Type:
function
- Helper parameters
- rail_length#
Launch rail length in meters.
- Type:
float, int
- effective_1rl#
Original rail length minus the distance measured from nozzle exit to the upper rail button. It assumes the nozzle to be aligned with the beginning of the rail.
- Type:
float
- effective2rl#
Original rail length minus the distance measured from nozzle exit to the lower rail button. It assumes the nozzle to be aligned with the beginning of the rail.
- Type:
float
- name#
Name of the flight.
- Type:
str
Numerical Integration settings: Flight.max_time : int, float
Maximum simulation time allowed. Refers to physical time being simulated, not time taken to run simulation.
- Flight.max_time_stepint, float
Maximum time step to use during numerical integration in seconds.
- Flight.min_time_stepint, float
Minimum time step to use during numerical integration in seconds.
- Flight.rtolint, float
Maximum relative error tolerance to be tolerated in the numerical integration scheme.
- Flight.atolint, float
Maximum absolute error tolerance to be tolerated in the integration scheme.
- Flight.time_overshootbool, optional
If True, decouples ODE time step from parachute trigger functions sampling rate. The time steps can overshoot the necessary trigger function evaluation points and then interpolation is used to calculate them and feed the triggers. Can greatly improve run time in some cases.
- Flight.terminate_on_apogeebool
Whether to terminate simulation when rocket reaches apogee.
- Flight.solverscipy.integrate.LSODA
Scipy LSODA integration scheme.
State Space Vector Definition: Flight.x : Function
Rocket’s X coordinate (positive east) as a function of time.
- Flight.yFunction
Rocket’s Y coordinate (positive north) as a function of time.
- Flight.zFunction
Rocket’s z coordinate (positive up) as a function of time.
- Flight.vxFunction
Rocket’s X velocity as a function of time.
- Flight.vyFunction
Rocket’s Y velocity as a function of time.
- Flight.vzFunction
Rocket’s Z velocity as a function of time.
- Flight.e0Function
Rocket’s Euler parameter 0 as a function of time.
- Flight.e1Function
Rocket’s Euler parameter 1 as a function of time.
- Flight.e2Function
Rocket’s Euler parameter 2 as a function of time.
- Flight.e3Function
Rocket’s Euler parameter 3 as a function of time.
- Flight.w1Function
Rocket’s angular velocity Omega 1 as a function of time. Direction 1 is in the rocket’s body axis and points perpendicular to the rocket’s axis of cylindrical symmetry.
- Flight.w2Function
Rocket’s angular velocity Omega 2 as a function of time. Direction 2 is in the rocket’s body axis and points perpendicular to the rocket’s axis of cylindrical symmetry and direction 1.
- Flight.w3Function
Rocket’s angular velocity Omega 3 as a function of time. Direction 3 is in the rocket’s body axis and points in the direction of cylindrical symmetry.
- Flight.latitude: Function
Rocket’s latitude coordinates (positive North) as a function of time. The Equator has a latitude equal to 0, by convention.
- Flight.longitude: Function
Rocket’s longitude coordinates (positive East) as a function of time. Greenwich meridian has a longitude equal to 0, by convention.
Solution attributes: Flight.inclination : int, float
Launch rail inclination angle relative to ground, given in degrees.
- Flight.headingint, float
Launch heading angle relative to north given in degrees.
- Flight.initial_solutionlist
List defines initial condition - [tInit, x_init, y_init, z_init, vx_init, vy_init, vz_init, e0_init, e1_init, e2_init, e3_init, w1_init, w2_init, w3_init]
- Flight.t_initialint, float
Initial simulation time in seconds. Usually 0.
- Flight.solutionlist
Solution array which keeps results from each numerical integration.
- Flight.tfloat
Current integration time.
- Flight.ylist
Current integration state vector u.
- Flight.post_processedbool
Defines if solution data has been post processed.
Solution monitor attributes: Flight.initial_solution : list
List defines initial condition - [tInit, x_init, y_init, z_init, vx_init, vy_init, vz_init, e0_init, e1_init, e2_init, e3_init, w1_init, w2_init, w3_init]
- Flight.out_of_rail_timeint, float
Time, in seconds, in which the rocket completely leaves the rail.
- Flight.out_of_rail_statelist
State vector u corresponding to state when the rocket completely leaves the rail.
- Flight.out_of_rail_velocityint, float
Velocity, in m/s, with which the rocket completely leaves the rail.
- Flight.apogee_statearray
State vector u corresponding to state when the rocket’s vertical velocity is zero in the apogee.
- Flight.apogee_timeint, float
Time, in seconds, in which the rocket’s vertical velocity reaches zero in the apogee.
- Flight.apogee_xint, float
X coordinate (positive east) of the center of mass of the rocket when it reaches apogee.
- Flight.apogee_yint, float
Y coordinate (positive north) of the center of mass of the rocket when it reaches apogee.
- Flight.apogeeint, float
Z coordinate, or altitude, of the center of mass of the rocket when it reaches apogee.
- Flight.x_impactint, float
X coordinate (positive east) of the center of mass of the rocket when it impacts ground.
- Flight.y_impactint, float
Y coordinate (positive east) of the center of mass of the rocket when it impacts ground.
- Flight.impact_velocityint, float
Velocity magnitude of the center of mass of the rocket when it impacts ground.
- Flight.impact_statearray
State vector u corresponding to state when the rocket impacts the ground.
- Flight.parachute_eventsarray
List that stores parachute events triggered during flight.
- Flight.function_evaluationsarray
List that stores number of derivative function evaluations during numerical integration in cumulative manner.
- Flight.function_evaluations_per_time_steparray
List that stores number of derivative function evaluations per time step during numerical integration.
- Flight.time_stepsarray
List of time steps taking during numerical integration in seconds.
- Flight.FlightPhasesFlight.FlightPhases
Stores and manages flight phases.
Solution Secondary Attributes: Atmospheric: Flight.wind_velocity_x : Function
Wind velocity X (East) experienced by the rocket as a function of time. Can be called or accessed as array.
- Flight.wind_velocity_yFunction
Wind velocity Y (North) experienced by the rocket as a function of time. Can be called or accessed as array.
- Flight.densityFunction
Air density experienced by the rocket as a function of time. Can be called or accessed as array.
- Flight.pressureFunction
Air pressure experienced by the rocket as a function of time. Can be called or accessed as array.
- Flight.dynamic_viscosityFunction
Air dynamic viscosity experienced by the rocket as a function of time. Can be called or accessed as array.
- Flight.speed_of_soundFunction
Speed of Sound in air experienced by the rocket as a function of time. Can be called or accessed as array.
Kinematics: Flight.ax : Function
Rocket’s X (East) acceleration as a function of time, in m/s². Can be called or accessed as array.
- Flight.ayFunction
Rocket’s Y (North) acceleration as a function of time, in m/s². Can be called or accessed as array.
- Flight.azFunction
Rocket’s Z (Up) acceleration as a function of time, in m/s². Can be called or accessed as array.
- Flight.alpha1Function
Rocket’s angular acceleration Alpha 1 as a function of time. Direction 1 is in the rocket’s body axis and points perpendicular to the rocket’s axis of cylindrical symmetry. Units of rad/s². Can be called or accessed as array.
- Flight.alpha2Function
Rocket’s angular acceleration Alpha 2 as a function of time. Direction 2 is in the rocket’s body axis and points perpendicular to the rocket’s axis of cylindrical symmetry and direction 1. Units of rad/s². Can be called or accessed as array.
- Flight.alpha3Function
Rocket’s angular acceleration Alpha 3 as a function of time. Direction 3 is in the rocket’s body axis and points in the direction of cylindrical symmetry. Units of rad/s². Can be called or accessed as array.
- Flight.speedFunction
Rocket velocity magnitude in m/s relative to ground as a function of time. Can be called or accessed as array.
- Flight.max_speedfloat
Maximum velocity magnitude in m/s reached by the rocket relative to ground during flight.
- Flight.max_speed_timefloat
Time in seconds at which rocket reaches maximum velocity magnitude relative to ground.
- Flight.horizontal_speedFunction
Rocket’s velocity magnitude in the horizontal (North-East) plane in m/s as a function of time. Can be called or accessed as array.
- Flight.accelerationFunction
Rocket acceleration magnitude in m/s² relative to ground as a function of time. Can be called or accessed as array.
- Flight.max_accelerationfloat
Maximum acceleration magnitude in m/s² reached by the rocket relative to ground during flight.
- Flight.max_acceleration_timefloat
Time in seconds at which rocket reaches maximum acceleration magnitude relative to ground.
- Flight.path_angleFunction
Rocket’s flight path angle, or the angle that the rocket’s velocity makes with the horizontal (North-East) plane. Measured in degrees and expressed as a function of time. Can be called or accessed as array.
- Flight.attitude_vector_xFunction
Rocket’s attitude vector, or the vector that points in the rocket’s axis of symmetry, component in the X direction (East) as a function of time. Can be called or accessed as array.
- Flight.attitude_vector_yFunction
Rocket’s attitude vector, or the vector that points in the rocket’s axis of symmetry, component in the Y direction (East) as a function of time. Can be called or accessed as array.
- Flight.attitude_vector_zFunction
Rocket’s attitude vector, or the vector that points in the rocket’s axis of symmetry, component in the Z direction (East) as a function of time. Can be called or accessed as array.
- Flight.attitude_angleFunction
Rocket’s attitude angle, or the angle that the rocket’s axis of symmetry makes with the horizontal (North-East) plane. Measured in degrees and expressed as a function of time. Can be called or accessed as array.
- Flight.lateral_attitude_angleFunction
Rocket’s lateral attitude angle, or the angle that the rocket’s axis of symmetry makes with plane defined by the launch rail direction and the Z (up) axis. Measured in degrees and expressed as a function of time. Can be called or accessed as array.
- Flight.phiFunction
Rocket’s Spin Euler Angle, φ, according to the 3-2-3 rotation system (NASA Standard Aerospace). Measured in degrees and expressed as a function of time. Can be called or accessed as array.
- Flight.thetaFunction
Rocket’s Nutation Euler Angle, θ, according to the 3-2-3 rotation system (NASA Standard Aerospace). Measured in degrees and expressed as a function of time. Can be called or accessed as array.
- Flight.psiFunction
Rocket’s Precession Euler Angle, ψ, according to the 3-2-3 rotation system (NASA Standard Aerospace). Measured in degrees and expressed as a function of time. Can be called or accessed as array.
Dynamics: Flight.R1 : Function
Resultant force perpendicular to rockets axis due to aerodynamic forces as a function of time. Units in N. Expressed as a function of time. Can be called or accessed as array. Direction 1 is in the rocket’s body axis and points perpendicular to the rocket’s axis of cylindrical symmetry.
- Flight.R2Function
Resultant force perpendicular to rockets axis due to aerodynamic forces as a function of time. Units in N. Expressed as a function of time. Can be called or accessed as array. Direction 2 is in the rocket’s body axis and points perpendicular to the rocket’s axis of cylindrical symmetry and direction 1.
- Flight.R3Function
Resultant force in rockets axis due to aerodynamic forces as a function of time. Units in N. Usually just drag. Expressed as a function of time. Can be called or accessed as array. Direction 3 is in the rocket’s body axis and points in the direction of cylindrical symmetry.
- Flight.M1Function
Resultant moment (torque) perpendicular to rockets axis due to aerodynamic forces and eccentricity as a function of time. Units in N*m. Expressed as a function of time. Can be called or accessed as array. Direction 1 is in the rocket’s body axis and points perpendicular to the rocket’s axis of cylindrical symmetry.
- Flight.M2Function
Resultant moment (torque) perpendicular to rockets axis due to aerodynamic forces and eccentricity as a function of time. Units in N*m. Expressed as a function of time. Can be called or accessed as array. Direction 2 is in the rocket’s body axis and points perpendicular to the rocket’s axis of cylindrical symmetry and direction 1.
- Flight.M3Function
Resultant moment (torque) in rockets axis due to aerodynamic forces and eccentricity as a function of time. Units in N*m. Expressed as a function of time. Can be called or accessed as array. Direction 3 is in the rocket’s body axis and points in the direction of cylindrical symmetry.
- Flight.aerodynamic_liftFunction
Resultant force perpendicular to rockets axis due to aerodynamic effects as a function of time. Units in N. Expressed as a function of time. Can be called or accessed as array.
- Flight.aerodynamic_dragFunction
Resultant force aligned with the rockets axis due to aerodynamic effects as a function of time. Units in N. Expressed as a function of time. Can be called or accessed as array.
- Flight.aerodynamic_bending_momentFunction
Resultant moment perpendicular to rocket’s axis due to aerodynamic effects as a function of time. Units in N m. Expressed as a function of time. Can be called or accessed as array.
- Flight.aerodynamic_spin_momentFunction
Resultant moment aligned with the rockets axis due to aerodynamic effects as a function of time. Units in N m. Expressed as a function of time. Can be called or accessed as array.
- Flight.rail_button1_normal_forceFunction
Upper rail button normal force in N as a function of time. Can be called or accessed as array.
- Flight.max_rail_button1_normal_forcefloat
Maximum upper rail button normal force experienced during rail flight phase in N.
- Flight.rail_button1_shear_forceFunction
Upper rail button shear force in N as a function of time. Can be called or accessed as array.
- Flight.max_rail_button1_shear_forcefloat
Maximum upper rail button shear force experienced during rail flight phase in N.
- Flight.rail_button2_normal_forceFunction
Lower rail button normal force in N as a function of time. Can be called or accessed as array.
- Flight.max_rail_button2_normal_forcefloat
Maximum lower rail button normal force experienced during rail flight phase in N.
- Flight.rail_button2_shear_forceFunction
Lower rail button shear force in N as a function of time. Can be called or accessed as array.
- Flight.max_rail_button2_shear_forcefloat
Maximum lower rail button shear force experienced during rail flight phase in N.
- Flight.rotational_energyFunction
Rocket’s rotational kinetic energy as a function of time. Units in J.
- Flight.translational_energyFunction
Rocket’s translational kinetic energy as a function of time. Units in J.
- Flight.kinetic_energyFunction
Rocket’s total kinetic energy as a function of time. Units in J.
- Flight.potential_energyFunction
Rocket’s gravitational potential energy as a function of time. Units in J.
- Flight.total_energyFunction
Rocket’s total mechanical energy as a function of time. Units in J.
- Flight.thrust_powerFunction
Rocket’s engine thrust power output as a function of time in Watts. Can be called or accessed as array.
- Flight.drag_powerFunction
Aerodynamic drag power output as a function of time in Watts. Can be called or accessed as array.
Stability and Control: Flight.attitude_frequency_response : Function
Fourier Frequency Analysis of the rocket’s attitude angle. Expressed as the absolute vale of the magnitude as a function of frequency in Hz. Can be called or accessed as array.
- Flight.omega1_frequency_responseFunction
Fourier Frequency Analysis of the rocket’s angular velocity omega 1. Expressed as the absolute vale of the magnitude as a function of frequency in Hz. Can be called or accessed as array.
- Flight.omega2_frequency_responseFunction
Fourier Frequency Analysis of the rocket’s angular velocity omega 2. Expressed as the absolute vale of the magnitude as a function of frequency in Hz. Can be called or accessed as array.
- Flight.omega3_frequency_responseFunction
Fourier Frequency Analysis of the rocket’s angular velocity omega 3. Expressed as the absolute vale of the magnitude as a function of frequency in Hz. Can be called or accessed as array.
- Flight.static_marginFunction
Rocket’s static margin during flight in calibers.
Fluid Mechanics: Flight.stream_velocity_x : Function
Freestream velocity x (East) component, in m/s, as a function of time. Can be called or accessed as array.
- Flight.stream_velocity_yFunction
Freestream velocity y (North) component, in m/s, as a function of time. Can be called or accessed as array.
- Flight.stream_velocity_zFunction
Freestream velocity z (up) component, in m/s, as a function of time. Can be called or accessed as array.
- Flight.free_stream_speedFunction
Freestream velocity magnitude, in m/s, as a function of time. Can be called or accessed as array.
- Flight.apogee_freestream_speedfloat
Freestream speed of the rocket at apogee in m/s.
- Flight.mach_numberFunction
Rocket’s Mach number defined as its freestream speed divided by the speed of sound at its altitude. Expressed as a function of time. Can be called or accessed as array.
- Flight.max_mach_numberfloat
Rocket’s maximum Mach number experienced during flight.
- Flight.max_mach_number_timefloat
Time at which the rocket experiences the maximum Mach number.
- Flight.reynolds_numberFunction
Rocket’s Reynolds number, using its diameter as reference length and free_stream_speed as reference velocity. Expressed as a function of time. Can be called or accessed as array.
- Flight.max_reynolds_numberfloat
Rocket’s maximum Reynolds number experienced during flight.
- Flight.max_reynolds_number_timefloat
Time at which the rocket experiences the maximum Reynolds number.
- Flight.dynamic_pressureFunction
Dynamic pressure experienced by the rocket in Pa as a function of time, defined by 0.5*rho*V^2, where rho is air density and V is the freestream speed. Can be called or accessed as array.
- Flight.max_dynamic_pressurefloat
Maximum dynamic pressure, in Pa, experienced by the rocket.
- Flight.max_dynamic_pressure_timefloat
Time at which the rocket experiences maximum dynamic pressure.
- Flight.total_pressureFunction
Total pressure experienced by the rocket in Pa as a function of time. Can be called or accessed as array.
- Flight.max_total_pressurefloat
Maximum total pressure, in Pa, experienced by the rocket.
- Flight.max_total_pressure_timefloat
Time at which the rocket experiences maximum total pressure.
- Flight.angle_of_attackFunction
Rocket’s angle of attack in degrees as a function of time. Defined as the minimum angle between the attitude vector and the freestream velocity vector. Can be called or accessed as array.
Run a trajectory simulation.
- Parameters:
rocket (Rocket) – Rocket to simulate. See help(Rocket) for more information.
environment (Environment) – Environment to run simulation on. See help(Environment) for more information.
rail_length (int, float) – Length in which the rocket will be attached to the rail, only moving along a fixed direction, that is, the line parallel to the rail. Currently, if the an initialSolution is passed, the rail length is not used.
inclination (int, float, optional) – Rail inclination angle relative to ground, given in degrees. Default is 80.
heading (int, float, optional) – Heading angle relative to north given in degrees. Default is 90, which points in the x direction.
initial_solution (array, Flight, optional) –
Initial solution array to be used. Format is initialSolution = [
self.tInitial, xInit, yInit, zInit, vxInit, vyInit, vzInit, e0Init, e1Init, e2Init, e3Init, w1Init, w2Init, w3Init
]. If a Flight object is used, the last state vector will be used as initial solution. If None, the initial solution will start with all null values, except for the euler parameters which will be calculated based on given values of inclination and heading. Default is None.
terminate_on_apogee (boolean, optional) – Whether to terminate simulation when rocket reaches apogee. Default is False.
max_time (int, float, optional) – Maximum time in which to simulate trajectory in seconds. Using this without setting a max_time_step may cause unexpected errors. Default is 600.
max_time_step (int, float, optional) – Maximum time step to use during integration in seconds. Default is 0.01.
min_time_step (int, float, optional) – Minimum time step to use during integration in seconds. Default is 0.01.
rtol (float, array, optional) – Maximum relative error tolerance to be tolerated in the integration scheme. Can be given as array for each state space variable. Default is 1e-3.
atol (float, optional) – Maximum absolute error tolerance to be tolerated in the integration scheme. Can be given as array for each state space variable. Default is 6*[1e-3] + 4*[1e-6] + 3*[1e-3].
time_overshoot (bool, optional) – If True, decouples ODE time step from parachute trigger functions sampling rate. The time steps can overshoot the necessary trigger function evaluation points and then interpolation is used to calculate them and feed the triggers. Can greatly improve run time in some cases. Default is True.
verbose (bool, optional) – If true, verbose mode is activated. Default is False.
name (str, optional) – Name of the flight. Default is “Flight”.
equations_of_motion (str, optional) – Type of equations of motion to use. Can be “standard” or “solid_propulsion”. Default is “standard”. Solid propulsion is a more restricted set of equations of motion that only works for solid propulsion rockets. Such equations were used in RocketPy v0 and are kept here for backwards compatibility.
- Return type:
None
- udot_rail1(t, u, post_processing=False)[source]#
Calculates derivative of u state vector with respect to time when rocket is flying in 1 DOF motion in the rail.
- Parameters:
t (float) – Time in seconds
u (list) – State vector defined by u = [x, y, z, vx, vy, vz, e0, e1, e2, e3, omega1, omega2, omega3].
post_processing (bool, optional) – If True, adds flight data information directly to self variables such as self.attackAngle. Default is False.
- Returns:
u_dot – State vector defined by u_dot = [vx, vy, vz, ax, ay, az, e0dot, e1dot, e2dot, e3dot, alpha1, alpha2, alpha3].
- Return type:
list
- udot_rail2(t, u, post_processing=False)[source]#
[Still not implemented] Calculates derivative of u state vector with respect to time when rocket is flying in 3 DOF motion in the rail.
- Parameters:
t (float) – Time in seconds
u (list) – State vector defined by u = [x, y, z, vx, vy, vz, e0, e1, e2, e3, omega1, omega2, omega3].
post_processing (bool, optional) – If True, adds flight data information directly to self variables such as self.attackAngle, by default False
- Returns:
u_dot – State vector defined by u_dot = [vx, vy, vz, ax, ay, az, e0dot, e1dot, e2dot, e3dot, alpha1, alpha2, alpha3].
- Return type:
list
- u_dot(t, u, post_processing=False)[source]#
Calculates derivative of u state vector with respect to time when rocket is flying in 6 DOF motion during ascent out of rail and descent without parachute.
- Parameters:
t (float) – Time in seconds
u (list) – State vector defined by u = [x, y, z, vx, vy, vz, e0, e1, e2, e3, omega1, omega2, omega3].
post_processing (bool, optional) – If True, adds flight data information directly to self variables such as self.attackAngle, by default False
- Returns:
u_dot – State vector defined by u_dot = [vx, vy, vz, ax, ay, az, e0dot, e1dot, e2dot, e3dot, alpha1, alpha2, alpha3].
- Return type:
list
- u_dot_generalized(t, u, post_processing=False)[source]#
Calculates derivative of u state vector with respect to time when the rocket is flying in 6 DOF motion in space and significant mass variation effects exist. Typical flight phases include powered ascent after launch rail.
- Parameters:
t (float) – Time in seconds
u (list) – State vector defined by u = [x, y, z, vx, vy, vz, q0, q1, q2, q3, omega1, omega2, omega3].
post_processing (bool, optional) – If True, adds flight data information directly to self variables such as self.attackAngle, by default False.
- Returns:
u_dot – State vector defined by u_dot = [vx, vy, vz, ax, ay, az, e0Dot, e1Dot, e2Dot, e3Dot, alpha1, alpha2, alpha3].
- Return type:
list
- u_dot_parachute(t, u, post_processing=False)[source]#
Calculates derivative of u state vector with respect to time when rocket is flying under parachute. A 3 DOF approximation is used.
- Parameters:
t (float) – Time in seconds
u (list) – State vector defined by u = [x, y, z, vx, vy, vz, e0, e1, e2, e3, omega1, omega2, omega3].
post_processing (bool, optional) – If True, adds flight data information directly to self variables such as self.attackAngle. Default is False.
- Returns:
u_dot – State vector defined by u_dot = [vx, vy, vz, ax, ay, az, e0dot, e1dot, e2dot, e3dot, alpha1, alpha2, alpha3].
- Return type:
list
- property solution_array#
Returns solution array of the rocket flight.
- property time#
Returns time array from solution.
- x#
Rocket x position as a rocketpy.Function of time.
- y#
Rocket y position as a rocketpy.Function of time.
- z#
Rocket z position as a rocketpy.Function of time.
- vx#
Rocket x velocity as a rocketpy.Function of time.
- vy#
Rocket y velocity as a rocketpy.Function of time.
- vz#
Rocket z velocity as a rocketpy.Function of time.
- e0#
Rocket quaternion e0 as a rocketpy.Function of time.
- e1#
Rocket quaternion e1 as a rocketpy.Function of time.
- e2#
Rocket quaternion e2 as a rocketpy.Function of time.
- e3#
Rocket quaternion e3 as a rocketpy.Function of time.
- w1#
Rocket angular velocity ω1 as a rocketpy.Function of time.
- w2#
Rocket angular velocity ω2 as a rocketpy.Function of time.
- w3#
Rocket angular velocity ω3 as a rocketpy.Function of time.
- ax#
Rocket x acceleration as a rocketpy.Function of time.
- ay#
Rocket y acceleration as a rocketpy.Function of time.
- az#
Rocket z acceleration as a rocketpy.Function of time.
- alpha1#
Rocket angular acceleration α1 as a rocketpy.Function of time.
- alpha2#
Rocket angular acceleration α2 as a rocketpy.Function of time.
- alpha3#
Rocket angular acceleration α3 as a rocketpy.Function of time.
- R1#
Aerodynamic force along the first axis that is perpendicular to the rocket’s axis of symmetry as a rocketpy.Function of time.
- R2#
Aerodynamic force along the second axis that is perpendicular to the rocket’s axis of symmetry as a rocketpy.Function of time.
- R3#
Aerodynamic force along the rocket’s axis of symmetry as a rocketpy.Function of time.
- M1#
Aerodynamic bending moment in the same direction as the axis that is perpendicular to the rocket’s axis of symmetry as a rocketpy.Function of time.
- M2#
Aerodynamic bending moment in the same direction as the axis that is perpendicular to the rocket’s axis of symmetry as a rocketpy.Function of time.
- M3#
Aerodynamic bending moment in the same direction as the rocket’s axis of symmetry as a rocketpy.Function of time.
- pressure#
Air pressure felt by the rocket as a rocketpy.Function of time.
- density#
Air density felt by the rocket as a rocketpy.Function of time.
- dynamic_viscosity#
Air dynamic viscosity felt by the rocket as a rocketpy.Function of time.
- speed_of_sound#
Speed of sound in the air felt by the rocket as a rocketpy.Function of time.
- wind_velocity_x#
Wind velocity in the X direction (east) as a rocketpy.Function of time.
- wind_velocity_y#
Wind velocity in the y direction (north) as a rocketpy.Function of time.
- speed#
Rocket speed, or velocity magnitude, as a rocketpy.Function of time.
- property max_speed_time#
Time at which the rocket reaches its maximum speed.
- property max_speed#
Maximum speed reached by the rocket.
- acceleration#
Rocket acceleration magnitude as a rocketpy.Function of time.
- property max_acceleration#
Maximum acceleration reached by the rocket.
- property max_acceleration_time#
Time at which the rocket reaches its maximum acceleration.
- horizontal_speed#
Rocket horizontal speed as a rocketpy.Function of time.
- path_angle#
Rocket path angle as a rocketpy.Function of time.
- attitude_vector_x#
Rocket attitude vector X component as a rocketpy.Function of time.
- attitude_vector_y#
Rocket attitude vector Y component as a rocketpy.Function of time.
- attitude_vector_z#
Rocket attitude vector Z component as a rocketpy.Function of time.
- attitude_angle#
Rocket attitude angle as a rocketpy.Function of time.
- lateral_attitude_angle#
Rocket lateral attitude angle as a rocketpy.Function of time.
- psi#
Precession angle as a rocketpy.Function of time.
- phi#
Spin angle as a rocketpy.Function of time.
- theta#
Nutation angle as a rocketpy.Function of time.
- stream_velocity_x#
Freestream velocity X component as a rocketpy.Function of time.
- stream_velocity_y#
Freestream velocity Y component as a rocketpy.Function of time.
- stream_velocity_z#
Freestream velocity Z component as a rocketpy.Function of time.
- free_stream_speed#
Freestream speed as a rocketpy.Function of time.
- property apogee_freestream_speed#
Freestream speed at apogee in m/s.
- mach_number#
Mach number as a rocketpy.Function of time.
- property max_mach_number_time#
Time of maximum Mach number.
- property max_mach_number#
Maximum Mach number.
- reynolds_number#
Reynolds number as a rocketpy.Function of time.
- property max_reynolds_number_time#
Time of maximum Reynolds number.
- property max_reynolds_number#
Maximum Reynolds number.
- dynamic_pressure#
Dynamic pressure as a rocketpy.Function of time.
- property max_dynamic_pressure_time#
Time of maximum dynamic pressure.
- property max_dynamic_pressure#
Maximum dynamic pressure.
- property max_total_pressure_time#
Time of maximum total pressure.
- property max_total_pressure#
Maximum total pressure.
- aerodynamic_lift#
Aerodynamic lift force as a rocketpy.Function of time.
- aerodynamic_drag#
Aerodynamic drag force as a rocketpy.Function of time.
- aerodynamic_bending_moment#
Aerodynamic bending moment as a rocketpy.Function of time.
- aerodynamic_spin_moment#
Aerodynamic spin moment as a rocketpy.Function of time.
- translational_energy#
Translational kinetic energy as a rocketpy.Function of time.
- kinetic_energy#
Total kinetic energy as a rocketpy.Function of time.
- potential_energy#
Potential energy as a rocketpy.Function of time in relation to sea level.
- total_energy#
Total mechanical energy as a rocketpy.Function of time.
- thrust_power#
thrust power as a rocketpy.Function of time.
- drag_power#
Drag power as a rocketpy.Function of time.
- angle_of_attack#
Angle of attack of the rocket with respect to the freestream velocity vector.
- omega1_frequency_response#
Angular velocity 1 frequency response as a rocketpy.Function of frequency, as the rocket leaves the launch rail for 5 seconds of flight.
- omega2_frequency_response#
Angular velocity 2 frequency response as a rocketpy.Function of frequency, as the rocket leaves the launch rail for 5 seconds of flight.
- omega3_frequency_response#
Angular velocity 3 frequency response as a rocketpy.Function of frequency, as the rocket leaves the launch rail for 5 seconds of flight.
- attitude_frequency_response#
Attitude frequency response as a rocketpy.Function of frequency, as the rocket leaves the launch rail for 5 seconds of flight.
- property static_margin#
Static margin of the rocket.
- rail_button1_normal_force#
Upper rail button normal force as a rocketpy.Function of time. If there’s no rail button defined, the function returns a null Function.
- rail_button1_shear_force#
Upper rail button shear force as a rocketpy.Function of time. If there’s no rail button defined, the function returns a null Function.
- rail_button2_normal_force#
Lower rail button normal force as a rocketpy.Function of time. If there’s no rail button defined, the function returns a null Function.
- rail_button2_shear_force#
Lower rail button shear force as a rocketpy.Function of time. If there’s no rail button defined, the function returns a null Function.
- property max_rail_button1_normal_force#
Maximum upper rail button normal force, in Newtons.
- property max_rail_button1_shear_force#
Maximum upper rail button shear force, in Newtons.
- property max_rail_button2_normal_force#
Maximum lower rail button normal force, in Newtons.
- property max_rail_button2_shear_force#
Maximum lower rail button shear force, in Newtons.
- drift#
Rocket horizontal distance to tha launch point, in meters, as a rocketpy.Function of time.
- bearing#
Rocket bearing compass, in degrees, as a rocketpy.Function of time.
- latitude#
Rocket latitude coordinate, in degrees, as a rocketpy.Function of time.
- longitude#
Rocket longitude coordinate, in degrees, as a rocketpy.Function of time.
- property retrieve_acceleration_arrays#
Retrieve acceleration arrays from the integration scheme
- Returns:
ax (list) – acceleration in x direction
ay (list) – acceleration in y direction
az (list) – acceleration in z direction
alpha1 (list) – angular acceleration in x direction
alpha2 (list) – angular acceleration in y direction
alpha3 (list) – angular acceleration in z direction
- property retrieve_temporary_values_arrays#
Retrieve temporary values arrays from the integration scheme. Currently, the following temporary values are retrieved:
R1
R2
R3
M1
M2
M3
pressure
density
dynamic_viscosity
speed_of_sound
- Parameters:
None –
- Returns:
self.R1_list (list) – R1 values.
self.R2_list (list) – R2 values.
self.R3_list (list) – R3 values are the aerodynamic force values in the rocket’s axis direction.
self.M1_list (list) – M1 values.
self.M2_list (list) – Aerodynamic bending moment in e2 direction at each time step.
self.M3_list (list) – Aerodynamic bending moment in e3 direction at each time step.
self.pressure_list (list) – Air pressure at each time step.
self.density_list (list) – Air density at each time step.
self.dynamic_viscosity_list (list) – Dynamic viscosity at each time step.
self.speed_of_sound_list (list) – Speed of sound at each time step.
self.wind_velocity_x_list (list) – Wind velocity in x direction at each time step.
self.wind_velocity_y_list (list) – Wind velocity in y direction at each time step.
- post_process(interpolation='spline', extrapolation='natural')[source]#
Post-process all Flight information produced during simulation. Includes the calculation of maximum values, calculation of secondary values such as energy and conversion of lists to Function objects to facilitate plotting.
This method is deprecated and is only kept here for backwards
compatibility. * All attributes that need to be post processed are computed just in time.
- Parameters:
None –
- Return type:
None
- info()[source]#
Prints out a summary of the data available about the Flight.
- Parameters:
None –
- Return type:
None
- calculate_stall_wind_velocity(stall_angle)[source]#
Function to calculate the maximum wind velocity before the angle of attack exceeds a desired angle, at the instant of departing rail launch. Can be helpful if you know the exact stall angle of all aerodynamics surfaces.
- Parameters:
stall_angle (float) – Angle, in degrees, for which you would like to know the maximum wind speed before the angle of attack exceeds it
- Return type:
None
- export_pressures(file_name, time_step)[source]#
Exports the pressure experienced by the rocket during the flight to an external file, the ‘.csv’ format is recommended, as the columns will be separated by commas. It can handle flights with or without parachutes, although it is not possible to get a noisy pressure signal if no parachute is added.
If a parachute is added, the file will contain 3 columns: time in seconds, clean pressure in Pascals and noisy pressure in Pascals. For flights without parachutes, the third column will be discarded
This function was created especially for the ‘Projeto Jupiter’ Electronics Subsystems team and aims to help in configuring micro-controllers.
- Parameters:
file_name (string) – The final file name,
time_step (float) – Time step desired for the final file
- Return type:
None
- export_data(file_name, *variables, time_step=None)[source]#
Exports flight data to a comma separated value file (.csv).
Data is exported in columns, with the first column representing time steps. The first line of the file is a header line, specifying the meaning of each column and its units.
- Parameters:
file_name (string) – The file name or path of the exported file. Example: flight_data.csv Do not use forbidden characters, such as ‘/’ in Linux/Unix and ‘<, >, :, “, /, , | ?, *’ in Windows.
variables (strings, optional) – Names of the data variables which shall be exported. Must be Flight class attributes which are instances of the Function class. Usage example: test_flight.export_data(‘test.csv’, ‘z’, ‘angle_of_attack’, ‘mach_number’).
time_step (float, optional) – Time step desired for the data. If None, all integration time steps will be exported. Otherwise, linear interpolation is carried out to calculate values at the desired time steps. Example: 0.001.
- export_kml(file_name='trajectory.kml', time_step=None, extrude=True, color='641400F0', altitude_mode='absolute')[source]#
Exports flight data to a .kml file, which can be opened with Google Earth to display the rocket’s trajectory.
- Parameters:
file_name (string) – The file name or path of the exported file. Example: flight_data.csv Do not use forbidden characters, such as ‘/’ in Linux/Unix and ‘<, >, :, “, /, , | ?, *’ in Windows.
time_step (float, optional) – Time step desired for the data. If None, all integration time steps will be exported. Otherwise, linear interpolation is carried out to calculate values at the desired time steps. Example: 0.001.
extrude (bool, optional) – To be used if you want to project the path over ground by using an extruded polygon. In case False only the linestring containing the flight path will be created. Default is True.
color (str, optional) – Color of your trajectory path, need to be used in specific kml format. Refer to http://www.zonums.com/gmaps/kml_color/ for more info.
altitude_mode (str) – Select elevation values format to be used on the kml file. Use ‘relativetoground’ if you want use Above Ground Level elevation, or ‘absolute’ if you want to parse elevation using Above Sea Level. Default is ‘relativetoground’. Only works properly if the ground level is flat. Change to ‘absolute’ if the terrain is to irregular or contains mountains.
- Return type:
None