Motor Plots Class#
- class rocketpy.plots.motor_plots._MotorPlots[source]#
Class that holds plot methods for Motor class.
- Variables:
_MotorPlots.motor (
Motor
) – Motor object that will be used for the plots.
- __init__(motor)[source]#
Initializes _MotorClass class.
- Parameters:
motor (
Motor
) – Instance of the Motor class- Return type:
None
- thrust(lower_limit=None, upper_limit=None)[source]#
Plots thrust of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- total_mass(lower_limit=None, upper_limit=None)[source]#
Plots total_mass of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- propellant_mass(lower_limit=None, upper_limit=None)[source]#
Plots propellant_mass of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is None, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is None, which means that the plot limits will be automatically calculated.
- Return type:
None
- center_of_mass(lower_limit=None, upper_limit=None)[source]#
Plots center_of_mass of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- mass_flow_rate(lower_limit=None, upper_limit=None)[source]#
Plots mass_flow_rate of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- exhaust_velocity(lower_limit=None, upper_limit=None)[source]#
Plots exhaust_velocity of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- I_11(lower_limit=None, upper_limit=None)[source]#
Plots I_11 of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- I_22(lower_limit=None, upper_limit=None)[source]#
Plots I_22 of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- I_33(lower_limit=None, upper_limit=None)[source]#
Plots I_33 of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- I_12(lower_limit=None, upper_limit=None)[source]#
Plots I_12 of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- I_13(lower_limit=None, upper_limit=None)[source]#
Plots I_13 of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is none, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is none, which means that the plot limits will be automatically calculated.
- Return type:
None
- I_23(lower_limit=None, upper_limit=None)[source]#
Plots I_23 of the motor as a function of time.
- Parameters:
lower_limit (
float
) – Lower limit of the plot. Default is None, which means that the plot limits will be automatically calculated.upper_limit (
float
) – Upper limit of the plot. Default is None, which means that the plot limits will be automatically calculated.
- Return type:
None
- _generate_nozzle(translate=(0, 0), csys=1)[source]#
Generates a patch that represents the nozzle of the motor. It is simply a polygon with 5 vertices mirrored in the x axis. The nozzle is drawn in the origin and then translated and rotated to the correct position.
- Parameters:
translate (
tuple
) – Tuple with the x and y coordinates of the translation that will be applied to the nozzle.csys (
float
) – Coordinate system of the motor or rocket. This will define the orientation of the nozzle draw. Default is 1, which means that the nozzle will be drawn with its outlet pointing to the right.
- Returns:
patch – Patch that represents the nozzle of the liquid_motor.
- Return type:
matplotlib.patches.Polygon
- _generate_combustion_chamber(translate=(0, 0), label='Combustion Chamber')[source]#
Generates a patch that represents the combustion chamber of the motor. It is simply a polygon with 4 vertices mirrored in the x axis. The combustion chamber is drawn in the origin and must be translated.
- Parameters:
translate (
tuple
) – Tuple with the x and y coordinates of the translation that will be applied to the combustion chamber.label (
str
) – Label that will be used in the legend of the plot. Default is “Combustion Chamber”.
- Returns:
patch – Patch that represents the combustion chamber of the motor.
- Return type:
matplotlib.patches.Polygon
- _generate_grains(translate=(0, 0))[source]#
Generates a list of patches that represent the grains of the motor. Each grain is a polygon with 4 vertices mirrored in the x axis. The top and bottom vertices are the same for all grains, but the left and right vertices are different for each grain. The grains are drawn in the origin and must be translated.
- Parameters:
translate (
tuple
) – Tuple with the x and y coordinates of the translation that will be applied to the grains.- Returns:
patches – List of patches that represent the grains of the motor.
- Return type:
list
- _generate_positioned_tanks(translate=(0, 0), csys=1)[source]#
Generates a list of patches that represent the tanks of the liquid_motor.
- Parameters:
translate (
tuple
) – Tuple with the x and y coordinates of the translation that will be applied to the tanks.csys (
float
) – Coordinate system of the motor or rocket. This will define the orientation of the tanks draw. Default is 1, which means that the tanks will be drawn with the nose cone pointing left.
- Returns:
patches_and_centers – List of tuples where the first item is the patch of the tank, and the second item is the geometrical center.
- Return type:
list
- _draw_center_of_mass(ax)[source]#
Draws a red circle in the center of mass of the motor. This can be used for grains center of mass and the center of dry mass.
- Parameters:
ax (
matplotlib.axes.Axes
) – Axes object to plot the center of mass on.
- _generate_motor_region(list_of_patches)[source]#
Generates a patch that represents the motor outline. It is simply a polygon with 4 vertices mirrored in the x axis. The outline is drawn considering all the patches that represent the motor.
- Parameters:
list_of_patches (
list
) – List of patches that represent the motor outline.- Returns:
patch – Patch that represents the motor outline.
- Return type:
matplotlib.patches.Polygon