SolidMotor Class#
- class rocketpy.SolidMotor[source]#
Class to specify characteristics and useful operations for solid motors.
Inherits from the abstract class rocketpy.Motor.
See also
- Variables:
SolidMotor.coordinate_system_orientation (
str
) – Orientation of the motor’s coordinate system. The coordinate system is defined by the motor’s axis of symmetry. The origin of the coordinate system may be placed anywhere along such axis, such as at the nozzle area, and must be kept the same for all other positions specified. Options are “nozzle_to_combustion_chamber” and “combustion_chamber_to_nozzle”.SolidMotor.nozzle_radius (
float
) – Radius of motor nozzle outlet in meters.SolidMotor.nozzle_position (
float
) – Motor’s nozzle outlet position in meters, specified in the motor’s coordinate system. See Positions and Coordinate Systems for more information.SolidMotor.throat_radius (
float
) – Radius of motor nozzle throat in meters.SolidMotor.grain_number (
int
) – Number of solid grains.SolidMotor.grains_center_of_mass_position (
float
) – Position of the center of mass of the grains in meters, specified in the motor’s coordinate system. See Positions and Coordinate Systems for more information.SolidMotor.grain_separation (
float
) – Distance between two grains in meters.SolidMotor.grain_density (
float
) – Density of each grain in kg/meters cubed.SolidMotor.grain_outer_radius (
float
) – Outer radius of each grain in meters.SolidMotor.grain_initial_inner_radius (
float
) – Initial inner radius of each grain in meters.SolidMotor.grain_initial_height (
float
) – Initial height of each grain in meters.SolidMotor.grain_initial_volume (
float
) – Initial volume of each grain in meters cubed.SolidMotor.grain_inner_radius (
Function
) – Inner radius of each grain in meters as a function of time.SolidMotor.grain_height (
Function
) – Height of each grain in meters as a function of time.SolidMotor.grain_initial_mass (
float
) – Initial mass of each grain in kg.SolidMotor.dry_mass (
float
) – Same as in Motor class. See theMotor
docs.SolidMotor.propellant_initial_mass (
float
) – Total propellant initial mass in kg.SolidMotor.total_mass (
Function
) – Total motor mass in kg as a function of time, defined as the sum of propellant and dry mass.SolidMotor.propellant_mass (
Function
) – Total propellant mass in kg as a function of time.SolidMotor.total_mass_flow_rate (
Function
) – Time derivative of propellant total mass in kg/s as a function of time as obtained by the thrust source.SolidMotor.center_of_mass (
Function
) – Position of the motor center of mass in meters as a function of time, with respect to the motor’s coordinate system. See Positions and Coordinate Systems for more information regarding the motor’s coordinate system.SolidMotor.center_of_propellant_mass (
Function
) – Position of the motor propellant center of mass in meters as a function of time. See Positions and Coordinate Systems for more information regarding the motor’s coordinate system.SolidMotor.I_11 (
Function
) – Component of the motor’s inertia tensor relative to the e_1 axis in kg*m^2, as a function of time. The e_1 axis is the direction perpendicular to the motor body axis of symmetry, centered at the instantaneous motor center of mass.SolidMotor.I_22 (
Function
) – Component of the motor’s inertia tensor relative to the e_2 axis in kg*m^2, as a function of time. The e_2 axis is the direction perpendicular to the motor body axis of symmetry, centered at the instantaneous motor center of mass. Numerically equivalent to I_11 due to symmetry.SolidMotor.I_33 (
Function
) – Component of the motor’s inertia tensor relative to the e_3 axis in kg*m^2, as a function of time. The e_3 axis is the direction of the motor body axis of symmetry, centered at the instantaneous motor center of mass.SolidMotor.I_12 (
Function
) – Component of the motor’s inertia tensor relative to the e_1 and e_2 axes in kg*m^2, as a function of time. See SolidMotor.I_11 and SolidMotor.I_22 for more information.SolidMotor.I_13 (
Function
) – Component of the motor’s inertia tensor relative to the e_1 and e_3 axes in kg*m^2, as a function of time. See SolidMotor.I_11 and SolidMotor.I_33 for more information.SolidMotor.I_23 (
Function
) – Component of the motor’s inertia tensor relative to the e_2 and e_3 axes in kg*m^2, as a function of time. See SolidMotor.I_22 and SolidMotor.I_33 for more information.SolidMotor.propellant_I_11 (
Function
) – Component of the propellant inertia tensor relative to the e_1 axis in kg*m^2, as a function of time. The e_1 axis is the direction perpendicular to the motor body axis of symmetry, centered at the instantaneous propellant center of mass.SolidMotor.propellant_I_22 (
Function
) – Component of the propellant inertia tensor relative to the e_2 axis in kg*m^2, as a function of time. The e_2 axis is the direction perpendicular to the motor body axis of symmetry, centered at the instantaneous propellant center of mass. Numerically equivalent to propellant_I_11 due to symmetry.SolidMotor.propellant_I_33 (
Function
) – Component of the propellant inertia tensor relative to the e_3 axis in kg*m^2, as a function of time. The e_3 axis is the direction of the motor body axis of symmetry, centered at the instantaneous propellant center of mass.SolidMotor.propellant_I_12 (
Function
) – Component of the propellant inertia tensor relative to the e_1 and e_2 axes in kg*m^2, as a function of time. See SolidMotor.propellant_I_11 and SolidMotor.propellant_I_22 for more information.SolidMotor.propellant_I_13 (
Function
) – Component of the propellant inertia tensor relative to the e_1 and e_3 axes in kg*m^2, as a function of time. See SolidMotor.propellant_I_11 and SolidMotor.propellant_I_33 for more information.SolidMotor.propellant_I_23 (
Function
) – Component of the propellant inertia tensor relative to the e_2 and e_3 axes in kg*m^2, as a function of time. See SolidMotor.propellant_I_22 and SolidMotor.propellant_I_33 for more information.SolidMotor.thrust (
Function
) – Motor thrust force, in Newtons, as a function of time.SolidMotor.total_impulse (
float
) – Total impulse of the thrust curve in N*s.SolidMotor.max_thrust (
float
) – Maximum thrust value of the given thrust curve, in N.SolidMotor.max_thrust_time (
float
) – Time, in seconds, in which the maximum thrust value is achieved.SolidMotor.average_thrust (
float
) – Average thrust of the motor, given in N.SolidMotor.burn_time (
tuple
offloat
) – Tuple containing the initial and final time of the motor’s burn time in seconds.SolidMotor.burn_start_time (
float
) – Motor burn start time, in seconds.SolidMotor.burn_out_time (
float
) – Motor burn out time, in seconds.SolidMotor.burn_duration (
float
) – Total motor burn duration, in seconds. It is the difference between theburn_out_time
and theburn_start_time
.SolidMotor.exhaust_velocity (
Function
) – Propulsion gases exhaust velocity, assumed constant, in m/s.SolidMotor.burn_area (
Function
) – Total burn area considering all grains, made out of inner cylindrical burn area and grain top and bottom faces. Expressed in meters squared as a function of time.SolidMotor.Kn (
Function
) – Motor Kn as a function of time. Defined as burn_area divided by nozzle throat cross sectional area. Has no units.SolidMotor.burn_rate (
Function
) – Propellant burn rate in meter/second as a function of time.SolidMotor.interpolate (
string
) – Method of interpolation used in case thrust curve is given by data set in .csv or .eng, or as an array. Options are ‘spline’ ‘akima’ and ‘linear’. Default is “linear”.
- __init__(thrust_source, dry_mass, dry_inertia, nozzle_radius, grain_number, grain_density, grain_outer_radius, grain_initial_inner_radius, grain_initial_height, grain_separation, grains_center_of_mass_position, center_of_dry_mass_position, nozzle_position=0, burn_time=None, throat_radius=0.01, reshape_thrust_curve=False, interpolation_method='linear', coordinate_system_orientation='nozzle_to_combustion_chamber')[source]#
Initialize Motor class, process thrust curve and geometrical parameters and store results.
- Parameters:
thrust_source (
int
,float
,callable
,string
,array
,Function
) –Motor’s thrust curve. Can be given as an int or float, in which case the thrust will be considered constant in time. It can also be given as a callable function, whose argument is time in seconds and returns the thrust supplied by the motor in the instant. If a string is given, it must point to a .csv or .eng file. The .csv file shall contain no headers and the first column must specify time in seconds, while the second column specifies thrust. Arrays may also be specified, following rules set by the class Function. Thrust units are Newtons.
See also
nozzle_radius (
int
,float
) – Motor’s nozzle outlet radius in meters.dry_mass (
int
,float
) – Same as in Motor class. See theMotor
docsdry_inertia (
tuple
,list
) – Tuple or list containing the motor’s dry mass inertia tensor components, in kg*m^2. This inertia is defined with respect to the the center_of_dry_mass_position position. Assuming e_3 is the rocket’s axis of symmetry, e_1 and e_2 are orthogonal and form a plane perpendicular to e_3, the dry mass inertia tensor components must be given in the following order: (I_11, I_22, I_33, I_12, I_13, I_23), where I_ij is the component of the inertia tensor in the direction of e_i x e_j. Alternatively, the inertia tensor can be given as (I_11, I_22, I_33), where I_12 = I_13 = I_23 = 0.grain_number (
int
) – Number of solid grainsgrain_density (
int
,float
) – Solid grain density in kg/m3.grain_outer_radius (
int
,float
) – Solid grain outer radius in meters.grain_initial_inner_radius (
int
,float
) – Solid grain initial inner radius in meters.grain_initial_height (
int
,float
) – Solid grain initial height in meters.grain_separation (
int
,float
) – Distance between grains, in meters.grains_center_of_mass_position (
float
) – Position of the center of mass of the grains in meters. More specifically, the coordinate of the center of mass specified in the motor’s coordinate system. See Positions and Coordinate Systems for more information.center_of_dry_mass_position (
int
,float
) – The position, in meters, of the motor’s center of mass with respect to the motor’s coordinate system when it is devoid of propellant. See Positions and Coordinate Systems.nozzle_position (
int
,float
, optional) – Motor’s nozzle outlet position in meters, in the motor’s coordinate system. See Positions and Coordinate Systems for details. Default is 0, in which case the origin of the coordinate system is placed at the motor’s nozzle outlet.burn_time (
float
,tuple
offloat
, optional) – Motor’s burn time. If a float is given, the burn time is assumed to be between 0 and the given float, in seconds. If a tuple of float is given, the burn time is assumed to be between the first and second elements of the tuple, in seconds. If not specified, automatically sourced as the range between the first- and last-time step of the motor’s thrust curve. This can only be used if the motor’s thrust is defined by a list of points, such as a .csv file, a .eng file or a Function instance whose source is a list.throat_radius (
int
,float
, optional) – Motor’s nozzle throat radius in meters. Used to calculate Kn curve. Optional if the Kn curve is not interesting. Its value does not impact trajectory simulation.reshape_thrust_curve (
boolean
,tuple
, optional) – If False, the original thrust curve supplied is not altered. If a tuple is given, whose first parameter is a new burn out time and whose second parameter is a new total impulse in Ns, the thrust curve is reshaped to match the new specifications. May be useful for motors whose thrust curve shape is expected to remain similar in case the impulse and burn time varies slightly. Default is False.interpolation_method (
string
, optional) – Method of interpolation to be used in case thrust curve is given by data set in .csv or .eng, or as an array. Options are ‘spline’ ‘akima’ and ‘linear’. Default is “linear”.coordinate_system_orientation (
string
, optional) – Orientation of the motor’s coordinate system. The coordinate system is defined by the motor’s axis of symmetry. The origin of the coordinate system may be placed anywhere along such axis, such as at the nozzle area, and must be kept the same for all other positions specified. Options are “nozzle_to_combustion_chamber” and “combustion_chamber_to_nozzle”. Default is “nozzle_to_combustion_chamber”.
- Return type:
None
- propellant_mass#
Evaluates the total propellant mass as a function of time.
- Returns:
Mass of the motor, in kg.
- Return type:
- grain_volume#
Evaluates the total propellant volume as a function of time. The propellant is assumed to be a cylindrical Bates grain under uniform burn.
- Returns:
Propellant volume as a function of time.
- Return type:
- exhaust_velocity#
Exhaust velocity by assuming it as a constant. The formula used is total impulse/propellant initial mass.
- Returns:
self.exhaust_velocity – Gas exhaust velocity of the motor.
- Return type:
- property propellant_initial_mass#
Returns the initial propellant mass.
- Returns:
Initial propellant mass in kg.
- Return type:
float
- property mass_flow_rate#
Time derivative of propellant mass. Assumes constant exhaust velocity. The formula used is the opposite of thrust divided by exhaust velocity.
- Returns:
self.mass_flow_rate – Time derivative of total propellant mass as a function of time.
- Return type:
See also
Motor.total_mass_flow_rate
Calculates the total mass flow rate of the motor assuming constant exhaust velocity.
- center_of_propellant_mass#
Position of the propellant center of mass as a function of time. The position is specified as a scalar, relative to the motor’s coordinate system.
- Returns:
Position of the propellant center of mass as a function of time.
- Return type:
- evaluate_geometry()[source]#
Calculates grain inner radius and grain height as a function of time by assuming that every propellant mass burnt is exhausted. In order to do that, a system of differential equations is solved using scipy.integrate.solve_ivp.
- Return type:
None
- burn_area#
Calculates the BurnArea of the grain for each time. Assuming that the grains are cylindrical BATES grains.
- Returns:
burn_area – Function representing the burn area progression with the time.
- Return type:
- burn_rate#
Calculates the burn_rate with respect to time. This evaluation assumes that it was already calculated the mass_dot, burn_area time series.
- Returns:
burn_rate – Rate of progression of the inner radius during the combustion.
- Return type:
- property Kn#
Calculates the motor Kn as a function of time. Defined as burn_area divided by the nozzle throat cross sectional area.
- Returns:
Kn – Kn as a function of time.
- Return type:
- propellant_I_11#
Inertia tensor 11 component of the propellant, the inertia is relative to the e_1 axis, centered at the instantaneous propellant center of mass.
- Returns:
Propellant inertia tensor 11 component at time t.
- Return type:
Notes
The e_1 direction is assumed to be the direction perpendicular to the motor body axis.
References
- propellant_I_22#
Inertia tensor 22 component of the propellant, the inertia is relative to the e_2 axis, centered at the instantaneous propellant center of mass.
- Returns:
Propellant inertia tensor 22 component at time t.
- Return type:
Notes
The e_2 direction is assumed to be the direction perpendicular to the motor body axis, and perpendicular to e_1.
- propellant_I_33#
Inertia tensor 33 component of the propellant, the inertia is relative to the e_3 axis, centered at the instantaneous propellant center of mass.
- Returns:
Propellant inertia tensor 33 component at time t.
- Return type:
Notes
The e_3 direction is assumed to be the axial direction of the rocket motor.
- propellant_I_12#
- propellant_I_13#
- propellant_I_23#