@@ -1173,7 +1173,10 @@ def __init_equations_of_motion(self):
11731173
11741174 @cached_property
11751175 def effective_1rl (self ):
1176- nozzle = self .rocket .motor_position
1176+ """Original rail length minus the distance measured from nozzle exit
1177+ to the upper rail button. It assumes the nozzle to be aligned with
1178+ the beginning of the rail."""
1179+ nozzle = self .rocket .nozzle_position
11771180 try :
11781181 rail_buttons = self .rocket .rail_buttons [0 ]
11791182 upper_r_button = (
@@ -1187,7 +1190,10 @@ def effective_1rl(self):
11871190
11881191 @cached_property
11891192 def effective_2rl (self ):
1190- nozzle = self .rocket .motor_position
1193+ """Original rail length minus the distance measured from nozzle exit
1194+ to the lower rail button. It assumes the nozzle to be aligned with
1195+ the beginning of the rail."""
1196+ nozzle = self .rocket .nozzle_position
11911197 try :
11921198 rail_buttons = self .rocket .rail_buttons [0 ]
11931199 lower_r_button = rail_buttons .position
@@ -1377,7 +1383,7 @@ def u_dot(self, t, u, post_processing=False):
13771383 )
13781384 # c = -self.rocket.distance_rocket_nozzle
13791385 c = (
1380- - (self .rocket .motor_position - self .rocket .center_of_dry_mass_position )
1386+ - (self .rocket .nozzle_position - self .rocket .center_of_dry_mass_position )
13811387 * self .rocket ._csys
13821388 )
13831389 a = b * Mt / M
@@ -1632,7 +1638,7 @@ def u_dot_generalized(self, t, u, post_processing=False):
16321638 r_CM_ddot = Vector ([0 , 0 , r_CM_z .differentiate (t , order = 2 )])
16331639 ## Nozzle gyration tensor
16341640 r_NOZ = (
1635- - (self .rocket .motor_position - self .rocket .center_of_dry_mass_position )
1641+ - (self .rocket .nozzle_position - self .rocket .center_of_dry_mass_position )
16361642 * self .rocket ._csys
16371643 )
16381644 S_noz_33 = 0.5 * self .rocket .motor .nozzle_radius ** 2
@@ -2411,23 +2417,10 @@ def aerodynamic_spin_moment(self):
24112417 # Kinetic Energy
24122418 @funcify_method ("Time (s)" , "Rotational Kinetic Energy (J)" )
24132419 def rotational_energy (self ):
2414- # b = -self.rocket.distanceRocketPropellant
2415- b = (
2416- - (self .rocket .motor_position - self .rocket .center_of_dry_mass_position )
2417- * self .rocket ._csys
2418- )
2419- mu = self .rocket .reduced_mass
2420- Rz = self .rocket .dry_I_33
2421- Ri = self .rocket .dry_I_11
2422- Tz = self .rocket .motor .I_33
2423- Ti = self .rocket .motor .I_11
2424- I1 , I2 , I3 = (Ri + Ti + mu * b ** 2 ), (Ri + Ti + mu * b ** 2 ), (Rz + Tz )
2425- # Redefine I1, I2 and I3 time grid to allow for efficient Function algebra
2426- I1 .set_discrete_based_on_model (self .w1 )
2427- I2 .set_discrete_based_on_model (self .w1 )
2428- I3 .set_discrete_based_on_model (self .w1 )
24292420 rotational_energy = 0.5 * (
2430- I1 * self .w1 ** 2 + I2 * self .w2 ** 2 + I3 * self .w3 ** 2
2421+ self .rocket .I_11 * self .w1 ** 2
2422+ + self .rocket .I_22 * self .w2 ** 2
2423+ + self .rocket .I_33 * self .w3 ** 2
24312424 )
24322425 rotational_energy .set_discrete_based_on_model (self .w1 )
24332426 return rotational_energy
@@ -2564,41 +2557,6 @@ def static_margin(self):
25642557 """Static margin of the rocket."""
25652558 return self .rocket .static_margin
25662559
2567- # Rail Button Forces
2568- @cached_property
2569- def effective_1rl (self ):
2570- """Original rail length minus the distance measured from nozzle exit
2571- to the upper rail button. It assumes the nozzle to be aligned with
2572- the beginning of the rail."""
2573- nozzle = (
2574- self .rocket .motor_position - self .rocket .center_of_dry_mass_position
2575- ) * self .rocket ._csys # Kinda works for single nozzle
2576- try :
2577- rail_buttons = self .rocket .rail_buttons [0 ]
2578- upper_r_button = (
2579- rail_buttons .component .buttons_distance + rail_buttons .position
2580- )
2581- except IndexError : # No rail buttons defined
2582- upper_r_button = nozzle
2583- effective_1rl = self .rail_length - abs (nozzle - upper_r_button )
2584- return effective_1rl
2585-
2586- @cached_property
2587- def effective_2rl (self ):
2588- """Original rail length minus the distance measured from nozzle exit
2589- to the lower rail button. It assumes the nozzle to be aligned with
2590- the beginning of the rail."""
2591- nozzle = (
2592- self .rocket .motor_position - self .rocket .center_of_dry_mass_position
2593- ) * self .rocket ._csys
2594- try :
2595- rail_buttons = self .rocket .rail_buttons [0 ]
2596- lower_r_button = rail_buttons .position
2597- except IndexError : # No rail buttons defined
2598- lower_r_button = nozzle
2599- effective_2rl = self .rail_length - abs (nozzle - lower_r_button )
2600- return effective_2rl
2601-
26022560 @cached_property
26032561 def frontal_surface_wind (self ):
26042562 """Surface wind speed in m/s aligned with the launch rail."""
0 commit comments