Skip to content

Commit f9ff423

Browse files
Merge pull request #445 from RocketPy-Team/docs/improve_mass_docs
DOCs: improve mass and inertia docs
2 parents 59f091b + 90d489c commit f9ff423

File tree

8 files changed

+257
-222
lines changed

8 files changed

+257
-222
lines changed

rocketpy/motors/hybrid_motor.py

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ class HybridMotor(Motor):
4242
HybridMotor.liquid : LiquidMotor
4343
Liquid motor object that composes the hybrid motor.
4444
HybridMotor.dry_mass : float
45-
The total mass of the motor structure, including chambers
46-
and tanks, when it is empty and does not contain any propellant.
45+
Same as in Motor class. See the :class:`Motor <rocketpy.Motor>` docs.
4746
HybridMotor.propellant_initial_mass : float
48-
Total propellant initial mass in kg.
47+
Total propellant initial mass in kg. This is the sum of the initial
48+
mass of fluids in each tank and the initial mass of the solid grains.
4949
HybridMotor.total_mass : Function
5050
Total motor mass in kg as a function of time, defined as the sum
51-
of propellant and dry mass.
51+
of the dry mass (motor's structure mass) and the propellant mass, which
52+
varies with time.
5253
HybridMotor.propellant_mass : Function
53-
Total propellant mass in kg as a function of time.
54+
Total propellant mass in kg as a function of time, this includes the
55+
mass of fluids in each tank and the mass of the solid grains.
5456
HybridMotor.total_mass_flow_rate : Function
5557
Time derivative of propellant total mass in kg/s as a function
5658
of time as obtained by the thrust source.
@@ -199,8 +201,7 @@ def __init__(
199201
200202
.. seealso:: :doc:`Thrust Source Details </user/motors/thrust>`
201203
dry_mass : int, float
202-
The total mass of the motor structure, including chambers
203-
and tanks, when it is empty and does not contain any propellant.
204+
Same as in Motor class. See the :class:`Motor <rocketpy.Motor>` docs
204205
dry_inertia : tuple, list
205206
Tuple or list containing the motor's dry mass inertia tensor
206207
components, in kg*m^2. This inertia is defined with respect to the
@@ -345,18 +346,19 @@ def exhaust_velocity(self):
345346
@funcify_method("Time (s)", "Mass (kg)")
346347
def propellant_mass(self):
347348
"""Evaluates the total propellant mass of the motor as the sum
348-
of each tank mass and the grains mass.
349+
of fluids mass in each tank and the grains mass.
349350
350351
Returns
351352
-------
352353
Function
353-
Total propellant mass of the motor, in kg.
354+
Total propellant mass of the motor as a function of time, in kg.
354355
"""
355356
return self.solid.propellant_mass + self.liquid.propellant_mass
356357

357358
@cached_property
358359
def propellant_initial_mass(self):
359-
"""Returns the initial propellant mass of the motor.
360+
"""Returns the initial propellant mass of the motor. See the docs of the
361+
HybridMotor.propellant_mass property for more information.
360362
361363
Returns
362364
-------
@@ -367,8 +369,8 @@ def propellant_initial_mass(self):
367369

368370
@funcify_method("Time (s)", "mass flow rate (kg/s)", extrapolation="zero")
369371
def mass_flow_rate(self):
370-
"""Evaluates the mass flow rate of the motor as the sum of each tank
371-
mass flow rate and the grains mass flow rate.
372+
"""Evaluates the mass flow rate of the motor as the sum of mass flow
373+
rates from all tanks and the solid grains mass flow rate.
372374
373375
Returns
374376
-------
@@ -486,14 +488,59 @@ def propellant_I_33(self):
486488

487489
@funcify_method("Time (s)", "Inertia I_12 (kg m²)")
488490
def propellant_I_12(self):
491+
"""Inertia tensor 12 component of the propellant, the inertia is
492+
relative to the e_1 and e_2 axes, centered at the instantaneous
493+
propellant center of mass.
494+
495+
Returns
496+
-------
497+
Function
498+
Propellant inertia tensor 12 component at time t.
499+
500+
Notes
501+
-----
502+
This is assumed to be zero due to axial symmetry of the motor. This
503+
could be improved in the future to account for the fact that the
504+
motor is not perfectly symmetric.
505+
"""
489506
return 0
490507

491508
@funcify_method("Time (s)", "Inertia I_13 (kg m²)")
492509
def propellant_I_13(self):
510+
"""Inertia tensor 13 component of the propellant, the inertia is
511+
relative to the e_1 and e_3 axes, centered at the instantaneous
512+
propellant center of mass.
513+
514+
Returns
515+
-------
516+
Function
517+
Propellant inertia tensor 13 component at time t.
518+
519+
Notes
520+
-----
521+
This is assumed to be zero due to axial symmetry of the motor. This
522+
could be improved in the future to account for the fact that the
523+
motor is not perfectly symmetric.
524+
"""
493525
return 0
494526

495527
@funcify_method("Time (s)", "Inertia I_23 (kg m²)")
496528
def propellant_I_23(self):
529+
"""Inertia tensor 23 component of the propellant, the inertia is
530+
relative to the e_2 and e_3 axes, centered at the instantaneous
531+
propellant center of mass.
532+
533+
Returns
534+
-------
535+
Function
536+
Propellant inertia tensor 23 component at time t.
537+
538+
Notes
539+
-----
540+
This is assumed to be zero due to axial symmetry of the motor. This
541+
could be improved in the future to account for the fact that the
542+
motor is not perfectly symmetric.
543+
"""
497544
return 0
498545

499546
def add_tank(self, tank, position):

rocketpy/motors/liquid_motor.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ class LiquidMotor(Motor):
3737
List containing the motor's added tanks and their respective
3838
positions.
3939
LiquidMotor.dry_mass : float
40-
The total mass of the motor structure, including chambers
41-
and tanks, when it is empty and does not contain any propellant.
40+
Same as in Motor class. See the :class:`Motor <rocketpy.Motor>` docs.
4241
LiquidMotor.propellant_initial_mass : float
43-
Total propellant initial mass in kg, includes
44-
fuel and oxidizer.
42+
Total propellant initial mass in kg, includes fuel and oxidizer.
4543
LiquidMotor.total_mass : Function
4644
Total motor mass in kg as a function of time, defined as the sum
47-
of propellant and dry mass.
45+
of propellant mass and the motor's dry mass (i.e. structure mass).
4846
LiquidMotor.propellant_mass : Function
4947
Total propellant mass in kg as a function of time, includes fuel
5048
and oxidizer.
@@ -175,8 +173,7 @@ def __init__(
175173
176174
.. seealso:: :doc:`Thrust Source Details </user/motors/thrust>`
177175
dry_mass : int, float
178-
The total mass of the motor structure, including chambers
179-
and tanks, when it is empty and does not contain any propellant.
176+
Same as in Motor class. See the :class:`Motor <rocketpy.Motor>` docs.
180177
dry_inertia : tuple, list
181178
Tuple or list containing the motor's dry mass inertia tensor
182179
components, in kg*m^2. This inertia is defined with respect to the
@@ -260,12 +257,20 @@ def exhaust_velocity(self):
260257
-------
261258
self.exhaust_velocity : Function
262259
Gas exhaust velocity of the motor.
260+
261+
Notes
262+
-----
263+
The exhaust velocity is computed as the ratio of the thrust and the
264+
mass flow rate. Therefore, this will vary with time if the mass flow
265+
rate varies with time.
263266
"""
264267
return self.thrust / (-1 * self.mass_flow_rate)
265268

266269
@funcify_method("Time (s)", "Propellant Mass (kg)")
267270
def propellant_mass(self):
268-
"""Evaluates the mass of the motor as the sum of each tank mass.
271+
"""Evaluates the total propellant mass of the motor as the sum of fluids
272+
mass in each tank, which may include fuel and oxidizer and usually vary
273+
with time.
269274
270275
Returns
271276
-------
@@ -281,7 +286,8 @@ def propellant_mass(self):
281286

282287
@cached_property
283288
def propellant_initial_mass(self):
284-
"""Property to store the initial mass of the propellant.
289+
"""Property to store the initial mass of the propellant, this includes
290+
fuel and oxidizer.
285291
286292
Returns
287293
-------
@@ -292,8 +298,9 @@ def propellant_initial_mass(self):
292298

293299
@funcify_method("Time (s)", "Mass flow rate (kg/s)", extrapolation="zero")
294300
def mass_flow_rate(self):
295-
"""Evaluates the mass flow rate of the motor as the sum of each tank
296-
mass flow rate.
301+
"""Evaluates the mass flow rate of the motor as the sum of mass flow
302+
rate from each tank, which may include fuel and oxidizer and usually
303+
vary with time.
297304
298305
Returns
299306
-------
@@ -317,12 +324,12 @@ def mass_flow_rate(self):
317324
def center_of_propellant_mass(self):
318325
"""Evaluates the center of mass of the motor from each tank center of
319326
mass and positioning. The center of mass height is measured relative to
320-
the motor nozzle.
327+
the origin of the motor's coordinate system.
321328
322329
Returns
323330
-------
324331
Function
325-
Center of mass of the motor, in meters.
332+
Position of the propellant center of mass, in meters.
326333
"""
327334
total_mass = 0
328335
mass_balance = 0

rocketpy/motors/motor.py

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,23 @@ class Motor(ABC):
3636
:doc:`Positions and Coordinate Systems </user/positions>` for more
3737
information.
3838
Motor.dry_mass : float
39-
The total mass of the motor structure, including chambers
40-
and tanks, when it is empty and does not contain any propellant.
39+
The mass of the motor when devoid of any propellants, measured in
40+
kilograms (kg). It encompasses the structural weight of the motor,
41+
including the combustion chamber, nozzles, tanks, and fasteners.
42+
Excluded from this measure are the propellants and any other elements
43+
that are dynamically accounted for in the `mass` parameter of the rocket
44+
class. Ensure that mass contributions from components shared with the
45+
rocket structure are not recounted here. This parameter does not vary
46+
with time.
4147
Motor.propellant_initial_mass : float
42-
Total propellant initial mass in kg.
48+
Total propellant initial mass in kg, including solid, liquid and gas
49+
phases.
4350
Motor.total_mass : Function
4451
Total motor mass in kg as a function of time, defined as the sum
45-
of propellant and dry mass.
52+
of propellant mass and the motor's dry mass (i.e. structure mass).
4653
Motor.propellant_mass : Function
47-
Total propellant mass in kg as a function of time.
54+
Total propellant mass in kg as a function of time, including solid,
55+
liquid and gas phases.
4856
Motor.total_mass_flow_rate : Function
4957
Time derivative of propellant total mass in kg/s as a function
5058
of time as obtained by the thrust source.
@@ -174,8 +182,7 @@ def __init__(
174182
.. seealso:: :doc:`Thrust Source Details </user/motors/thrust>`
175183
176184
dry_mass : int, float
177-
The total mass of the motor structure, including chambers
178-
and tanks, when it is empty and does not contain any propellant.
185+
Same as in Motor class. See the :class:`Motor <rocketpy.Motor>` docs
179186
center_of_dry_mass_position : int, float
180187
The position, in meters, of the motor's center of mass with respect
181188
to the motor's coordinate system when it is devoid of propellant.
@@ -378,19 +385,19 @@ def exhaust_velocity(self):
378385
"""
379386
pass
380387

381-
@funcify_method("Time (s)", "total mass (kg)")
388+
@funcify_method("Time (s)", "Total mass (kg)")
382389
def total_mass(self):
383390
"""Total mass of the motor as a function of time. It is defined as the
384391
propellant mass plus the dry mass.
385392
386393
Returns
387394
-------
388395
Function
389-
Total mass as a function of time.
396+
Motor total mass as a function of time.
390397
"""
391398
return self.propellant_mass + self.dry_mass
392399

393-
@funcify_method("Time (s)", "propellant mass (kg)")
400+
@funcify_method("Time (s)", "Propellant mass (kg)")
394401
def propellant_mass(self):
395402
"""Total propellant mass as a Function of time.
396403
@@ -403,11 +410,10 @@ def propellant_mass(self):
403410
self.total_mass_flow_rate.integral_function() + self.propellant_initial_mass
404411
)
405412

406-
@funcify_method("Time (s)", "mass dot (kg/s)", extrapolation="zero")
413+
@funcify_method("Time (s)", "Mass flow rate (kg/s)", extrapolation="zero")
407414
def total_mass_flow_rate(self):
408-
"""Time derivative of propellant mass. Assumes constant exhaust
409-
velocity. The formula used is the opposite of thrust divided by
410-
exhaust velocity.
415+
"""Time derivative of the propellant mass as a function of time. The
416+
formula used is the opposite of thrust divided by exhaust velocity.
411417
412418
Returns
413419
-------
@@ -427,10 +433,8 @@ def total_mass_flow_rate(self):
427433
Notes
428434
-----
429435
This function computes the total mass flow rate of the motor by
430-
dividing the thrust data by a constant approximation of the exhaust
431-
velocity.
432-
This approximation of the total mass flow rate is used in the
433-
following manner by the child Motor classes:
436+
dividing the thrust data by the exhaust velocity. This is an
437+
approximation, and it is used by the child Motor classes as follows:
434438
435439
- The ``SolidMotor`` class uses this approximation to compute the
436440
grain's mass flow rate;
@@ -449,7 +453,7 @@ def total_mass_flow_rate(self):
449453
@property
450454
@abstractmethod
451455
def propellant_initial_mass(self):
452-
"""Propellant initial mass in kg.
456+
"""Propellant initial mass in kg, including solid, liquid and gas phases
453457
454458
Returns
455459
-------
@@ -478,8 +482,8 @@ def center_of_mass(self):
478482
@abstractmethod
479483
def center_of_propellant_mass(self):
480484
"""Position of the propellant center of mass as a function of time.
481-
The position is specified as a scalar, relative to the motor's
482-
coordinate system.
485+
The position is specified as a scalar, relative to the origin of the
486+
motor's coordinate system.
483487
484488
Returns
485489
-------
@@ -501,7 +505,7 @@ def I_11(self):
501505
Notes
502506
-----
503507
The e_1 direction is assumed to be the direction perpendicular to the
504-
motor body axis.
508+
motor body axis. Also, due to symmetry, I_11 = I_22.
505509
506510
References
507511
----------
@@ -540,7 +544,8 @@ def I_22(self):
540544
Notes
541545
-----
542546
The e_2 direction is assumed to be the direction perpendicular to the
543-
motor body axis, and perpendicular to e_1.
547+
motor body axis, and perpendicular to e_1. Also, due to symmetry,
548+
I_22 = I_11.
544549
545550
References
546551
----------
@@ -667,6 +672,7 @@ def I_23(self):
667672
----------
668673
https://en.wikipedia.org/wiki/Moment_of_inertia
669674
"""
675+
# wrt = with respect to
670676
# Propellant inertia tensor 23 component wrt propellant center of mass
671677
propellant_I_23 = self.propellant_I_23
672678

@@ -1103,8 +1109,7 @@ def __init__(
11031109
coordinate system.
11041110
See :doc:`Positions and Coordinate Systems </user/positions>`
11051111
dry_mass : int, float
1106-
The total mass of the motor structure, including chambers
1107-
and tanks, when it is empty and does not contain any propellant.
1112+
Same as in Motor class. See the :class:`Motor <rocketpy.Motor>` docs
11081113
propellant_initial_mass : int, float
11091114
The initial mass of the propellant in the motor.
11101115
center_of_dry_mass_position : int, float, optional

0 commit comments

Comments
 (0)