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

inertia_tensor(lower_limit=None, upper_limit=None, show_products=False)[source]#

Plots all inertia tensors (I_11, I_22, I_33, I_12, I_13, I_23) of the motor as a function of time in a single chart.

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.

  • show_products (bool) – If True, the products of inertia (I_12, I_13, I_23) will be shown in the plot. Default is False. These are kept as hidden by default because they are usually very small compared to the main inertia components.

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

all()[source]#

Prints out all graphs available about the Motor. It simply calls all the other plotter methods in this class.

Return type:

None