aerosandbox.dynamics.rigid_body =============================== .. py:module:: aerosandbox.dynamics.rigid_body Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/aerosandbox/dynamics/rigid_body/common_rigid_body/index /autoapi/aerosandbox/dynamics/rigid_body/rigid_2D/index /autoapi/aerosandbox/dynamics/rigid_body/rigid_3D/index Classes ------- .. autoapisummary:: aerosandbox.dynamics.rigid_body.DynamicsRigidBody2DBody aerosandbox.dynamics.rigid_body.DynamicsRigidBody3DBodyEuler Package Contents ---------------- .. py:class:: DynamicsRigidBody2DBody(mass_props = None, x_e = 0, z_e = 0, u_b = 0, w_b = 0, theta = 0, q = 0) Bases: :py:obj:`aerosandbox.dynamics.rigid_body.rigid_3D.body_euler.DynamicsRigidBody3DBodyEuler` Dynamics instance: * simulating a rigid body * in 2D * with velocity parameterized in body axes State variables: x_e: x-position, in Earth axes. [meters] z_e: z-position, in Earth axes. [meters] u_b: x-velocity, in body axes. [m/s] w_b: z-velocity, in body axes. [m/s] theta: pitch angle. [rad] q: y-angular-velocity, in body axes. [rad/sec] Control variables: Fx_b: Force along the body-x axis. [N] Fz_b: Force along the body-z axis. [N] My_b: Moment about the body-y axis. [Nm] .. py:attribute:: mass_props For each state variable, self.state_var = state_var For each indirect control variable, self.indirect_control_var = indirect_control_var For each control variable, self.control_var = 0 .. py:attribute:: x_e :value: 0 .. py:attribute:: y_e :value: 0 .. py:attribute:: z_e :value: 0 .. py:attribute:: u_b :value: 0 .. py:attribute:: v_b :value: 0 .. py:attribute:: w_b :value: 0 .. py:attribute:: phi :value: 0 .. py:attribute:: theta :value: 0 .. py:attribute:: psi :value: 0 .. py:attribute:: p :value: 0 .. py:attribute:: q :value: 0 .. py:attribute:: r :value: 0 .. py:attribute:: Fx_b :value: 0 .. py:attribute:: Fy_b :value: 0 .. py:attribute:: Fz_b :value: 0 .. py:attribute:: Mx_b :value: 0 .. py:attribute:: My_b :value: 0 .. py:attribute:: Mz_b :value: 0 .. py:attribute:: hx_b :value: 0 .. py:attribute:: hy_b :value: 0 .. py:attribute:: hz_b :value: 0 .. py:property:: state Returns the state variables of this Dynamics instance as a Dict. Keys are strings that give the name of the variables. Values are the variables themselves. This method should look something like: >>> { >>> "x_e": self.x_e, >>> "u_e": self.u_e, >>> ... >>> } .. py:property:: control_variables .. py:method:: state_derivatives() Computes the state derivatives (i.e. equations of motion) for a body in 3D space. Based on Section 9.8.2 of Flight Vehicle Aerodynamics by Mark Drela. :returns: { "xe" : d_xe, "ye" : d_ye, "ze" : d_ze, "u" : d_u, "v" : d_v, "w" : d_w, "phi" : d_phi, "theta": d_theta, "psi" : d_psi, "p" : d_p, "q" : d_q, "r" : d_r, } :rtype: Time derivatives of each of the 12 state variables, given in a dictionary .. py:class:: DynamicsRigidBody3DBodyEuler(mass_props = None, x_e = 0, y_e = 0, z_e = 0, u_b = 0, v_b = 0, w_b = 0, phi = 0, theta = 0, psi = 0, p = 0, q = 0, r = 0) Bases: :py:obj:`aerosandbox.dynamics.rigid_body.common_rigid_body._DynamicsRigidBodyBaseClass` Dynamics instance: * simulating a rigid body * in 3D * with velocity parameterized in body axes * and angle parameterized in Euler angles State variables: x_e: x-position, in Earth axes. [meters] y_e: y-position, in Earth axes. [meters] z_e: z-position, in Earth axes. [meters] u_b: x-velocity, in body axes. [m/s] v_b: y-velocity, in body axes. [m/s] w_b: z-velocity, in body axes. [m/s] phi: roll angle. Uses yaw-pitch-roll Euler angle convention. [rad] theta: pitch angle. Uses yaw-pitch-roll Euler angle convention. [rad] psi: yaw angle. Uses yaw-pitch-roll Euler angle convention. [rad] p: x-angular-velocity, in body axes. [rad/sec] q: y-angular-velocity, in body axes. [rad/sec] r: z-angular-velocity, in body axes. [rad/sec] Control variables: Fx_b: Force along the body-x axis. [N] Fy_b: Force along the body-y axis. [N] Fz_b: Force along the body-z axis. [N] Mx_b: Moment about the body-x axis. [Nm] My_b: Moment about the body-y axis. [Nm] Mz_b: Moment about the body-z axis. [Nm] hx_b: Angular momentum (e.g., propellers) about the body-x axis. [kg*m^2/sec] hy_b: Angular momentum (e.g., propellers) about the body-y axis. [kg*m^2/sec] hz_b: Angular momentum (e.g., propellers) about the body-z axis. [kg*m^2/sec] .. py:attribute:: mass_props For each state variable, self.state_var = state_var For each indirect control variable, self.indirect_control_var = indirect_control_var For each control variable, self.control_var = 0 .. py:attribute:: x_e :value: 0 .. py:attribute:: y_e :value: 0 .. py:attribute:: z_e :value: 0 .. py:attribute:: u_b :value: 0 .. py:attribute:: v_b :value: 0 .. py:attribute:: w_b :value: 0 .. py:attribute:: phi :value: 0 .. py:attribute:: theta :value: 0 .. py:attribute:: psi :value: 0 .. py:attribute:: p :value: 0 .. py:attribute:: q :value: 0 .. py:attribute:: r :value: 0 .. py:attribute:: Fx_b :value: 0 .. py:attribute:: Fy_b :value: 0 .. py:attribute:: Fz_b :value: 0 .. py:attribute:: Mx_b :value: 0 .. py:attribute:: My_b :value: 0 .. py:attribute:: Mz_b :value: 0 .. py:attribute:: hx_b :value: 0 .. py:attribute:: hy_b :value: 0 .. py:attribute:: hz_b :value: 0 .. py:property:: state Returns the state variables of this Dynamics instance as a Dict. Keys are strings that give the name of the variables. Values are the variables themselves. This method should look something like: >>> { >>> "x_e": self.x_e, >>> "u_e": self.u_e, >>> ... >>> } .. py:property:: control_variables .. py:method:: state_derivatives() Computes the state derivatives (i.e. equations of motion) for a body in 3D space. Based on Section 9.8.2 of Flight Vehicle Aerodynamics by Mark Drela. :returns: { "xe" : d_xe, "ye" : d_ye, "ze" : d_ze, "u" : d_u, "v" : d_v, "w" : d_w, "phi" : d_phi, "theta": d_theta, "psi" : d_psi, "p" : d_p, "q" : d_q, "r" : d_r, } :rtype: Time derivatives of each of the 12 state variables, given in a dictionary .. py:method:: convert_axes(x_from, y_from, z_from, from_axes, to_axes) Converts a vector [x_from, y_from, z_from], as given in the `from_axes` frame, to an equivalent vector [x_to, y_to, z_to], as given in the `to_axes` frame. Identical to OperatingPoint.convert_axes(), but adds in "earth" as a valid axis frame. For more documentation, see the docstring of OperatingPoint.convert_axes(). Both `from_axes` and `to_axes` should be a string, one of: * "geometry" * "body" * "wind" * "stability" * "earth" :param x_from: x-component of the vector, in `from_axes` frame. :param y_from: y-component of the vector, in `from_axes` frame. :param z_from: z-component of the vector, in `from_axes` frame. :param from_axes: The axes to convert from. :param to_axes: The axes to convert to. Returns: The x-, y-, and z-components of the vector, in `to_axes` frame. Given as a tuple. .. py:method:: add_force(Fx = 0, Fy = 0, Fz = 0, axes='body') Adds a force (in whichever axis system you choose) to this Dynamics instance. :param Fx: Force in the x-direction in the axis system chosen. [N] :param Fy: Force in the y-direction in the axis system chosen. [N] :param Fz: Force in the z-direction in the axis system chosen. [N] :param axes: The axis system that the specified force is in. One of: * "geometry" * "body" * "wind" * "stability" * "earth" Returns: None (in-place) .. py:method:: add_moment(Mx = 0, My = 0, Mz = 0, axes='body') Adds a moment (in whichever axis system you choose) to this Dynamics instance. :param Mx: Moment about the x-axis in the axis system chosen. Assumed these moments are applied about the center of mass. [Nm] :param My: Moment about the y-axis in the axis system chosen. Assumed these moments are applied about the center of mass. [Nm] :param Mz: Moment about the z-axis in the axis system chosen. Assumed these moments are applied about the center of mass. [Nm] :param axes: The axis system that the specified moment is in. One of: * "geometry" * "body" * "wind" * "stability" * "earth" Returns: None (in-place) .. py:property:: speed The speed of the object, expressed as a scalar. .. py:property:: alpha The angle of attack, in degrees. .. py:property:: beta The sideslip angle, in degrees.