Skip to content

Commit 5e1fedc

Browse files
committed
ENH: create rocket.nozzle_position
1 parent ffc0ab1 commit 5e1fedc

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

rocketpy/prints/rocket_prints.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def rocket_geometrical_parameters(self):
9494
"Rocket Center of Dry Mass - Nozzle Exit Distance: "
9595
+ "{:.3f} m".format(
9696
abs(
97-
self.rocket.center_of_dry_mass_position - self.rocket.motor_position
97+
self.rocket.center_of_dry_mass_position
98+
- self.rocket.nozzle_position
9899
)
99100
)
100101
)

rocketpy/rocket/rocket.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ class Rocket:
100100
Rocket.motor : Motor
101101
Rocket's motor. See Motor class for more details.
102102
Rocket.motor_position : float
103-
Position, in m, of the motor's nozzle exit area relative to the user
104-
defined rocket coordinate system. See
105-
:doc:`Positions and Coordinate Systems </user/positions>`
103+
Position, in meters, of the motor's coordinate system origin
104+
relative to the user defined rocket coordinate system.
105+
See :doc:`Positions and Coordinate Systems </user/positions>`
106106
for more information
107107
regarding the rocket's coordinate system.
108108
Rocket.center_of_propellant_position : Function
@@ -650,6 +650,7 @@ def add_motor(self, motor, position):
650650
self.motor_center_of_dry_mass_position = (
651651
self.motor.center_of_dry_mass_position * _ + self.motor_position
652652
)
653+
self.nozzle_position = self.motor.nozzle_position * _ + self.motor_position
653654
self.evaluate_dry_mass()
654655
self.evaluate_total_mass()
655656
self.evaluate_center_of_dry_mass()

0 commit comments

Comments
 (0)