rocketpal.utilities.config_calc module¶
- rocketpal.utilities.config_calc.calculate_center_of_mass(parts)[source]¶
Calculate the center of mass of a list of parts
- Parameters:
parts (list[Part]) – List of parts
- Returns:
The center of mass of the parts in the format (x, y, z)
- Return type:
tuple[float, float, float]
- rocketpal.utilities.config_calc.grainCom(grain_num, grain_h, grain_sep)[source]¶
Calculates the center of mass of the grains in the motor.
- Parameters:
grain_num (int) – The number of grains in the motor.
grain_h (float) – The height of each grain (longitudinal) in m.
grain_sep (float) – The separation gap between grains in m.
- Returns:
The center of mass of the grains in m, measured from the aft end of the motor
- Return type:
float
- rocketpal.utilities.config_calc.grainDensity(propWeight, grain_num, grain_h, grain_or, grain_ir)[source]¶
Calculates the density of the grain based on its dimensions and propellant weight.
- Parameters:
propWeight (float) – The total weight of the propellant in kg.
grain_num (int) – The number of grains in the motor.
grain_h (float) – The height of each grain (longitudinal) in m.
grain_or (float) – The outer radius of each grain in m.
grain_ir (float) – The inner radius of each grain in m.
- Returns:
The density of the grain in kg/m^3.
- Return type:
float
- rocketpal.utilities.config_calc.inertia_component(refPoint, aftEndComp, radialDis, radialDir, diam, len, mass)[source]¶
Calculate the inertia tensor contribution of one rocket component.
- Parameters:
refPoint (tuple[float, float, float]) – The reference point for the inertia tensor calculation, typically the center of mass of the rocket.
aftEndComp (float) – The distance from the aft end of the rocket to the aft end of the component.
radialDis (float) – The radial distance of the component from the rocket’s central axis.
radialDir (float) – The radial direction of the component in degrees, where 0° is aligned with the x-axis of the reference point.
diam (float) – The diameter of the component.
len (float) – The length of the component.
mass (float) – The mass of the component.
- Returns:
The inertia tensor contribution of the component, represented as a tuple of six unique elements in the order (I_11, I_22, I_33, I_12, I_13, I_23).
- Return type:
tuple[float, float, float, float, float, float]
- rocketpal.utilities.config_calc.rocket_cog(aft_end_comps, radial_dis_comps, radial_dir_comps, len_comps, mass_comps)[source]¶
Calculates the center of gravity of the rocket in reference to the aft end of the rocket. Depending on the chosen coordinate system, this position must be shifted.
- Parameters:
aft_end_comps (list[float]) – List of distances of aft ends of components to aft end of rocket (z component of position); components must be in order of radial_dis_comps, radial_dir_comps, diam_comps, len_comps, mass_comps.
radial_dis_comps (list[float]) – List of radial distances to rocket’s rotational axis in m; components must be in order of aft_end_comps, radial_dir_comps, diam_comps, len_comps, mass_comps.
radial_dir_comps (list[float]) – List of radial directions in degrees (=0°: direction of x-axis of reference point); components must be in order of aft_end_comps, radial_dis_comps, diam_comps, len_comps, mass_comps.
len_comps (list[float]) – List of lengths/heights of components in m; components must be in order of aft_end_comps, radial_dis_comps, radial_dir_comps, diam_comps, mass_comps.
mass_comps (list[float]) – List of components masses in kg; components must be in order of aft_end_comps, radial_dis_comps, radial_dir_comps, diam_comps, len_comps.
- Returns:
The center of gravity of the rocket in m, in the format (x, y, z).
- Return type:
tuple[float, float, float]