@@ -1175,7 +1175,10 @@ def __init_equations_of_motion(self):
11751175
11761176 @cached_property
11771177 def effective_1rl (self ):
1178- nozzle = self .rocket .motor_position
1178+ """Original rail length minus the distance measured from nozzle exit
1179+ to the upper rail button. It assumes the nozzle to be aligned with
1180+ the beginning of the rail."""
1181+ nozzle = self .rocket .nozzle_position
11791182 try :
11801183 rail_buttons = self .rocket .rail_buttons [0 ]
11811184 upper_r_button = (
@@ -1189,7 +1192,10 @@ def effective_1rl(self):
11891192
11901193 @cached_property
11911194 def effective_2rl (self ):
1192- nozzle = self .rocket .motor_position
1195+ """Original rail length minus the distance measured from nozzle exit
1196+ to the lower rail button. It assumes the nozzle to be aligned with
1197+ the beginning of the rail."""
1198+ nozzle = self .rocket .nozzle_position
11931199 try :
11941200 rail_buttons = self .rocket .rail_buttons [0 ]
11951201 lower_r_button = rail_buttons .position
@@ -1379,7 +1385,7 @@ def u_dot(self, t, u, post_processing=False):
13791385 )
13801386 # c = -self.rocket.distance_rocket_nozzle
13811387 c = (
1382- - (self .rocket .motor_position - self .rocket .center_of_dry_mass_position )
1388+ - (self .rocket .nozzle_position - self .rocket .center_of_dry_mass_position )
13831389 * self .rocket ._csys
13841390 )
13851391 a = b * Mt / M
@@ -1634,7 +1640,7 @@ def u_dot_generalized(self, t, u, post_processing=False):
16341640 r_CM_ddot = Vector ([0 , 0 , r_CM_z .differentiate (t , order = 2 )])
16351641 ## Nozzle gyration tensor
16361642 r_NOZ = (
1637- - (self .rocket .motor_position - self .rocket .center_of_dry_mass_position )
1643+ - (self .rocket .nozzle_position - self .rocket .center_of_dry_mass_position )
16381644 * self .rocket ._csys
16391645 )
16401646 S_noz_33 = 0.5 * self .rocket .motor .nozzle_radius ** 2
@@ -2436,23 +2442,10 @@ def aerodynamic_spin_moment(self):
24362442 # Kinetic Energy
24372443 @funcify_method ("Time (s)" , "Rotational Kinetic Energy (J)" )
24382444 def rotational_energy (self ):
2439- # b = -self.rocket.distanceRocketPropellant
2440- b = (
2441- - (self .rocket .motor_position - self .rocket .center_of_dry_mass_position )
2442- * self .rocket ._csys
2443- )
2444- mu = self .rocket .reduced_mass
2445- Rz = self .rocket .dry_I_33
2446- Ri = self .rocket .dry_I_11
2447- Tz = self .rocket .motor .I_33
2448- Ti = self .rocket .motor .I_11
2449- I1 , I2 , I3 = (Ri + Ti + mu * b ** 2 ), (Ri + Ti + mu * b ** 2 ), (Rz + Tz )
2450- # Redefine I1, I2 and I3 time grid to allow for efficient Function algebra
2451- I1 .set_discrete_based_on_model (self .w1 )
2452- I2 .set_discrete_based_on_model (self .w1 )
2453- I3 .set_discrete_based_on_model (self .w1 )
24542445 rotational_energy = 0.5 * (
2455- I1 * self .w1 ** 2 + I2 * self .w2 ** 2 + I3 * self .w3 ** 2
2446+ self .rocket .I_11 * self .w1 ** 2
2447+ + self .rocket .I_22 * self .w2 ** 2
2448+ + self .rocket .I_33 * self .w3 ** 2
24562449 )
24572450 rotational_energy .set_discrete_based_on_model (self .w1 )
24582451 return rotational_energy
@@ -2610,40 +2603,6 @@ def stability_margin(self):
26102603 return [(t , self .rocket .stability_margin (m , t )) for t , m in self .mach_number ]
26112604
26122605 # Rail Button Forces
2613- @cached_property
2614- def effective_1rl (self ):
2615- """Original rail length minus the distance measured from nozzle exit
2616- to the upper rail button. It assumes the nozzle to be aligned with
2617- the beginning of the rail."""
2618- nozzle = (
2619- self .rocket .motor_position - self .rocket .center_of_dry_mass_position
2620- ) * self .rocket ._csys # Kinda works for single nozzle
2621- try :
2622- rail_buttons = self .rocket .rail_buttons [0 ]
2623- upper_r_button = (
2624- rail_buttons .component .buttons_distance + rail_buttons .position
2625- )
2626- except IndexError : # No rail buttons defined
2627- upper_r_button = nozzle
2628- effective_1rl = self .rail_length - abs (nozzle - upper_r_button )
2629- return effective_1rl
2630-
2631- @cached_property
2632- def effective_2rl (self ):
2633- """Original rail length minus the distance measured from nozzle exit
2634- to the lower rail button. It assumes the nozzle to be aligned with
2635- the beginning of the rail."""
2636- nozzle = (
2637- self .rocket .motor_position - self .rocket .center_of_dry_mass_position
2638- ) * self .rocket ._csys
2639- try :
2640- rail_buttons = self .rocket .rail_buttons [0 ]
2641- lower_r_button = rail_buttons .position
2642- except IndexError : # No rail buttons defined
2643- lower_r_button = nozzle
2644- effective_2rl = self .rail_length - abs (nozzle - lower_r_button )
2645- return effective_2rl
2646-
26472606 @cached_property
26482607 def frontal_surface_wind (self ):
26492608 """Surface wind speed in m/s aligned with the launch rail."""
0 commit comments