@@ -504,7 +504,6 @@ def __init__( # pylint: disable=too-many-arguments,too-many-statements
504504 equations_of_motion = "standard" ,
505505 ode_solver = "LSODA" ,
506506 simulation_mode = "6 DOF" ,
507- weathercock_coeff = 0.0 ,
508507 ):
509508 """Run a trajectory simulation.
510509
@@ -588,16 +587,6 @@ def __init__( # pylint: disable=too-many-arguments,too-many-statements
588587 A custom ``scipy.integrate.OdeSolver`` can be passed as well.
589588 For more information on the integration methods, see the scipy
590589 documentation [1]_.
591- weathercock_coeff : float, optional
592- Proportionality coefficient (rate coefficient) for the alignment rate of the rocket's body axis
593- with the relative wind direction in 3-DOF simulations, in rad/s. The actual angular velocity
594- applied to align the rocket is calculated as ``weathercock_coeff * sin(angle)``, where ``angle``
595- is the angle between the rocket's axis and the wind direction. A higher value means faster alignment
596- (quasi-static weathercocking). This parameter is only used when simulation_mode is '3 DOF'.
597- Default is 0.0 to mimic a pure 3-DOF simulation without any weathercocking (fixed attitude).
598- Set to a positive value to enable quasi-static weathercocking behaviour.
599-
600-
601590 Returns
602591 -------
603592 None
@@ -627,7 +616,6 @@ def __init__( # pylint: disable=too-many-arguments,too-many-statements
627616 self .equations_of_motion = equations_of_motion
628617 self .simulation_mode = simulation_mode
629618 self .ode_solver = ode_solver
630- self .weathercock_coeff = weathercock_coeff
631619
632620 # Controller initialization
633621 self .__init_controllers ()
@@ -2310,7 +2298,8 @@ def u_dot_generalized_3dof(self, t, u, post_processing=False):
23102298 r_dot = [vx , vy , vz ]
23112299 # Weathercocking: evolve body axis direction toward relative wind
23122300 # The body z-axis (attitude vector) should align with -freestream_velocity
2313- if self .weathercock_coeff > 0 and free_stream_speed > 1e-6 :
2301+ weathercock_coeff = getattr (self .rocket , "weathercock_coeff" , 0.0 )
2302+ if weathercock_coeff > 0 and free_stream_speed > 1e-6 :
23142303 # Current body z-axis in inertial frame (attitude vector)
23152304 # From rotation matrix: column 3 gives the body z-axis in inertial frame
23162305 body_z_inertial = Vector (
@@ -2342,7 +2331,7 @@ def u_dot_generalized_3dof(self, t, u, post_processing=False):
23422331 sin_angle = min (1.0 , max (- 1.0 , rotation_axis_mag ))
23432332
23442333 # Angular velocity magnitude proportional to misalignment angle
2345- omega_mag = self . weathercock_coeff * sin_angle
2334+ omega_mag = weathercock_coeff * sin_angle
23462335
23472336 # Angular velocity in inertial frame, then transform to body frame
23482337 omega_body = Kt @ (rotation_axis * omega_mag )
@@ -2363,7 +2352,7 @@ def u_dot_generalized_3dof(self, t, u, post_processing=False):
23632352 )
23642353 rotation_axis = perp_axis .unit_vector
23652354 # 180 degree rotation: sin(angle) = 1
2366- omega_mag = self . weathercock_coeff * 1.0
2355+ omega_mag = weathercock_coeff * 1.0
23672356 omega_body = Kt @ (rotation_axis * omega_mag )
23682357 # else: aligned (dot > 0.999) - no rotation needed, omega_body stays None
23692358
0 commit comments